Changeset 147861 for trunk


Ignore:
Timestamp:
Apr 19, 2016, 12:51:32 AM (4 years ago)
Author:
mcalhoun@…
Message:

nss: update version 3.14.3->3.23; remove nss- prefix from binaries; allow universal build

Location:
trunk/dports/net/nss
Files:
1 added
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/net/nss/Portfile

    r147860 r147861  
    33
    44PortSystem          1.0
     5PortGroup           muniversal 1.0
    56
    67name                nss
    7 version             3.14.3
     8version             3.23
    89set NSS_VMAJOR      [lindex [split ${version} .] 0]
    910set NSS_VMINOR      [lindex [split ${version} .] 1]
     
    1516categories          net
    1617maintainers         nomaintainer
    17 license             {MPL-1.1 GPL-2+ LGPL-2.1+}
     18license             {MPL-2 GPL-2+ LGPL-2.1+}
    1819description         Network Security Service libraries.
    1920
     
    2930                    http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${my_release}/src/
    3031
    31 checksums           rmd160  78ce247c6d649ac0624b087d7a947e8b3482d520 \
    32                     sha256  d9d366be94d33395597ebf82363fcdedfa693a6d627cf7f6bec025f609d54cc0
     32checksums           rmd160  2cb9a448ec60a00edd7cf5a08321dd6583d03cb9 \
     33                    sha256  94b383e31c9671e9dfcca81084a8a813817e8f05a57f54533509b318d26e11cf
    3334
    3435depends_lib     port:nspr \
     36                port:zlib \
    3537                port:sqlite3
    3638
    37 patchfiles      patch-UNIX.mk.diff \
    38                 patch-Darwin.mk.diff
     39destroot.dir ${destroot.dir}/dist
     40build.dir    ${build.dir}/nss
    3941
    40 # This is all kinds of messed up for universal...
    41 universal_variant no
     42# muniversal destroot requires a Makefile
     43post-extract {
     44    xinstall -d -m 0755 ${destroot.dir}
     45
     46    copy ${filespath}/Makefile-MacPorts-Install.in ${destroot.dir}/Makefile-MacPorts-Install
     47    reinplace "s|__MACPORTS_PREFIX__|${prefix}|g" ${destroot.dir}/Makefile-MacPorts-Install
     48}
     49
     50destroot.args-append \
     51    -f Makefile-MacPorts-Install
    4252
    4353post-patch {
    4454    # libraries are not relative to any main executable, so no need for @executable_path
    4555    reinplace "s|@executable_path|${prefix}/lib/nss|g" \
    46         ${worksrcpath}/mozilla/security/coreconf/Darwin.mk \
    47         ${worksrcpath}/mozilla/security/nss/lib/freebl/config.mk
    48     reinplace "s|@@PREFIX@@|${prefix}|g" \
    49         ${worksrcpath}/mozilla/security/coreconf/Darwin.mk \
    50         ${worksrcpath}/mozilla/security/coreconf/UNIX.mk
    51     reinplace "s|= cc\$|= ${configure.cc}|" \
    52         ${worksrcpath}/mozilla/security/coreconf/Darwin.mk
    53     reinplace "s|= c++\$|= ${configure.cxx}|" \
    54         ${worksrcpath}/mozilla/security/coreconf/Darwin.mk
    55     reinplace "s|= ranlib\$|= /usr/bin/ranlib|" \
    56         ${worksrcpath}/mozilla/security/coreconf/Darwin.mk
    57     reinplace "s|=gcc|=${configure.cc}|" \
    58         ${worksrcpath}/mozilla/security/nss/Makefile
    59     reinplace "s|=g++|=${configure.cxx}|" \
    60         ${worksrcpath}/mozilla/security/nss/Makefile
     56        ${build.dir}/coreconf/Darwin.mk \
     57        ${build.dir}/lib/freebl/config.mk
    6158}
    6259
    63 build {
    64     if {[info exists build_arch] && (${build_arch} eq "x86_64" || ${build_arch} eq "ppc64")} {
    65         set use_64 " USE_64=1"
    66     } else {
    67         set use_64 ""
    68     }
    69     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}\""
    70     system "cd ${worksrcpath} && \
    71             make -C mozilla/security/coreconf/nsinstall ${make_args} && \
    72             make -C mozilla/security/dbm ${make_args} && \
    73             make -C mozilla/security/nss ${make_args}"
    74 }
    75 
    76 destroot {
    77     xinstall -m 755 -d ${destroot}${prefix}/include/nss
    78     xinstall -m 755 {*}[glob -directory ${worksrcpath}/mozilla/dist/public/ nss/* dbm/*] ${destroot}${prefix}/include/nss
    79     xinstall -m 755 -d ${destroot}${prefix}/bin
    80     foreach f [glob ${worksrcpath}/mozilla/dist/Darwin*/bin/*] {
    81         xinstall -m 755 $f ${destroot}${prefix}/bin/nss-[file tail $f]
    82     }
    83     xinstall -m 755 -d ${destroot}${prefix}/lib/nss
    84     xinstall -m 755 {*}[glob ${worksrcpath}/mozilla/dist/Darwin*/lib/*.dylib] ${destroot}${prefix}/lib/nss
    85     xinstall -m 644 {*}[glob ${worksrcpath}/mozilla/dist/Darwin*/lib/libcrmf.a] ${destroot}${prefix}/lib/nss
    86 
    87     xinstall -m 755 -d ${destroot}${prefix}/lib/pkgconfig
    88 
     60post-destroot {
    8961    # applications seem to expect an nss-config executable and nss.pc file, but nss does not provide them
    9062    # see https://bugzilla.mozilla.org/show_bug.cgi?id=530672
     
    10274    set nss_version  [exec ${destroot}${prefix}/bin/nss-config --version]
    10375
    104     xinstall  ${filespath}/nss.pc.in                  ${destroot}${prefix}/lib/pkgconfig/nss.pc
     76    xinstall  -m 0644 ${filespath}/nss.pc.in          ${destroot}${prefix}/lib/pkgconfig/nss.pc
    10577    reinplace "s,@libdir@,${prefix}/lib/nss,g"        ${destroot}${prefix}/lib/pkgconfig/nss.pc
    10678    reinplace "s,@prefix@,${prefix},g"                ${destroot}${prefix}/lib/pkgconfig/nss.pc
     
    10981    reinplace "s,@NSPR_VERSION@,${nspr_version},g"    ${destroot}${prefix}/lib/pkgconfig/nss.pc
    11082    reinplace "s,@NSS_VERSION@,${nss_version},g"      ${destroot}${prefix}/lib/pkgconfig/nss.pc
     83
     84    # install man files
     85    xinstall -m 0644 \
     86        {*}[glob ${build.dir}/doc/nroff/*.1] \
     87        ${destroot}${prefix}/share/man/man1/
     88}
     89
     90use_parallel_build  no
     91
     92# mimic nss/coreconf/Darwin.mk
     93
     94if {![variant_isset universal]} {
     95    if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
     96        build.args-append USE_64=1
     97    }
     98
     99    build.args-append \
     100        CC=\"${configure.cc} -arch ${build_arch}\" \
     101        CCC=\"${configure.cxx} -arch ${build_arch}\"
     102} else {
     103    lappend merger_build_args(x86_64) USE_64=1
     104    lappend merger_build_args(ppc64)  USE_64=1
     105
     106    foreach arch ${universal_archs} {
     107        lappend merger_build_args(${arch}) \
     108            CC='${configure.cc} -arch ${arch}' \
     109            CCC='${configure.cxx} -arch ${arch}'
     110    }
     111}
     112
     113build.args-append \
     114    NSPR_INCLUDE_DIR=${prefix}/include/nspr \
     115    NSPR_LIB_DIR=${prefix}/lib/nspr \
     116    NSS_USE_SYSTEM_SQLITE=1 \
     117    USE_SYSTEM_ZLIB=1 \
     118    BUILD_OPT=1 \
     119    OPTIMIZER="${configure.optflags}" \
     120    OBJDIR_NAME="Output.OBJD"
     121
     122if {${configure.sdkroot} ne ""} {
     123    build.args-append \
     124        MACOS_SDK_DIR=${configure.sdkroot}
     125}
     126
     127if {[variant_isset universal]} {
     128    # chk files can not be merged
     129
     130    merger-post-destroot {
     131        foreach arch ${universal_archs_to_use} {
     132            foreach chk [glob -nocomplain -directory ${destroot}-${arch}${prefix}/lib/nss *.chk] {
     133                # delete chk file and replace it with an empty file, which can be merged
     134                # keep the empty file so that later, we can know which chk files need to be regenerated from universal library
     135                file delete ${chk}
     136                system "touch ${chk}"
     137            }
     138        }
     139    }
     140
     141    post-destroot {
     142        foreach chk [glob -nocomplain -directory ${destroot}${prefix}/lib/nss *.chk] {
     143            # replace empty chk file with an actual one generated from universal library
     144            file delete ${chk}
     145            set base [file rootname ${chk}]
     146            system "env DYLD_LIBRARY_PATH=${destroot}${prefix}/lib/nss ${destroot}${prefix}/bin/shlibsign -i ${base}.dylib -o ${chk}"
     147        }
     148    }
    111149}
    112150
Note: See TracChangeset for help on using the changeset viewer.