summary refs log tree commit diff
path: root/pkgs/development/libraries/libarchive
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-29 00:38:45 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-29 00:38:45 +0000
commit9f05c50be198a396eb6c555fc239a2e0da42c9a5 (patch)
tree120978949107023e882bd5abf1fadb05dea42880 /pkgs/development/libraries/libarchive
parent437dc4c047b9d7c5c8932ec6587fccb9793cac2a (diff)
downloadnixpkgs-9f05c50be198a396eb6c555fc239a2e0da42c9a5.tar
nixpkgs-9f05c50be198a396eb6c555fc239a2e0da42c9a5.tar.gz
nixpkgs-9f05c50be198a396eb6c555fc239a2e0da42c9a5.tar.bz2
nixpkgs-9f05c50be198a396eb6c555fc239a2e0da42c9a5.tar.lz
nixpkgs-9f05c50be198a396eb6c555fc239a2e0da42c9a5.tar.xz
nixpkgs-9f05c50be198a396eb6c555fc239a2e0da42c9a5.tar.zst
nixpkgs-9f05c50be198a396eb6c555fc239a2e0da42c9a5.zip
libarchive: Fix Windows build
Diffstat (limited to 'pkgs/development/libraries/libarchive')
-rw-r--r--pkgs/development/libraries/libarchive/default.nix10
1 files 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;