From 0187c7df7cc7f4d7cb54624728f7a62137b47906 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Thu, 18 Aug 2016 23:56:39 -0400 Subject: libarchive: make libxml2 (XAR support) optional Defaults to unincluded to reduce closure size. --- pkgs/development/libraries/libarchive/default.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix index 0c5f900dd412..a13665791a18 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 " >> config.h '' else null; -- cgit 1.4.1 From 856b4623c4483237e96f393603413daa92178e8c Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Sun, 11 Sep 2016 11:51:04 +0200 Subject: libarchive: include XAR support by default Discussion: https://github.com/NixOS/nixpkgs/pull/17834 --- pkgs/development/libraries/libarchive/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix index a13665791a18..4fe7f62bf3ff 100644 --- a/pkgs/development/libraries/libarchive/default.nix +++ b/pkgs/development/libraries/libarchive/default.nix @@ -2,8 +2,8 @@ fetchurl, stdenv, acl, attr, bzip2, e2fsprogs, libxml2, lzo, openssl, sharutils, xz, zlib, - # Optional - xarSupport ? false, + # Optional but increases closure only negligibly. + xarSupport ? true, }: assert xarSupport -> libxml2 != null; -- cgit 1.4.1 From 5a9cbd6b5e9183dc58891206465b69d423d7a500 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Sun, 11 Sep 2016 12:02:08 +0200 Subject: libarchive: use pkgconfig It tends to make builds more reliable, in general. --- pkgs/development/libraries/libarchive/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix index 4fe7f62bf3ff..34ad2532d41d 100644 --- a/pkgs/development/libraries/libarchive/default.nix +++ b/pkgs/development/libraries/libarchive/default.nix @@ -1,5 +1,5 @@ { - fetchurl, stdenv, + fetchurl, stdenv, pkgconfig, acl, attr, bzip2, e2fsprogs, libxml2, lzo, openssl, sharutils, xz, zlib, # Optional but increases closure only negligibly. @@ -17,6 +17,7 @@ stdenv.mkDerivation rec { sha256 = "1lngng84k1kkljl74q0cdqc3s82vn2kimfm02dgm4d6m7x71mvkj"; }; + nativeBuildInputs = [ pkgconfig ]; buildInputs = [ sharutils zlib bzip2 openssl xz lzo ] ++ stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ] ++ stdenv.lib.optional xarSupport libxml2; -- cgit 1.4.1 From e0b5eef4e7d21d0a914e248635f1f9360772a6d9 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Thu, 1 Sep 2016 18:31:26 +0300 Subject: lib.chooseDevOutputs: Use lib.getDev Reduces duplication, plus is actually needed for Go packages (at least go-repo-root). --- lib/attrsets.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 686e125f100c..539eeb7b1721 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -455,7 +455,7 @@ rec { getDev = getOutput "dev"; /* Pick the outputs of packages to place in buildInputs */ - chooseDevOutputs = drvs: builtins.map (drv: if drv.outputUnspecified or false then drv.dev or drv else drv) drvs; + chooseDevOutputs = drvs: builtins.map getDev drvs; /*** deprecated stuff ***/ -- cgit 1.4.1