# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4 # $Id$ PortSystem 1.0 PortGroup compiler_blacklist_versions 1.0 PortGroup muniversal 1.0 name nss version 3.27.1 set NSS_VMAJOR [lindex [split ${version} .] 0] set NSS_VMINOR [lindex [split ${version} .] 1] set NSS_VPATCH [lindex [split ${version} .] 2] if {${NSS_VPATCH} eq ""} { # NSS_VPATCH should always be a number set NSS_VPATCH 0 } categories net maintainers nomaintainer license {MPL-2 GPL-2+ LGPL-2.1+} description Network Security Service libraries. long_description ${description} use_configure no homepage http://www.mozilla.org/projects/security/pki/nss/ platforms darwin set my_release NSS_[strsed ${version} {g/\./_/}]_RTM use_bzip2 no 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 70158d5ffeed658c0fd9663c1a7ac83dc99f18a4 \ sha256 fd3637a1930cd838239a89633a7ed9a18859ae9b599043f3a18f726dc4ec2a6b depends_lib port:nspr \ port:zlib \ port:sqlite3 destroot.dir ${destroot.dir}/dist build.dir ${build.dir}/nss # external tests require libc++ and don't build on some systems with libc++ anyways, just disable them build.args NSS_DISABLE_GTESTS=1 # disable use of -Werror build.args-append NSS_ENABLE_WERROR=0 # 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" \ ${build.dir}/coreconf/Darwin.mk \ ${build.dir}/lib/freebl/config.mk } 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 xinstall -m 0755 ${filespath}/nss-config.in ${destroot}${prefix}/bin/nss-config reinplace "s,@libdir@,${prefix}/lib/nss,g" ${destroot}${prefix}/bin/nss-config reinplace "s,@prefix@,${prefix},g" ${destroot}${prefix}/bin/nss-config reinplace "s,@exec_prefix@,${prefix},g" ${destroot}${prefix}/bin/nss-config reinplace "s,@includedir@,${prefix}/include/nss,g" ${destroot}${prefix}/bin/nss-config reinplace "s,@MOD_MAJOR_VERSION@,${NSS_VMAJOR},g" ${destroot}${prefix}/bin/nss-config reinplace "s,@MOD_MINOR_VERSION@,${NSS_VMINOR},g" ${destroot}${prefix}/bin/nss-config reinplace "s,@MOD_PATCH_VERSION@,${NSS_VPATCH},g" ${destroot}${prefix}/bin/nss-config set nspr_version [exec ${prefix}/bin/nspr-config --version] set nss_version [exec ${destroot}${prefix}/bin/nss-config --version] xinstall -m 0644 ${filespath}/nss.pc.in ${destroot}${prefix}/lib/pkgconfig/nss.pc reinplace "s,@libdir@,${prefix}/lib/nss,g" ${destroot}${prefix}/lib/pkgconfig/nss.pc reinplace "s,@prefix@,${prefix},g" ${destroot}${prefix}/lib/pkgconfig/nss.pc reinplace "s,@exec_prefix@,${prefix},g" ${destroot}${prefix}/lib/pkgconfig/nss.pc reinplace "s,@includedir@,${prefix}/include/nss," ${destroot}${prefix}/lib/pkgconfig/nss.pc reinplace "s,@NSPR_VERSION@,${nspr_version},g" ${destroot}${prefix}/lib/pkgconfig/nss.pc reinplace "s,@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 # blacklist old compilers that don't understand -std=c++0x # to fix build on 10.6 and earlier # https://trac.macports.org/ticket/51196 compiler.blacklist *gcc* {clang < 300} # 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} { livecheck.version "${NSS_VMAJOR}_${NSS_VMINOR}" } else { livecheck.version "${NSS_VMAJOR}_${NSS_VMINOR}_${NSS_VPATCH}" } livecheck.regex {(\d+_\d+(?:_\d+)*)}