pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/nss nss: fix interoperability with openssl



details:   https://anonhg.NetBSD.org/pkgsrc/rev/093bcb381840
branches:  trunk
changeset: 450004:093bcb381840
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Fri Apr 09 06:40:59 2021 +0000

description:
nss: fix interoperability with openssl

For a long time now (at least 15 years), the installed pkg-config
file also linked against libsoftokn3, which is wrong according to
upstream. This library is only intended to be loaded as a module.

Having this library linked added symbols to the namespace that conflict
with openssl symbols. This had caused problems before, and patches
had been added to rename symbols to avoid this conflict.

Instead, fix this correctly by not linking against libsoftokn3.

Switch to using the pkg-config and nss-config files provided in the
distfiles instead of pkgsrc-specific ones.

Remove now unneeded symbol-renaming patches.

Remove DragonFly patches while here.

Bump PKGREVISION.

diffstat:

 devel/nss/Makefile                           |   46 +++++---
 devel/nss/distinfo                           |   11 +-
 devel/nss/files/nss-config.in                |  142 ---------------------------
 devel/nss/files/nss.pc.in                    |   11 --
 devel/nss/patches/patch-am                   |   26 ----
 devel/nss/patches/patch-an                   |   48 ---------
 devel/nss/patches/patch-me                   |   13 +--
 devel/nss/patches/patch-mf                   |   12 +--
 devel/nss/patches/patch-mg                   |   90 -----------------
 devel/nss/patches/patch-mj                   |   15 --
 devel/nss/patches/patch-nss_lib_freebl_md5.c |   38 -------
 11 files changed, 34 insertions(+), 418 deletions(-)

diffs (truncated from 568 to 300 lines):

