git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #8157 from monocell/spotify-fix

fix spotify by using older libgcrypt

commit8e564526fc50d59a7abbb8bdfd8fbd0009c403d0 authorlethalman <lucabru@src.gnome.org> dateThu 4 Jun 2015, 10:05 (12 years ago) parenta714ddc165cb05
2 files changed+53
pkgs/development/libraries/libgcrypt/1.5.nix+50 pkgs/top-level/all-packages.nix+3
pkgs/development/libraries/libgcrypt/1.5.nixnew file+50
@@ -0,0 +1,50 @@
1+{ stdenv, fetchurl
2+, libgpgerror
3+
4+# Optional Dependencies
5+, libcap ? null
6+}:
7+
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
18+stdenv.mkDerivation rec {
19+ name = "libgcrypt-1.5.4";
20+
21+ src = fetchurl {
22+ url = "mirror://gnupg/libgcrypt/${name}.tar.bz2";
23+ sha256 = "0czvqxkzd5y872ipy6s010ifwdwv29sqbnqc4pf56sd486gqvy6m";
24+ };
25+
26+ buildInputs = [ libgpgerror optLibcap ];
27+
28+ configureFlags = [
29+ (mkWith (optLibcap != null) "capabilities" null)
30+ ];
31+
32+ # Make sure libraries are correct for .pc and .la files
33+ # Also make sure includes are fixed for callers who don't use libgpgcrypt-config
34+ postInstall = ''
35+ 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
38+ '';
39+
40+ doCheck = true;
41+
42+ meta = with stdenv.lib; {
43+ homepage = https://www.gnu.org/software/libgcrypt/;
44+ description = "General-pupose cryptographic library";
45+ license = licenses.lgpl2Plus;
46+ platforms = platforms.all;
47+ maintainers = with maintainers; [ wkennington ];
48+ repositories.git = git://git.gnupg.org/libgcrypt.git;
49+ };
50+}
pkgs/top-level/all-packages.nix+3
@@ -6787,6 +6787,8 @@ let
67876787 libcap = null;
67886788 };
67896789
6790+ libgcrypt_1_5 = lowPrio (callPackage ../development/libraries/libgcrypt/1.5.nix { });
6791+
67906792 libgdiplus = callPackage ../development/libraries/libgdiplus { };
67916793
67926794 libgksu = callPackage ../development/libraries/libgksu { };
@@ -12417,6 +12419,7 @@ let
1241712419
1241812420 spotify = callPackage ../applications/audio/spotify {
1241912421 inherit (gnome) GConf;
12422+ libgcrypt = libgcrypt_1_5;
1242012423 libpng = libpng12;
1242112424 };
1242212425