git.iko.soy/typeable/nixpkgs
on master help sign in
libgcrypt: Revert to old style
commit330d198be1b06c482f46545830e65bbeab3a35d1 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateThu 4 Jun 2015, 11:14 (12 years ago) parentc47e78b
3 files changed+20−59
pkgs/development/libraries/libgcrypt/1.5.nix+7−22 pkgs/development/libraries/libgcrypt/default.nix+11−31 pkgs/top-level/all-packages.nix+2−6
pkgs/development/libraries/libgcrypt/1.5.nix+7−22
@@ -1,20 +1,7 @@
1−{ stdenv, fetchurl
2−, libgpgerror
1+{ lib, stdenv, fetchurl, libgpgerror, enableCapabilities ? false, libcap }:
32
4−# Optional Dependencies
5−, libcap ? null
6−}:
3+assert enableCapabilities -> stdenv.isLinux;
74
8−let
9− mkFlag = trueStr: falseStr: cond: name: val:
10− if cond == null then null else
11− "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
12− mkWith = mkFlag "with-" "without-";
13−
14− shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
15−
16− optLibcap = shouldUsePkg libcap;
17−in
185stdenv.mkDerivation rec {
196 name = "libgcrypt-1.5.4";
207
@@ -23,18 +10,16 @@ stdenv.mkDerivation rec {
2310 sha256 = "0czvqxkzd5y872ipy6s010ifwdwv29sqbnqc4pf56sd486gqvy6m";
2411 };
2512
26− buildInputs = [ libgpgerror optLibcap ];
27−
28− configureFlags = [
29− (mkWith (optLibcap != null) "capabilities" null)
30− ];
13+ buildInputs =
14+ [ libgpgerror ]
15+ ++ lib.optional enableCapabilities libcap;
3116
3217 # Make sure libraries are correct for .pc and .la files
3318 # Also make sure includes are fixed for callers who don't use libgpgcrypt-config
3419 postInstall = ''
3520 sed -i 's,#include <gpg-error.h>,#include "${libgpgerror}/include/gpg-error.h",g' $out/include/gcrypt.h
36− '' + stdenv.lib.optionalString (!stdenv.isDarwin && optLibcap != null) ''
37− sed -i 's,\(-lcap\),-L${optLibcap}/lib \1,' $out/lib/libgcrypt.la
21+ '' + stdenv.lib.optionalString enableCapabilities ''
22+ sed -i 's,\(-lcap\),-L${libcap}/lib \1,' $out/lib/libgcrypt.la
3823 '';
3924
4025 doCheck = true;
pkgs/development/libraries/libgcrypt/default.nix+11−31
@@ -1,24 +1,7 @@
1−{ stdenv, fetchurl
2−, libgpgerror
1+{ lib, stdenv, fetchurl, libgpgerror, enableCapabilities ? false, libcap }:
32
4−# Optional Dependencies
5−, libcap ? null, pth ? null
6−}:
3+assert enableCapabilities -> stdenv.isLinux;
74
8−let
9− mkFlag = trueStr: falseStr: cond: name: val:
10− if cond == null then null else
11− "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
12− mkEnable = mkFlag "enable-" "disable-";
13− mkWith = mkFlag "with-" "without-";
14− mkOther = mkFlag "" "" true;
15−
16− shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
17−
18− optLibcap = shouldUsePkg libcap;
19− #optPth = shouldUsePkg pth;
20− optPth = null; # Broken as of 1.6.3
21−in
225stdenv.mkDerivation rec {
236 name = "libgcrypt-1.6.3";
247
@@ -27,29 +10,26 @@ stdenv.mkDerivation rec {
2710 sha256 = "0pq2nwfqgggrsh8rk84659d80vfnlkbphwqjwahccd5fjdxr3d21";
2811 };
2912
30− buildInputs = [ libgpgerror optLibcap optPth ];
31−
32− configureFlags = [
33− (mkWith (optLibcap != null) "capabilities" null)
34− (mkEnable (optPth != null) "random-daemon" null)
35− ];
13+ buildInputs =
14+ [ libgpgerror ]
15+ ++ lib.optional enableCapabilities libcap;
3616
3717 # Make sure libraries are correct for .pc and .la files
3818 # Also make sure includes are fixed for callers who don't use libgpgcrypt-config
3919 postInstall = ''
4020 sed -i 's,#include <gpg-error.h>,#include "${libgpgerror}/include/gpg-error.h",g' $out/include/gcrypt.h
41− '' + stdenv.lib.optionalString (!stdenv.isDarwin && optLibcap != null) ''
42− sed -i 's,\(-lcap\),-L${optLibcap}/lib \1,' $out/lib/libgcrypt.la
21+ '' + stdenv.lib.optionalString enableCapabilities ''
22+ sed -i 's,\(-lcap\),-L${libcap}/lib \1,' $out/lib/libgcrypt.la
4323 '';
4424
4525 doCheck = true;
4626
47− meta = with stdenv.lib; {
27+ meta = {
4828 homepage = https://www.gnu.org/software/libgcrypt/;
4929 description = "General-pupose cryptographic library";
50− license = licenses.lgpl2Plus;
51− platforms = platforms.all;
52− maintainers = with maintainers; [ wkennington ];
30+ license = lib.licenses.lgpl2Plus;
31+ platforms = lib.platforms.all;
32+ maintainers = [ lib.maintainers.wkennington ];
5333 repositories.git = git://git.gnupg.org/libgcrypt.git;
5434 };
5535}
pkgs/top-level/all-packages.nix+2−6
@@ -6787,13 +6787,9 @@ let
67876787
67886788 libftdi1 = callPackage ../development/libraries/libftdi/1.x.nix { };
67896789
6790− libgcrypt = callPackage ../development/libraries/libgcrypt {
6791− # Breaks packages that expect to have elevated privileges
6792− # Ex. Lightdm, cryptsetup
6793− libcap = null;
6794− };
6790+ libgcrypt = callPackage ../development/libraries/libgcrypt { };
67956791
6796− libgcrypt_1_5 = lowPrio (callPackage ../development/libraries/libgcrypt/1.5.nix { });
6792+ libgcrypt_1_5 = callPackage ../development/libraries/libgcrypt/1.5.nix { };
67976793
67986794 libgdiplus = callPackage ../development/libraries/libgdiplus { };
67996795