From 437dc4c047b9d7c5c8932ec6587fccb9793cac2a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 28 Oct 2020 23:24:01 +0000 Subject: [PATCH 1/2] zstd: Fix MinGW build --- pkgs/tools/compression/zstd/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix index 8ce434741a5..c26ca507525 100644 --- a/pkgs/tools/compression/zstd/default.nix +++ b/pkgs/tools/compression/zstd/default.nix @@ -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"; From 9f05c50be198a396eb6c555fc239a2e0da42c9a5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 29 Oct 2020 00:38:45 +0000 Subject: [PATCH 2/2] libarchive: Fix Windows build --- pkgs/development/libraries/libarchive/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix index d1917de37d6..3c97ce21ce0 100644 --- a/pkgs/development/libraries/libarchive/default.nix +++ b/pkgs/development/libraries/libarchive/default.nix @@ -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;