From 14d0bff3fe2f1766c68b529b28c5a7748bdaccf1 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 19 Aug 2022 00:11:08 +0200 Subject: [PATCH 1/3] nss: Drop nss-pem patchset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch url went 404 and other distros¹ have discarded it as well in favor of packaging nss-pem² [1] https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-libs/nss?id=5eca3e02c87163b3c541cdee893830d201abfb86 [2] https://github.com/kdudka/nss-pem (cherry picked from commit 7f01443ef1cf09be0dd772af0a58409a4a02ccb1) --- pkgs/development/libraries/nss/generic.nix | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkgs/development/libraries/nss/generic.nix b/pkgs/development/libraries/nss/generic.nix index 9a3d7bdfe270..cbd52df317c9 100644 --- a/pkgs/development/libraries/nss/generic.nix +++ b/pkgs/development/libraries/nss/generic.nix @@ -18,11 +18,6 @@ }: let - nssPEM = fetchurl { - url = "http://dev.gentoo.org/~polynomial-c/mozilla/nss-3.15.4-pem-support-20140109.patch.xz"; - sha256 = "10ibz6y0hknac15zr6dw4gv9nb5r5z9ym6gq18j3xqx7v7n3vpdw"; - }; - underscoreVersion = lib.replaceStrings [ "." ] [ "_" ] version; in stdenv.mkDerivation rec { @@ -44,13 +39,6 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ nspr ]; prePatch = '' - # strip the trailing whitespace from the patch line and the renamed CKO_NETSCAPE_ enum to CKO_NSS_ - xz -d < ${nssPEM} | sed \ - -e 's/-DIRS = builtins $/-DIRS = . builtins/g' \ - -e 's/CKO_NETSCAPE_/CKO_NSS_/g' \ - -e 's/CKT_NETSCAPE_/CKT_NSS_/g' \ - | patch -p1 - patchShebangs nss for f in nss/coreconf/config.gypi nss/build.sh nss/coreconf/config.gypi; do From 59081b1618fbd147465bf6a2e02c69a2d37c060f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 19 Aug 2022 00:17:15 +0200 Subject: [PATCH 2/3] nss: Drop ckpem patch It's usefulness is not clear to us maintainers. (cherry picked from commit df214678dcf8444d290e835c6039a48cefed65b9) --- pkgs/development/libraries/nss/ckpem.patch | 11 ----------- pkgs/development/libraries/nss/generic.nix | 1 - 2 files changed, 12 deletions(-) delete mode 100644 pkgs/development/libraries/nss/ckpem.patch diff --git a/pkgs/development/libraries/nss/ckpem.patch b/pkgs/development/libraries/nss/ckpem.patch deleted file mode 100644 index c1a65a6c0b28..000000000000 --- a/pkgs/development/libraries/nss/ckpem.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- nss/lib/ckfw/pem/ckpem.h 2018-01-03 13:36:12.000000000 -0800 -+++ nss/lib/ckfw/pem/ckpem.h 2018-01-03 13:36:20.000000000 -0800 -@@ -156,8 +156,6 @@ - NSS_EXTERN_DATA pemInternalObject nss_pem_data[]; - NSS_EXTERN_DATA const PRUint32 nss_pem_nObjects; - -- PRBool logged_in; -- - /* our raw object data array */ - NSS_EXTERN_DATA pemInternalObject nss_pem_data[]; - NSS_EXTERN_DATA const PRUint32 nss_pem_nObjects; diff --git a/pkgs/development/libraries/nss/generic.nix b/pkgs/development/libraries/nss/generic.nix index cbd52df317c9..28edb44f1cd6 100644 --- a/pkgs/development/libraries/nss/generic.nix +++ b/pkgs/development/libraries/nss/generic.nix @@ -55,7 +55,6 @@ stdenv.mkDerivation rec { else ./85_security_load_3.77+.patch ) - ./ckpem.patch ./fix-cross-compilation.patch ]; From 40007f53ebcca690bf6dc040f72f70b8dff15a9b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 19 Aug 2022 15:16:13 +0200 Subject: [PATCH 3/3] nss: migrate manual patching into postPatch (cherry picked from commit 0badc2389af6f730d2acab4cb66554ddab39b57a) --- pkgs/development/libraries/nss/generic.nix | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/nss/generic.nix b/pkgs/development/libraries/nss/generic.nix index 28edb44f1cd6..bcc290dd2076 100644 --- a/pkgs/development/libraries/nss/generic.nix +++ b/pkgs/development/libraries/nss/generic.nix @@ -38,16 +38,6 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ nspr ]; - prePatch = '' - patchShebangs nss - - for f in nss/coreconf/config.gypi nss/build.sh nss/coreconf/config.gypi; do - substituteInPlace "$f" --replace "/usr/bin/env" "${buildPackages.coreutils}/bin/env" - done - - substituteInPlace nss/coreconf/config.gypi --replace "/usr/bin/grep" "${buildPackages.coreutils}/bin/env grep" - ''; - patches = [ # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch (if (lib.versionOlder version "3.77") then @@ -60,7 +50,15 @@ stdenv.mkDerivation rec { patchFlags = [ "-p0" ]; - postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' + postPatch = '' + patchShebangs nss + + for f in nss/coreconf/config.gypi nss/build.sh nss/coreconf/config.gypi; do + substituteInPlace "$f" --replace "/usr/bin/env" "${buildPackages.coreutils}/bin/env" + done + + substituteInPlace nss/coreconf/config.gypi --replace "/usr/bin/grep" "${buildPackages.coreutils}/bin/env grep" + '' + lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)" substituteInPlace nss/coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'" '';