nss: 3.31 -> 3.32.1

This commit is contained in:
taku0 2017-09-29 08:52:45 +09:00
parent 5ae175744a
commit 6e2744ab0f

View file

@ -9,11 +9,11 @@ let
in stdenv.mkDerivation rec {
name = "nss-${version}";
version = "3.31";
version = "3.32.1";
src = fetchurl {
url = "mirror://mozilla/security/nss/releases/NSS_3_31_RTM/src/${name}.tar.gz";
sha256 = "0pd643a8ns7q5az5ai3ascrw666i2kbfiyy1c9hlhw9jd8jn21g9";
url = "mirror://mozilla/security/nss/releases/NSS_3_32_1_RTM/src/${name}.tar.gz";
sha256 = "0lj6c94102aa81bnjisnix09zfjly9aa1d6vrzxmcjmzynkrrrad";
};
buildInputs = [ perl zlib sqlite ];
@ -25,37 +25,13 @@ in stdenv.mkDerivation rec {
'';
patches =
[ # Install a nss.pc (pkgconfig) file and nss-config script
# Upstream issue: https://bugzilla.mozilla.org/show_bug.cgi?id=530672
(fetchurl {
name = "nss-3.28-gentoo-fixups.patch";
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/"
+ "dev-libs/nss/files/nss-3.28-gentoo-fixups.patch"
+ "?id=05c31f8cca591b3ce8219e4def7c26c7b1b130d6";
sha256 = "0z58axd1n7vq4kdp5mrb3dsg6di39a1g40s3shl6n2dzs14c1y2q";
})
[
# Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
./85_security_load.patch
];
patchFlags = "-p0";
postPatch = ''
# Fix up the patch from Gentoo.
sed -i \
-e "/^PREFIX =/s|= /usr|= $out|" \
-e '/@libdir@/s|gentoo/nss|lib|' \
-e '/ln -sf/d' \
nss/config/Makefile
# Note for spacing/tab nazis: The TAB characters are intentional!
cat >> nss/config/Makefile <<INSTALL_TARGET
install:
mkdir -p \$(DIST)/lib/pkgconfig
cp nss.pc \$(DIST)/lib/pkgconfig
INSTALL_TARGET
'';
outputs = [ "out" "dev" "tools" ];
preConfigure = "cd nss";
@ -79,9 +55,31 @@ in stdenv.mkDerivation rec {
mv $out/*.OBJ/* $out/
rmdir $out/*.OBJ
cp -av config/nss-config $out/bin/nss-config
ln -s lib $out/lib64
# Upstream issue: https://bugzilla.mozilla.org/show_bug.cgi?id=530672
# https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/nss/files/nss-3.32-gentoo-fixups.patch?id=af1acce6c6d2c3adb17689261dfe2c2b6771ab8a
NSS_MAJOR_VERSION=`grep "NSS_VMAJOR" lib/nss/nss.h | awk '{print $3}'`
NSS_MINOR_VERSION=`grep "NSS_VMINOR" lib/nss/nss.h | awk '{print $3}'`
NSS_PATCH_VERSION=`grep "NSS_VPATCH" lib/nss/nss.h | awk '{print $3}'`
PREFIX="$out"
mkdir -p $out/lib/pkgconfig
sed -e "s,%prefix%,$PREFIX," \
-e "s,%exec_prefix%,$PREFIX," \
-e "s,%libdir%,$PREFIX/lib64," \
-e "s,%includedir%,$PREFIX/include/nss," \
-e "s,%NSS_VERSION%,$NSS_MAJOR_VERSION.$NSS_MINOR_VERSION.$NSS_PATCH_VERSION,g" \
-e "s,%NSPR_VERSION%,4.16,g" \
pkg/pkg-config/nss.pc.in > $out/lib/pkgconfig/nss.pc
chmod 0644 $out/lib/pkgconfig/nss.pc
sed -e "s,@prefix@,$PREFIX," \
-e "s,@MOD_MAJOR_VERSION@,$NSS_MAJOR_VERSION," \
-e "s,@MOD_MINOR_VERSION@,$NSS_MINOR_VERSION," \
-e "s,@MOD_PATCH_VERSION@,$NSS_PATCH_VERSION," \
pkg/pkg-config/nss-config.in > $out/bin/nss-config
chmod 0755 $out/bin/nss-config
'';
postFixup = ''