Merge pull request #102069 from nix-windows/libarchive-windows

libarchive: Fix MinGW build
This commit is contained in:
John Ericson 2020-10-29 19:31:28 -04:00 committed by GitHub
commit 66c9347db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -2,8 +2,10 @@
fetchFromGitHub, stdenv, pkgconfig, autoreconfHook,
acl, attr, bzip2, e2fsprogs, libxml2, lzo, openssl, sharutils, xz, zlib, zstd,
# Optional but increases closure only negligibly.
xarSupport ? true,
# Optional but increases closure only negligibly. Also, while libxml2
# builds fine on windows, but libarchive has trouble linking windows
# things it depends on for some reason.
xarSupport ? stdenv.hostPlatform.isUnix,
}:
assert xarSupport -> libxml2 != null;
@ -22,7 +24,9 @@ stdenv.mkDerivation rec {
outputs = [ "out" "lib" "dev" ];
nativeBuildInputs = [ pkgconfig autoreconfHook ];
buildInputs = [ sharutils zlib bzip2 openssl xz lzo zstd ]
buildInputs =
stdenv.lib.optional stdenv.hostPlatform.isUnix sharutils
++ [ zlib bzip2 openssl xz lzo zstd ]
++ stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ]
++ stdenv.lib.optional xarSupport libxml2;

View File

@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ bash ];
buildInputs = stdenv.lib.optional stdenv.hostPlatform.isUnix bash;
patches = [
./playtests-darwin.patch
@ -72,7 +72,9 @@ stdenv.mkDerivation rec {
--replace "zstdcat" "$bin/bin/zstdcat"
'';
outputs = [ "bin" "dev" "man" "out" ];
outputs = [ "bin" "dev" ]
++ stdenv.lib.optional stdenv.hostPlatform.isUnix "man"
++ [ "out" ];
meta = with stdenv.lib; {
description = "Zstandard real-time compression algorithm";