[147861] trunk/dports/net/nss

mcalhoun at macports.org mcalhoun at macports.org
Mon Apr 18 17:51:32 PDT 2016


Revision: 147861
          https://trac.macports.org/changeset/147861
Author:   mcalhoun at macports.org
Date:     2016-04-18 17:51:32 -0700 (Mon, 18 Apr 2016)
Log Message:
-----------
nss: update version 3.14.3->3.23; remove nss- prefix from binaries; allow universal build

Modified Paths:
--------------
    trunk/dports/net/nss/Portfile

Added Paths:
-----------
    trunk/dports/net/nss/files/Makefile-MacPorts-Install.in

Removed Paths:
-------------
    trunk/dports/net/nss/files/patch-Darwin.mk.diff
    trunk/dports/net/nss/files/patch-UNIX.mk.diff

Modified: trunk/dports/net/nss/Portfile
===================================================================
--- trunk/dports/net/nss/Portfile	2016-04-19 00:44:41 UTC (rev 147860)
+++ trunk/dports/net/nss/Portfile	2016-04-19 00:51:32 UTC (rev 147861)
@@ -2,9 +2,10 @@
 # $Id$
 
 PortSystem          1.0
+PortGroup           muniversal 1.0
 
 name                nss
-version             3.14.3
+version             3.23
 set NSS_VMAJOR      [lindex [split ${version} .] 0]
 set NSS_VMINOR      [lindex [split ${version} .] 1]
 set NSS_VPATCH      [lindex [split ${version} .] 2]
@@ -14,7 +15,7 @@
 }
 categories          net
 maintainers         nomaintainer
-license             {MPL-1.1 GPL-2+ LGPL-2.1+}
+license             {MPL-2 GPL-2+ LGPL-2.1+}
 description         Network Security Service libraries.
 
 long_description    ${description}
@@ -28,64 +29,35 @@
 master_sites        ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${my_release}/src/ \
                     http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${my_release}/src/
 
-checksums           rmd160  78ce247c6d649ac0624b087d7a947e8b3482d520 \
-                    sha256  d9d366be94d33395597ebf82363fcdedfa693a6d627cf7f6bec025f609d54cc0
+checksums           rmd160  2cb9a448ec60a00edd7cf5a08321dd6583d03cb9 \
+                    sha256  94b383e31c9671e9dfcca81084a8a813817e8f05a57f54533509b318d26e11cf
 
 depends_lib     port:nspr \
+                port:zlib \
                 port:sqlite3
 
-patchfiles      patch-UNIX.mk.diff \
-                patch-Darwin.mk.diff
+destroot.dir ${destroot.dir}/dist
+build.dir    ${build.dir}/nss
 
-# This is all kinds of messed up for universal...
-universal_variant no
+# muniversal destroot requires a Makefile
+post-extract {
+    xinstall -d -m 0755 ${destroot.dir}
 
+    copy ${filespath}/Makefile-MacPorts-Install.in ${destroot.dir}/Makefile-MacPorts-Install
+    reinplace "s|__MACPORTS_PREFIX__|${prefix}|g" ${destroot.dir}/Makefile-MacPorts-Install
+}
+
+destroot.args-append \
+    -f Makefile-MacPorts-Install
+
 post-patch {
     # libraries are not relative to any main executable, so no need for @executable_path
     reinplace "s|@executable_path|${prefix}/lib/nss|g" \
-        ${worksrcpath}/mozilla/security/coreconf/Darwin.mk \
-        ${worksrcpath}/mozilla/security/nss/lib/freebl/config.mk
-    reinplace "s|@@PREFIX@@|${prefix}|g" \
-        ${worksrcpath}/mozilla/security/coreconf/Darwin.mk \
-        ${worksrcpath}/mozilla/security/coreconf/UNIX.mk
-    reinplace "s|= cc\$|= ${configure.cc}|" \
-        ${worksrcpath}/mozilla/security/coreconf/Darwin.mk
-    reinplace "s|= c++\$|= ${configure.cxx}|" \
-        ${worksrcpath}/mozilla/security/coreconf/Darwin.mk
-    reinplace "s|= ranlib\$|= /usr/bin/ranlib|" \
-        ${worksrcpath}/mozilla/security/coreconf/Darwin.mk
-    reinplace "s|=gcc|=${configure.cc}|" \
-        ${worksrcpath}/mozilla/security/nss/Makefile
-    reinplace "s|=g++|=${configure.cxx}|" \
-        ${worksrcpath}/mozilla/security/nss/Makefile
+        ${build.dir}/coreconf/Darwin.mk \
+        ${build.dir}/lib/freebl/config.mk
 }
 
