summary refs log tree commit diff
path: root/pkgs/development/libraries/libarchive
diff options
context:
space:
mode:
authorAneesh Agrawal <aneeshusa@gmail.com>2016-08-18 23:56:39 -0400
committerAneesh Agrawal <aneeshusa@gmail.com>2016-08-18 23:58:03 -0400
commit0187c7df7cc7f4d7cb54624728f7a62137b47906 (patch)
tree39040134c87d9f79e480e92f7d8ebfe1be0e4ddb /pkgs/development/libraries/libarchive
parentc89959e625a90ce0b90a6776e387efb652f102ec (diff)
downloadnixpkgs-0187c7df7cc7f4d7cb54624728f7a62137b47906.tar
nixpkgs-0187c7df7cc7f4d7cb54624728f7a62137b47906.tar.gz
nixpkgs-0187c7df7cc7f4d7cb54624728f7a62137b47906.tar.bz2
nixpkgs-0187c7df7cc7f4d7cb54624728f7a62137b47906.tar.lz
nixpkgs-0187c7df7cc7f4d7cb54624728f7a62137b47906.tar.xz
nixpkgs-0187c7df7cc7f4d7cb54624728f7a62137b47906.tar.zst
nixpkgs-0187c7df7cc7f4d7cb54624728f7a62137b47906.zip
libarchive: make libxml2 (XAR support) optional
Defaults to unincluded to reduce closure size.
Diffstat (limited to 'pkgs/development/libraries/libarchive')
-rw-r--r--pkgs/development/libraries/libarchive/default.nix18
1 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix
index 0c5f900dd41..a13665791a1 100644
--- a/pkgs/development/libraries/libarchive/default.nix
+++ b/pkgs/development/libraries/libarchive/default.nix
@@ -1,5 +1,12 @@
-{ fetchurl, stdenv, acl, openssl, libxml2, attr, zlib, bzip2, e2fsprogs, xz, lzo
-, sharutils }:
+{
+  fetchurl, stdenv,
+  acl, attr, bzip2, e2fsprogs, libxml2, lzo, openssl, sharutils, xz, zlib,
+
+  # Optional
+  xarSupport ? false,
+}:
+
+assert xarSupport -> libxml2 != null;
 
 stdenv.mkDerivation rec {
   name = "libarchive-${version}";
@@ -10,12 +17,15 @@ stdenv.mkDerivation rec {
     sha256 = "1lngng84k1kkljl74q0cdqc3s82vn2kimfm02dgm4d6m7x71mvkj";
   };
 
-  buildInputs = [ sharutils libxml2 zlib bzip2 openssl xz lzo ] ++
-    stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ];
+  buildInputs = [ sharutils zlib bzip2 openssl xz lzo ]
+    ++ stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ]
+    ++ stdenv.lib.optional xarSupport libxml2;
 
   # Without this, pkgconfig-based dependencies are unhappy
   propagatedBuildInputs = stdenv.lib.optionals stdenv.isLinux [ attr acl ];
 
+  configureFlags = stdenv.lib.optional (!xarSupport) "--without-xml2";
+
   preBuild = if stdenv.isCygwin then ''
     echo "#include <windows.h>" >> config.h
   '' else null;