git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #133360 from SuperSandro2000/nspr_nss
commit7e793f275672a698ee59355c226372b89058b014 authorSandro <sandro.jaeckel@gmail.com> dateTue 10 Aug 2021, 14:26 (5 years ago) parent178b77ecf42c59
4 files changed+179−144
pkgs/development/libraries/nspr/default.nix+9−5 pkgs/development/libraries/nss/3.53.nix+82−66 pkgs/development/libraries/nss/default.nix+85−71 pkgs/development/libraries/nss_wrapper/default.nix+3−2
pkgs/development/libraries/nspr/default.nix+9−5
@@ -1,6 +1,9 @@
1−{ lib, stdenv, fetchurl
2−, CoreServices ? null
3−, buildPackages }:
1+{ lib
2+, stdenv
3+, fetchurl
4+, CoreServices
5+, buildPackages
6+}:
47
58stdenv.mkDerivation rec {
69 pname = "nspr";
@@ -37,13 +40,14 @@ stdenv.mkDerivation rec {
3740 moveToOutput share "$dev" # just aclocal
3841 '';
3942
40− buildInputs = [] ++ lib.optionals stdenv.isDarwin [ CoreServices ];
43+ buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ];
4144
4245 enableParallelBuilding = true;
4346
4447 meta = with lib; {
45− homepage = "http://www.mozilla.org/projects/nspr/";
48+ homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Reference/NSPR_functions";
4649 description = "Netscape Portable Runtime, a platform-neutral API for system-level and libc-like functions";
50+ maintainers = with maintainers; [ ];
4751 platforms = platforms.all;
4852 license = licenses.mpl20;
4953 };
pkgs/development/libraries/nss/3.53.nix+82−66
@@ -1,4 +1,14 @@
1−{ lib, stdenv, fetchurl, nspr, perl, zlib, sqlite, darwin, fixDarwinDylibNames, buildPackages, ninja
1+{ lib
2+, stdenv
3+, fetchurl
4+, nspr
5+, perl
6+, zlib
7+, sqlite
8+, darwin
9+, fixDarwinDylibNames
10+, buildPackages
11+, ninja
212, # allow FIPS mode. Note that this makes the output non-reproducible.
313 # https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Tech_Notes/nss_tech_note6
414 enableFIPS ? false
@@ -9,7 +19,8 @@ let
919 url = "http://dev.gentoo.org/~polynomial-c/mozilla/nss-3.15.4-pem-support-20140109.patch.xz";
1020 sha256 = "10ibz6y0hknac15zr6dw4gv9nb5r5z9ym6gq18j3xqx7v7n3vpdw";
1121 };
12−in stdenv.mkDerivation rec {
22+in
23+stdenv.mkDerivation rec {
1324 pname = "nss";
1425 version = "3.53.1";
1526
@@ -44,55 +55,58 @@ in stdenv.mkDerivation rec {
4455 substituteInPlace nss/coreconf/config.gypi --replace "/usr/bin/grep" "${buildPackages.coreutils}/bin/env grep"
4556 '';
4657
47− patches =
48− [
49− # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
50− ./85_security_load.patch
51− ./ckpem.patch
52− ./fix-cross-compilation.patch
53− ];
58+ patches = [
59+ # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
60+ ./85_security_load.patch
61+ ./ckpem.patch
62+ ./fix-cross-compilation.patch
63+ ];
5464
5565 patchFlags = [ "-p0" ];
5666
5767 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
58− substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
59− substituteInPlace nss/coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'"
60− '';
68+ substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
69+ substituteInPlace nss/coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'"
70+ '';
6171
6272 outputs = [ "out" "dev" "tools" ];
6373
6474 preConfigure = "cd nss";
6575
66− buildPhase = let
67− getArch = platform: if platform.isx86_64 then "x64"
68− else if platform.isx86_32 then "ia32"
69− else if platform.isAarch32 then "arm"
70− else if platform.isAarch64 then "arm64"
71− else if platform.isPower && platform.is64bit then (
76+ buildPhase =
77+ let
78+ getArch = platform:
79+ if platform.isx86_64 then "x64"
80+ else if platform.isx86_32 then "ia32"
81+ else if platform.isAarch32 then "arm"
82+ else if platform.isAarch64 then "arm64"
83+ else if platform.isPower && platform.is64bit then
84+ (
7285 if platform.isLittleEndian then "ppc64le" else "ppc64"
7386 )
74− else platform.parsed.cpu.name;
75− # yes, this is correct. nixpkgs uses "host" for the platform the binary will run on whereas nss uses "host" for the platform that the build is running on
76− target = getArch stdenv.hostPlatform;
77− host = getArch stdenv.buildPlatform;
78− in ''
79− runHook preBuild
80−
81− sed -i 's|nss_dist_dir="$dist_dir"|nss_dist_dir="'$out'"|;s|nss_dist_obj_dir="$obj_dir"|nss_dist_obj_dir="'$out'"|' build.sh
82− ./build.sh -v --opt \
83− --with-nspr=${nspr.dev}/include:${nspr.out}/lib \
84− --system-sqlite \
85− --enable-legacy-db \
86− --target ${target} \
87− -Dhost_arch=${host} \
88− -Duse_system_zlib=1 \
89− --enable-libpkix \
90− ${lib.optionalString enableFIPS "--enable-fips"} \
91− ${lib.optionalString stdenv.isDarwin "--clang"} \
92− ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
93−
94− runHook postBuild
95− '';
87+ else platform.parsed.cpu.name;
88+ # yes, this is correct. nixpkgs uses "host" for the platform the binary will run on whereas nss uses "host" for the platform that the build is running on
89+ target = getArch stdenv.hostPlatform;
90+ host = getArch stdenv.buildPlatform;
91+ in
92+ ''
93+ runHook preBuild
94+
95+ sed -i 's|nss_dist_dir="$dist_dir"|nss_dist_dir="'$out'"|;s|nss_dist_obj_dir="$obj_dir"|nss_dist_obj_dir="'$out'"|' build.sh
96+ ./build.sh -v --opt \
97+ --with-nspr=${nspr.dev}/include:${nspr.out}/lib \
98+ --system-sqlite \
99+ --enable-legacy-db \
100+ --target ${target} \
101+ -Dhost_arch=${host} \
102+ -Duse_system_zlib=1 \
103+ --enable-libpkix \
104+ ${lib.optionalString enableFIPS "--enable-fips"} \
105+ ${lib.optionalString stdenv.isDarwin "--clang"} \
106+ ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
107+
108+ runHook postBuild
109+ '';
96110
97111 NIX_CFLAGS_COMPILE = "-Wno-error -DNIX_NSS_LIBDIR=\"${placeholder "out"}/lib/\"";
98112
@@ -130,36 +144,38 @@ in stdenv.mkDerivation rec {
130144 chmod 0755 $out/bin/nss-config
131145 '';
132146
133− postFixup = let
134− isCross = stdenv.hostPlatform != stdenv.buildPlatform;
135− nss = if isCross then buildPackages.nss.tools else "$out";
136− in
137− (lib.optionalString enableFIPS (''
138− for libname in freebl3 nssdbm3 softokn3
139− do '' +
147+ postFixup =
148+ let
149+ isCross = stdenv.hostPlatform != stdenv.buildPlatform;
150+ nss = if isCross then buildPackages.nss.tools else "$out";
151+ in
152+ (lib.optionalString enableFIPS (''
153+ for libname in freebl3 nssdbm3 softokn3
154+ do '' +
140155 (if stdenv.isDarwin
141− then ''
142− libfile="$out/lib/lib$libname.dylib"
143− DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
144− '' else ''
145− libfile="$out/lib/lib$libname.so"
146− LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
147− '') + ''
148− ${nss}/bin/shlibsign -v -i "$libfile"
149− done
150− '')) +
151− ''
152− moveToOutput bin "$tools"
153− moveToOutput bin/nss-config "$dev"
154− moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example
155− rm -f "$out"/lib/*.a
156−
157− runHook postInstall
158− '';
156+ then ''
157+ libfile="$out/lib/lib$libname.dylib"
158+ DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
159+ '' else ''
160+ libfile="$out/lib/lib$libname.so"
161+ LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
162+ '') + ''
163+ ${nss}/bin/shlibsign -v -i "$libfile"
164+ done
165+ '')) +
166+ ''
167+ moveToOutput bin "$tools"
168+ moveToOutput bin/nss-config "$dev"
169+ moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example
170+ rm -f "$out"/lib/*.a
171+
172+ runHook postInstall
173+ '';
159174
160175 meta = with lib; {
161− homepage = "https://developer.mozilla.org/en-US/docs/NSS";
176+ homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS";
162177 description = "A set of libraries for development of security-enabled client and server applications";
178+ maintainers = with maintainers; [ ];
163179 license = licenses.mpl20;
164180 platforms = platforms.all;
165181 };
pkgs/development/libraries/nss/default.nix+85−71
@@ -1,7 +1,16 @@
1−{ lib, stdenv, fetchurl, nspr, perl, zlib
2−, sqlite, ninja
3−, darwin, fixDarwinDylibNames, buildPackages
4−, useP11kit ? true, p11-kit
1+{ lib
2+, stdenv
3+, fetchurl
4+, nspr
5+, perl
6+, zlib
7+, sqlite
8+, ninja
9+, darwin
10+, fixDarwinDylibNames
11+, buildPackages
12+, useP11kit ? true
13+, p11-kit
514, # allow FIPS mode. Note that this makes the output non-reproducible.
615 # https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Tech_Notes/nss_tech_note6
716 enableFIPS ? false
@@ -19,14 +28,14 @@ let
1928 # an update is required do the required changes to the expression.
2029 # Example: nix-shell ./maintainers/scripts/update.nix --argstr package cacert
2130 version = "3.68";
22− underscoreVersion = builtins.replaceStrings ["."] ["_"] version;
2331
24−in stdenv.mkDerivation rec {
32+in
33+stdenv.mkDerivation rec {
2534 pname = "nss";
2635 inherit version;
2736
2837 src = fetchurl {
29− url = "mirror://mozilla/security/nss/releases/NSS_${underscoreVersion}_RTM/src/${pname}-${version}.tar.gz";
38+ url = "mirror://mozilla/security/nss/releases/NSS_${lib.replaceStrings [ "." ] [ "_" ] version}_RTM/src/${pname}-${version}.tar.gz";
3039 sha256 = "0nvj7h2brcw21p1z99nrsxka056d0r1yy9nqqg0lw0w3mhnb60n4";
3140 };
3241
@@ -56,55 +65,58 @@ in stdenv.mkDerivation rec {
5665 substituteInPlace nss/coreconf/config.gypi --replace "/usr/bin/grep" "${buildPackages.coreutils}/bin/env grep"
5766 '';
5867
59− patches =
60− [
61− # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
62− ./85_security_load.patch
63− ./ckpem.patch
64− ./fix-cross-compilation.patch
65− ];
68+ patches = [
69+ # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
70+ ./85_security_load.patch
71+ ./ckpem.patch
72+ ./fix-cross-compilation.patch
73+ ];
6674
6775 patchFlags = [ "-p0" ];
6876
6977 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
70− substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
71− substituteInPlace nss/coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'"
72− '';
78+ substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
79+ substituteInPlace nss/coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'"
80+ '';
7381
7482 outputs = [ "out" "dev" "tools" ];
7583
7684 preConfigure = "cd nss";
7785
78− buildPhase = let
79− getArch = platform: if platform.isx86_64 then "x64"
80− else if platform.isx86_32 then "ia32"
81− else if platform.isAarch32 then "arm"
82− else if platform.isAarch64 then "arm64"
83− else if platform.isPower && platform.is64bit then (
86+ buildPhase =
87+ let
88+ getArch = platform:
89+ if platform.isx86_64 then "x64"
90+ else if platform.isx86_32 then "ia32"
91+ else if platform.isAarch32 then "arm"
92+ else if platform.isAarch64 then "arm64"
93+ else if platform.isPower && platform.is64bit then
94+ (
8495 if platform.isLittleEndian then "ppc64le" else "ppc64"
8596 )
86− else platform.parsed.cpu.name;
87− # yes, this is correct. nixpkgs uses "host" for the platform the binary will run on whereas nss uses "host" for the platform that the build is running on
88− target = getArch stdenv.hostPlatform;
89− host = getArch stdenv.buildPlatform;
90− in ''
91− runHook preBuild
92−
93− sed -i 's|nss_dist_dir="$dist_dir"|nss_dist_dir="'$out'"|;s|nss_dist_obj_dir="$obj_dir"|nss_dist_obj_dir="'$out'"|' build.sh
94− ./build.sh -v --opt \
95− --with-nspr=${nspr.dev}/include:${nspr.out}/lib \
96− --system-sqlite \
97− --enable-legacy-db \
98− --target ${target} \
99− -Dhost_arch=${host} \
100− -Duse_system_zlib=1 \
101− --enable-libpkix \
102− ${lib.optionalString enableFIPS "--enable-fips"} \
103− ${lib.optionalString stdenv.isDarwin "--clang"} \
104− ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
105−
106− runHook postBuild
107− '';
97+ else platform.parsed.cpu.name;
98+ # yes, this is correct. nixpkgs uses "host" for the platform the binary will run on whereas nss uses "host" for the platform that the build is running on
99+ target = getArch stdenv.hostPlatform;
100+ host = getArch stdenv.buildPlatform;
101+ in
102+ ''
103+ runHook preBuild
104+
105+ sed -i 's|nss_dist_dir="$dist_dir"|nss_dist_dir="'$out'"|;s|nss_dist_obj_dir="$obj_dir"|nss_dist_obj_dir="'$out'"|' build.sh
106+ ./build.sh -v --opt \
107+ --with-nspr=${nspr.dev}/include:${nspr.out}/lib \
108+ --system-sqlite \
109+ --enable-legacy-db \
110+ --target ${target} \
111+ -Dhost_arch=${host} \
112+ -Duse_system_zlib=1 \
113+ --enable-libpkix \
114+ ${lib.optionalString enableFIPS "--enable-fips"} \
115+ ${lib.optionalString stdenv.isDarwin "--clang"} \
116+ ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
117+
118+ runHook postBuild
119+ '';
108120
109121 NIX_CFLAGS_COMPILE = "-Wno-error -DNIX_NSS_LIBDIR=\"${placeholder "out"}/lib/\" " + lib.optionalString stdenv.hostPlatform.is64bit "-DNSS_USE_64=1";
110122
@@ -147,36 +159,38 @@ in stdenv.mkDerivation rec {
147159 ln -sf ${p11-kit}/lib/pkcs11/p11-kit-trust.so $out/lib/libnssckbi.so
148160 '';
149161
150− postFixup = let
151− isCross = stdenv.hostPlatform != stdenv.buildPlatform;
152− nss = if isCross then buildPackages.nss.tools else "$out";
153− in
154− (lib.optionalString enableFIPS (''
155− for libname in freebl3 nssdbm3 softokn3
156− do '' +
162+ postFixup =
163+ let
164+ isCross = stdenv.hostPlatform != stdenv.buildPlatform;
165+ nss = if isCross then buildPackages.nss.tools else "$out";
166+ in
167+ (lib.optionalString enableFIPS (''
168+ for libname in freebl3 nssdbm3 softokn3
169+ do '' +
157170 (if stdenv.isDarwin
158− then ''
159− libfile="$out/lib/lib$libname.dylib"
160− DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
161− '' else ''
162− libfile="$out/lib/lib$libname.so"
163− LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
164− '') + ''
165− ${nss}/bin/shlibsign -v -i "$libfile"
166− done
167− '')) +
168− ''
169− moveToOutput bin "$tools"
170− moveToOutput bin/nss-config "$dev"
171− moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example
172− rm -f "$out"/lib/*.a
173−
174− runHook postInstall
175− '';
171+ then ''
172+ libfile="$out/lib/lib$libname.dylib"
173+ DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
174+ '' else ''
175+ libfile="$out/lib/lib$libname.so"
176+ LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
177+ '') + ''
178+ ${nss}/bin/shlibsign -v -i "$libfile"
179+ done
180+ '')) +
181+ ''
182+ moveToOutput bin "$tools"
183+ moveToOutput bin/nss-config "$dev"
184+ moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example
185+ rm -f "$out"/lib/*.a
186+
187+ runHook postInstall
188+ '';
176189
177190 meta = with lib; {
178− homepage = "https://developer.mozilla.org/en-US/docs/NSS";
191+ homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS";
179192 description = "A set of libraries for development of security-enabled client and server applications";
193+ maintainers = with maintainers; [ ];
180194 license = licenses.mpl20;
181195 platforms = platforms.all;
182196 };
pkgs/development/libraries/nss_wrapper/default.nix+3−2
@@ -1,10 +1,11 @@
11{ lib, stdenv, fetchurl, cmake, pkg-config }:
22
33stdenv.mkDerivation rec {
4− name = "nss_wrapper-1.1.11";
4+ pname = "nss_wrapper";
5+ version = "1.1.11";
56
67 src = fetchurl {
7− url = "mirror://samba/cwrap/${name}.tar.gz";
8+ url = "mirror://samba/cwrap/nss_wrapper-${version}.tar.gz";
89 sha256 = "1q5l6w69yc71ly8gcbnkrcbnq6b64cbiiv99m0z5vn5lgwp36igv";
910 };
1011