-build {
-    if {[info exists build_arch] && (${build_arch} eq "x86_64" || ${build_arch} eq "ppc64")} {
-        set use_64 " USE_64=1"
-    } else {
-        set use_64 ""
-    }
-    set make_args "NSPR_LIB_DIR=${prefix}/lib/nspr NSS_USE_SYSTEM_SQLITE=1${use_64} CC=\"${configure.cc} -arch ${build_arch}\" CXX=$\"{configure.cxx} -arch ${build_arch}\""
-    system "cd ${worksrcpath} && \
-            make -C mozilla/security/coreconf/nsinstall ${make_args} && \
-            make -C mozilla/security/dbm ${make_args} && \
-            make -C mozilla/security/nss ${make_args}"
-}
-
-destroot {
-    xinstall -m 755 -d ${destroot}${prefix}/include/nss
-    xinstall -m 755 {*}[glob -directory ${worksrcpath}/mozilla/dist/public/ nss/* dbm/*] ${destroot}${prefix}/include/nss
-    xinstall -m 755 -d ${destroot}${prefix}/bin
-    foreach f [glob ${worksrcpath}/mozilla/dist/Darwin*/bin/*] {
-        xinstall -m 755 $f ${destroot}${prefix}/bin/nss-[file tail $f]
-    }
-    xinstall -m 755 -d ${destroot}${prefix}/lib/nss
-    xinstall -m 755 {*}[glob ${worksrcpath}/mozilla/dist/Darwin*/lib/*.dylib] ${destroot}${prefix}/lib/nss
-    xinstall -m 644 {*}[glob ${worksrcpath}/mozilla/dist/Darwin*/lib/libcrmf.a] ${destroot}${prefix}/lib/nss
-
-    xinstall -m 755 -d ${destroot}${prefix}/lib/pkgconfig
-
+post-destroot {
     # applications seem to expect an nss-config executable and nss.pc file, but nss does not provide them
     # see https://bugzilla.mozilla.org/show_bug.cgi?id=530672
 
@@ -101,15 +73,81 @@
     set nspr_version [exec ${prefix}/bin/nspr-config --version]
     set nss_version  [exec ${destroot}${prefix}/bin/nss-config --version]
 
-    xinstall  ${filespath}/nss.pc.in                  ${destroot}${prefix}/lib/pkgconfig/nss.pc
+    xinstall  -m 0644 ${filespath}/nss.pc.in          ${destroot}${prefix}/lib/pkgconfig/nss.pc
     reinplace "s, at libdir@,${prefix}/lib/nss,g"        ${destroot}${prefix}/lib/pkgconfig/nss.pc
     reinplace "s, at prefix@,${prefix},g"                ${destroot}${prefix}/lib/pkgconfig/nss.pc
     reinplace "s, at exec_prefix@,${prefix},g"           ${destroot}${prefix}/lib/pkgconfig/nss.pc
     reinplace "s, at includedir@,${prefix}/include/nss," ${destroot}${prefix}/lib/pkgconfig/nss.pc
     reinplace "s, at NSPR_VERSION@,${nspr_version},g"    ${destroot}${prefix}/lib/pkgconfig/nss.pc
     reinplace "s, at NSS_VERSION@,${nss_version},g"      ${destroot}${prefix}/lib/pkgconfig/nss.pc
+
+    # install man files
+    xinstall -m 0644 \
+        {*}[glob ${build.dir}/doc/nroff/*.1] \
+        ${destroot}${prefix}/share/man/man1/
 }
 
+use_parallel_build  no
+
+# mimic nss/coreconf/Darwin.mk
+
+if {![variant_isset universal]} {
+    if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
+        build.args-append USE_64=1
+    }
+
+    build.args-append \
+        CC=\"${configure.cc} -arch ${build_arch}\" \
+        CCC=\"${configure.cxx} -arch ${build_arch}\"
+} else {
+    lappend merger_build_args(x86_64) USE_64=1
+    lappend merger_build_args(ppc64)  USE_64=1
+
+    foreach arch ${universal_archs} {
+        lappend merger_build_args(${arch}) \
+            CC='${configure.cc} -arch ${arch}' \
+            CCC='${configure.cxx} -arch ${arch}'
+    }
+}
+
+build.args-append \
+    NSPR_INCLUDE_DIR=${prefix}/include/nspr \
+    NSPR_LIB_DIR=${prefix}/lib/nspr \
+    NSS_USE_SYSTEM_SQLITE=1 \
+    USE_SYSTEM_ZLIB=1 \
+    BUILD_OPT=1 \
+    OPTIMIZER="${configure.optflags}" \
+    OBJDIR_NAME="Output.OBJD"
+
+if {${configure.sdkroot} ne ""} {
+    build.args-append \
+        MACOS_SDK_DIR=${configure.sdkroot}
+}
+
+if {[variant_isset universal]} {
+    # chk files can not be merged
+
+    merger-post-destroot {
+        foreach arch ${universal_archs_to_use} {
+            foreach chk [glob -nocomplain -directory ${destroot}-${arch}${prefix}/lib/nss *.chk] {
+                # delete chk file and replace it with an empty file, which can be merged
+                # keep the empty file so that later, we can know which chk files need to be regenerated from universal library
+                file delete ${chk}
+                system "touch ${chk}"
+            }
+        }
+    }
+
+    post-destroot {
+        foreach chk [glob -nocomplain -directory ${destroot}${prefix}/lib/nss *.chk] {
+            # replace empty chk file with an actual one generated from universal library
+            file delete ${chk}
+            set base [file rootname ${chk}]
+            system "env DYLD_LIBRARY_PATH=${destroot}${prefix}/lib/nss ${destroot}${prefix}/bin/shlibsign -i ${base}.dylib -o ${chk}"
+        }
+    }
+}
+
 livecheck.type    regex
 livecheck.url     http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/
 if {${NSS_VPATCH} eq 0} {

Added: trunk/dports/net/nss/files/Makefile-MacPorts-Install.in
===================================================================
--- trunk/dports/net/nss/files/Makefile-MacPorts-Install.in	                        (rev 0)
+++ trunk/dports/net/nss/files/Makefile-MacPorts-Install.in	2016-04-19 00:51:32 UTC (rev 147861)
@@ -0,0 +1,12 @@
+# -*- mode: makefile -*-
+INSTALL=/usr/bin/install
+PREFIX=__MACPORTS_PREFIX__
+
+install:
+	$(INSTALL) -m 0755 Output.OBJD/bin/*       $(DESTDIR)$(PREFIX)/bin
+	$(INSTALL) -m 0755 -d                      $(DESTDIR)$(PREFIX)/lib/nss
+	$(INSTALL) -m 0755 Output.OBJD/lib/*.dylib $(DESTDIR)$(PREFIX)/lib/nss
+	$(INSTALL) -m 0644 Output.OBJD/lib/*.a     $(DESTDIR)$(PREFIX)/lib/nss
+	$(INSTALL) -m 0644 Output.OBJD/lib/*.chk   $(DESTDIR)$(PREFIX)/lib/nss
+	$(INSTALL) -m 0755 -d                      $(DESTDIR)$(PREFIX)/include/nss
+	$(INSTALL) -m 0644 public/{dbm,nss}/*.h    $(DESTDIR)$(PREFIX)/include/nss

Deleted: trunk/dports/net/nss/files/patch-Darwin.mk.diff
===================================================================
--- trunk/dports/net/nss/files/patch-Darwin.mk.diff	2016-04-19 00:44:41 UTC (rev 147860)
+++ trunk/dports/net/nss/files/patch-Darwin.mk.diff	2016-04-19 00:51:32 UTC (rev 147861)
@@ -1,29 +0,0 @@
---- mozilla/security/coreconf/Darwin.mk.orig	2011-08-24 18:57:43.000000000 -0500
-+++ mozilla/security/coreconf/Darwin.mk	2012-04-03 22:50:14.000000000 -0500
-@@ -86,7 +86,7 @@
-         export NEXT_ROOT
-     else
-         # GCC >= 4
--        DARWIN_SDK_CFLAGS = -isysroot $(MACOS_SDK_DIR)
-+        DARWIN_SDK_CFLAGS = -isysroot $(MACOS_SDK_DIR) -arch i386 -arch ppc
-         ifneq (4.0.0,$(GCC_VERSION_FULL))
-             # gcc > 4.0.0 passes -syslibroot to ld based on -isysroot.
-             # Don't add -isysroot to DARWIN_SDK_LDFLAGS, because the programs
-@@ -95,7 +95,7 @@
-         else
-             # gcc 4.0.0 doesn't pass -syslibroot to ld, it needs to be
-             # explicit.
--            DARWIN_SDK_LDFLAGS = -Wl,-syslibroot,$(MACOS_SDK_DIR)
-+            DARWIN_SDK_LDFLAGS = -Wl,-syslibroot,$(MACOS_SDK_DIR) -arch i386 -arch ppc
-             DARWIN_SDK_SHLIBFLAGS = $(DARWIN_SDK_LDFLAGS)
-         endif
-     endif
-@@ -136,7 +136,7 @@
- # May override this with different compatibility and current version numbers.
- DARWIN_DYLIB_VERSIONS = -compatibility_version 1 -current_version 1
- # May override this with -bundle to create a loadable module.
--DSO_LDOPTS	= -dynamiclib $(DARWIN_DYLIB_VERSIONS) -install_name @executable_path/$(notdir $@) -headerpad_max_install_names
-+DSO_LDOPTS	= -dynamiclib $(DARWIN_DYLIB_VERSIONS) -install_name @executable_path/$(notdir $@) -headerpad_max_install_names -L@@PREFIX@@/lib/nspr -L@@PREFIX@@/lib/
- 
- MKSHLIB		= $(CC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)
- DLL_SUFFIX	= dylib

Deleted: trunk/dports/net/nss/files/patch-UNIX.mk.diff
===================================================================
--- trunk/dports/net/nss/files/patch-UNIX.mk.diff	2016-04-19 00:44:41 UTC (rev 147860)
+++ trunk/dports/net/nss/files/patch-UNIX.mk.diff	2016-04-19 00:51:32 UTC (rev 147861)
@@ -1,11 +0,0 @@
---- mozilla/security/coreconf/UNIX.mk.orig	2008-10-03 12:12:41.000000000 -0700
-+++ mozilla/security/coreconf/UNIX.mk	2009-05-10 21:11:17.000000000 -0700
-@@ -48,7 +48,7 @@ else
- 	OPTIMIZER  += -g
- 	USERNAME   := $(shell whoami)
- 	USERNAME   := $(subst -,_,$(USERNAME))
--	DEFINES    += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
-+	DEFINES    += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME) -I@@PREFIX@@/include/nspr -L@@PREFIX@@/lib/nspr -I@@PREFIX@@/include -L@@PREFIX@@/lib
- endif
- 
- ifdef BUILD_TREE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160418/109f8f03/attachment-0001.html>


More information about the macports-changes mailing list