diff -r fc758a05acce -r 093bcb381840 devel/nss/Makefile
--- a/devel/nss/Makefile        Fri Apr 09 05:12:58 2021 +0000
+++ b/devel/nss/Makefile        Fri Apr 09 06:40:59 2021 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.199 2021/03/30 16:34:05 ryoon Exp $
+# $NetBSD: Makefile,v 1.200 2021/04/09 06:40:59 wiz Exp $
 
 DISTNAME=              nss-${NSS_RELEASE:S/.0$//}
 NSS_RELEASE=           3.63.0
+PKGREVISION=           1
 CATEGORIES=            devel security
 MASTER_SITES=          ${MASTER_SITE_MOZILLA_ALL:=security/nss/releases/NSS_${NSS_DIST_DIR_VERSION:S/_0$//}_RTM/src/}
 
@@ -89,25 +90,34 @@
 CFLAGS+=       -DNSS_NO_GCC48
 .endif
 
-NSS_MAJOR_VERSION=     ${NSS_RELEASE:C/\.[0-9.]*//}
-NSS_MINOR_VERSION=     ${NSS_RELEASE:S/3.//:C/\.[0-9]*//}
-NSS_PATCH_VERSION=     ${NSS_RELEASE:C/[0-9.]*\.//}
-NSS_DIST_DIR_VERSION=  ${NSS_MAJOR_VERSION}_${NSS_MINOR_VERSION}_${NSS_PATCH_VERSION}
+MOD_MAJOR_VERSION=     ${NSS_RELEASE:C/\.[0-9.]*//}
+MOD_MINOR_VERSION=     ${NSS_RELEASE:S/3.//:C/\.[0-9]*//}
+MOD_PATCH_VERSION=     ${NSS_RELEASE:C/[0-9.]*\.//}
+NSS_DIST_DIR_VERSION=  ${MOD_MAJOR_VERSION}_${MOD_MINOR_VERSION}_${MOD_PATCH_VERSION}
 
+NSPR_MINIMUM_VERSION=  4.29
+
+PKGCONFIG_OVERRIDE=    nss.pc
 
 SUBST_CLASSES+=                config
-SUBST_VARS.config=     PREFIX
-SUBST_VARS.config+=    NSS_MAJOR_VERSION
-SUBST_VARS.config+=    NSS_MINOR_VERSION
-SUBST_VARS.config+=    NSS_PATCH_VERSION
-SUBST_VARS.config+=    COMPILER_RPATH_FLAG
+# nss.pc
 SUBST_SED.config+=     -e "s,@PTHREAD@,${BUILDLINK_LIBS.pthread:Q},"
+SUBST_SED.config+=     -e "s,%prefix%,${PREFIX},"
+SUBST_SED.config+=     -e "s,%exec_prefix%,${PREFIX},"
+SUBST_SED.config+=     -e "s,%libdir%,${PREFIX}/lib/nss,"
+SUBST_SED.config+=     -e "s,%includedir%,${PREFIX}/include/nss,"
+SUBST_SED.config+=     -e "s,%NSS_VERSION%,${PKGVERSION_NOREV},"
+SUBST_SED.config+=     -e "s,%NSPR_VERSION%,${NSPR_MINIMUM_VERSION},"
+# nss-config
+SUBST_SED.config+=     -e "s,@prefix@,${PREFIX},"
+SUBST_VARS.config+=    MOD_MAJOR_VERSION
+SUBST_VARS.config+=    MOD_MINOR_VERSION
+SUBST_VARS.config+=    MOD_PATCH_VERSION
 SUBST_STAGE.config=    pre-build
 SUBST_MESSAGE.config=  Preparing *-config files.
 SUBST_FILES.config+=   nss.pc nss-config
 
 INSTALLATION_DIRS=     bin include/nss lib/nss lib/pkgconfig
-DIST=  ${WRKSRC}/dist
 
 INSTALL_CMDS+=         certutil cmsutil crlutil derdump makepqg \
                        mangle modutil ocspclnt oidcalc p7content p7env p7sign \
@@ -117,25 +127,25 @@
 post-extract:
        find ${WRKSRC} -type f | xargs ${CHMOD} 644
        find ${WRKSRC} -type d | xargs ${CHMOD} 755
-       ${CP} ${FILESDIR}/nss.pc.in ${WRKSRC}/nss.pc
-       ${CP} ${FILESDIR}/nss-config.in ${WRKSRC}/nss-config
+       ${CP} ${WRKSRC}/nss/pkg/pkg-config/nss.pc.in ${WRKSRC}/nss.pc
+       ${CP} ${WRKSRC}/nss/pkg/pkg-config/nss-config.in ${WRKSRC}/nss-config
 
 do-install:
-       (cd ${DIST}/public/nss && pax -Lrw . ${DESTDIR}${PREFIX}/include/nss )
-       (cd ${DIST}/*_OPT.OBJ/lib && \
+       (cd ${WRKSRC}/dist/public/nss && pax -Lrw . ${DESTDIR}${PREFIX}/include/nss )
+       (cd ${WRKSRC}/dist/*_OPT.OBJ/lib && \
                pax -Lrw *.${SO_SUFFIX} ${DESTDIR}${PREFIX}/lib/nss/ )
-       ${INSTALL_DATA} ${DIST}/*_OPT.OBJ/lib/libcrmf.a \
+       ${INSTALL_DATA} ${WRKSRC}/dist/*_OPT.OBJ/lib/libcrmf.a \
                ${DESTDIR}${PREFIX}/lib/nss/
        ${INSTALL_DATA} ${WRKSRC}/nss.pc ${DESTDIR}${PREFIX}/lib/pkgconfig/nss.pc
        ${INSTALL_SCRIPT} ${WRKSRC}/nss-config ${DESTDIR}${PREFIX}/bin/nss-config
 .for cmd in ${INSTALL_CMDS}
-       ${INSTALL_PROGRAM} ${DIST}/*_OPT.OBJ/bin/${cmd} ${DESTDIR}${PREFIX}/bin
+       ${INSTALL_PROGRAM} ${WRKSRC}/dist/*_OPT.OBJ/bin/${cmd} ${DESTDIR}${PREFIX}/bin
 .endfor
 
 # For consistency of libxul.so link in www/firefox.
 BUILDLINK_API_DEPENDS.sqlite3+=        sqlite3>=3.8.4.2
 .include "../../databases/sqlite3/buildlink3.mk"
-BUILDLINK_API_DEPENDS.nspr+=   nspr>=4.29
+BUILDLINK_API_DEPENDS.nspr+=   nspr>=${NSPR_MINIMUM_VERSION}
 .include "../../devel/nspr/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../mk/pthread.buildlink3.mk"
diff -r fc758a05acce -r 093bcb381840 devel/nss/distinfo
--- a/devel/nss/distinfo        Fri Apr 09 05:12:58 2021 +0000
+++ b/devel/nss/distinfo        Fri Apr 09 06:40:59 2021 +0000
@@ -1,16 +1,12 @@
-$NetBSD: distinfo,v 1.124 2021/03/30 16:34:05 ryoon Exp $
+$NetBSD: distinfo,v 1.125 2021/04/09 06:40:59 wiz Exp $
 
 SHA1 (nss-3.63.tar.gz) = ecdf1352cb35d43a2bb4e276ece100c30a26a0ec
 RMD160 (nss-3.63.tar.gz) = f2c4c73360c3370276b5cb468139c748ed590b8f
 SHA512 (nss-3.63.tar.gz) = 2f1f75dce7fd049453cbcf53263a3d9d4d9e62ad2cc2fef4dd0d5645fe14dad4ce47ed64aae507a09214d7fccbe83c142844121f55b44783e5a1bcfe24ea671c
 Size (nss-3.63.tar.gz) = 82167087 bytes
-SHA1 (patch-am) = fea682bf03bc8b645049f93ed58554ca45f47aca
-SHA1 (patch-an) = 4ab22f2a575676b5b640bc9a760b83eb05c75e69
 SHA1 (patch-md) = 8547c9414332c02221b96719dea1e09cb741f4d1
-SHA1 (patch-me) = 3b23fb15a1a22204604ebe64345bb30734a131ba
-SHA1 (patch-mf) = 534fe5f711f60dadc3432bc805a6153535f11709
-SHA1 (patch-mg) = 3c878548c98bdea559a3e653e63e0ed22a2a8834
-SHA1 (patch-mj) = 08ca1a37afce99e0292a20348fc6855547f44e8a
+SHA1 (patch-me) = ffb5f119764c158c0bd789bd18fc77c61f2e9d2b
+SHA1 (patch-mf) = 40e58385fb6f944f463bf00b9aad72bc4ea229d0
 SHA1 (patch-mn) = 5b79783e48249044be1a904a6cfd20ba175b5fd4
 SHA1 (patch-nss_cmd_platlibs.mk) = 01f4350de601b29c94e8a791a28daca226866bb6
 SHA1 (patch-nss_cmd_shlibsign_sign.sh) = 7948b7b502a4c148ee185836dde8a84d3aa388af
@@ -19,7 +15,6 @@
 SHA1 (patch-nss_coreconf_command.mk) = a7b682d367825b48f8802fa30cee83f10680bb74
 SHA1 (patch-nss_lib_freebl_aes-armv8.c) = aa698f61dd3d66ba707a9b5425bc15d057244ad7
 SHA1 (patch-nss_lib_freebl_gcm-aarch64.c) = 311cfe7ca58e91285052d0ca27bd2df3f325071b
-SHA1 (patch-nss_lib_freebl_md5.c) = 5cbec40695e296f0713895fb85cd37f6df76b85b
 SHA1 (patch-nss_lib_util_utilpars.c) = 5d3000515b01037929730a752b7d7a0f46f06deb
 SHA1 (patch-nss_tests_all.sh) = b328778b538db66f5447f962f23afd6f650f7071
 SHA1 (patch-nss_tests_merge_merge.sh) = 42a4866d226b1076740ba9a5e42c7604f2cb15a7
diff -r fc758a05acce -r 093bcb381840 devel/nss/files/nss-config.in
--- a/devel/nss/files/nss-config.in     Fri Apr 09 05:12:58 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-#!/bin/sh
-
-prefix=@PREFIX@
-
-major_version=@NSS_MAJOR_VERSION@
-minor_version=@NSS_MINOR_VERSION@
-patch_version=@NSS_PATCH_VERSION@
-
-usage()
-{
-       cat <<EOF
-Usage: nss-config [OPTIONS] [LIBRARIES]
-Options:
-       [--prefix[=DIR]]
-       [--exec-prefix[=DIR]]
-       [--includedir[=DIR]]
-       [--libdir[=DIR]]
-       [--version]
-       [--libs]
-       [--cflags]
-Dynamic Libraries:
-       nss
-       ssl
-       smime
-       nssutil
-EOF
-       exit $1
-}
-
-if test $# -eq 0; then
-       usage 1 1>&2
-fi
-
-lib_ssl=yes
-lib_smime=yes
-lib_nss=yes
-lib_nssutil=yes
-
-while test $# -gt 0; do
-  case "$1" in
-  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
-  esac
-
-  case $1 in
-    --prefix=*)
-      prefix=$optarg
-      ;;
-    --prefix)
-      echo_prefix=yes
-      ;;
-    --exec-prefix=*)
-      exec_prefix=$optarg
-      ;;
-    --exec-prefix)
-      echo_exec_prefix=yes
-      ;;
-    --includedir=*)
-      includedir=$optarg
-      ;;
-    --includedir)
-      echo_includedir=yes
-      ;;
-    --libdir=*)
-      libdir=$optarg
-      ;;
-    --libdir)
-      echo_libdir=yes
-      ;;
-    --version)
-      echo ${major_version}.${minor_version}.${patch_version}
-      ;;
-    --cflags)
-      echo_cflags=yes
-      ;;
-    --libs)
-      echo_libs=yes
-      ;;
-    ssl)
-      lib_ssl=yes
-      ;;
-    smime)
-      lib_smime=yes
-      ;;
-    nss)
-      lib_nss=yes
-      ;;
-    nssutil)
-      lib_nssutil=yes
-      ;;
-    *)
-      usage 1 1>&2
-      ;;
-  esac
-  shift
-done
-
-# Set variables that may be dependent upon other variables
-if test -z "$exec_prefix"; then
-    exec_prefix=`pkg-config --variable=exec_prefix nss`
-    if test -z "$exec_prefix"; then
-        exec_prefix=`pkg-config --variable=prefix nss`/bin
-    fi
-fi
-if test -z "$includedir"; then
-    includedir=`pkg-config --variable=includedir nss`
-fi
-if test -z "$libdir"; then
-    libdir=`pkg-config --variable=libdir nss`
-fi
-
-if test -z "$cflags"; then
-    cflags=`pkg-config --cflags nss`
-fi
-
-if test -z "$libs"; then
-    libs=`pkg-config --libs nss`
-fi
-
-if test "$echo_prefix" = "yes"; then
-    echo $prefix
-fi
-
-if test "$echo_exec_prefix" = "yes"; then
-    echo $exec_prefix
-fi
-
-if test "$echo_includedir" = "yes"; then
-    echo $includedir
-fi
-
-if test "$echo_libdir" = "yes"; then
-    echo $libdir
-fi
-
-if test "$echo_cflags" = "yes"; then
-    echo $cflags
-fi
-
-if test "$echo_libs" = "yes"; then
-   echo $libs
-fi
diff -r fc758a05acce -r 093bcb381840 devel/nss/files/nss.pc.in
--- a/devel/nss/files/nss.pc.in Fri Apr 09 05:12:58 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-prefix=@PREFIX@
-exec_prefix=@PREFIX@/bin
-libdir=@PREFIX@/lib/nss
-includedir=@PREFIX@/include/nss
-
-Name: NSS
-Description: Mozilla Network Security Services
-Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
-Requires: nspr >= 4.10.3
-Cflags: -I${includedir}
-Libs: @COMPILER_RPATH_FLAG@${libdir} -L${libdir} -lnss3 -lsmime3 -lssl3 -lsoftokn3 -lnssutil3 @PTHREAD@
diff -r fc758a05acce -r 093bcb381840 devel/nss/patches/patch-am
--- a/devel/nss/patches/patch-am        Fri Apr 09 05:12:58 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-$NetBSD: patch-am,v 1.6 2019/05/05 22:47:28 ryoon Exp $
-
-SHA1_Update and MD5_Update conflict with openssl which may be dynamically
-loaded at runtime via libcups or libgssapi so causing a crash due to using
-the wrong binding.  So rename here to avoid conflict.
-
---- nss/lib/freebl/blapi.h.orig        2019-03-16 00:25:08.000000000 +0000
-+++ nss/lib/freebl/blapi.h
-@@ -1046,6 +1046,8 @@ extern void MD5_DestroyContext(MD5Contex
- */
- extern void MD5_Begin(MD5Context *cx);
- 
-+#define MD5_Update NSS_MD5_Update



Home | Main Index | Thread Index | Old Index