source: trunk/dports/net/nss/Portfile @ 147860

Last change on this file since 147860 was 147860, checked in by mcalhoun@…, 4 years ago

nss: no functional changes (comments, whitespace, and code order)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.6 KB
Line 
1# -*- 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
2# $Id: Portfile 147860 2016-04-19 00:44:41Z mcalhoun@macports.org $
3
4PortSystem          1.0
5
6name                nss
7version             3.14.3
8set NSS_VMAJOR      [lindex [split ${version} .] 0]
9set NSS_VMINOR      [lindex [split ${version} .] 1]
10set NSS_VPATCH      [lindex [split ${version} .] 2]
11if {${NSS_VPATCH} eq ""} {
12    # NSS_VPATCH should always be a number
13    set NSS_VPATCH 0
14}
15categories          net
16maintainers         nomaintainer
17license             {MPL-1.1 GPL-2+ LGPL-2.1+}
18description         Network Security Service libraries.
19
20long_description    ${description}
21use_configure       no
22homepage            http://www.mozilla.org/projects/security/pki/nss/
23platforms           darwin
24
25set my_release      NSS_[strsed ${version} {g/\./_/}]_RTM
26
27use_bzip2           no
28master_sites        ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${my_release}/src/ \
29                    http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${my_release}/src/
30
31checksums           rmd160  78ce247c6d649ac0624b087d7a947e8b3482d520 \
32                    sha256  d9d366be94d33395597ebf82363fcdedfa693a6d627cf7f6bec025f609d54cc0
33
34depends_lib     port:nspr \
35                port:sqlite3
36
37patchfiles      patch-UNIX.mk.diff \
38                patch-Darwin.mk.diff
39
40# This is all kinds of messed up for universal...
41universal_variant no
42
43post-patch {
44    # libraries are not relative to any main executable, so no need for @executable_path
45    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
61}
62
63build {
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
76destroot {
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
89    # applications seem to expect an nss-config executable and nss.pc file, but nss does not provide them
90    # see https://bugzilla.mozilla.org/show_bug.cgi?id=530672
91
92    xinstall  -m 0755 ${filespath}/nss-config.in       ${destroot}${prefix}/bin/nss-config
93    reinplace "s,@libdir@,${prefix}/lib/nss,g"         ${destroot}${prefix}/bin/nss-config
94    reinplace "s,@prefix@,${prefix},g"                 ${destroot}${prefix}/bin/nss-config
95    reinplace "s,@exec_prefix@,${prefix},g"            ${destroot}${prefix}/bin/nss-config
96    reinplace "s,@includedir@,${prefix}/include/nss,g" ${destroot}${prefix}/bin/nss-config
97    reinplace "s,@MOD_MAJOR_VERSION@,${NSS_VMAJOR},g"  ${destroot}${prefix}/bin/nss-config
98    reinplace "s,@MOD_MINOR_VERSION@,${NSS_VMINOR},g"  ${destroot}${prefix}/bin/nss-config
99    reinplace "s,@MOD_PATCH_VERSION@,${NSS_VPATCH},g"  ${destroot}${prefix}/bin/nss-config
100
101    set nspr_version [exec ${prefix}/bin/nspr-config --version]
102    set nss_version  [exec ${destroot}${prefix}/bin/nss-config --version]
103
104    xinstall  ${filespath}/nss.pc.in                  ${destroot}${prefix}/lib/pkgconfig/nss.pc
105    reinplace "s,@libdir@,${prefix}/lib/nss,g"        ${destroot}${prefix}/lib/pkgconfig/nss.pc
106    reinplace "s,@prefix@,${prefix},g"                ${destroot}${prefix}/lib/pkgconfig/nss.pc
107    reinplace "s,@exec_prefix@,${prefix},g"           ${destroot}${prefix}/lib/pkgconfig/nss.pc
108    reinplace "s,@includedir@,${prefix}/include/nss," ${destroot}${prefix}/lib/pkgconfig/nss.pc
109    reinplace "s,@NSPR_VERSION@,${nspr_version},g"    ${destroot}${prefix}/lib/pkgconfig/nss.pc
110    reinplace "s,@NSS_VERSION@,${nss_version},g"      ${destroot}${prefix}/lib/pkgconfig/nss.pc
111}
112
113livecheck.type    regex
114livecheck.url     http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/
115if {${NSS_VPATCH} eq 0} {
116    livecheck.version "${NSS_VMAJOR}_${NSS_VMINOR}"
117} else {
118    livecheck.version "${NSS_VMAJOR}_${NSS_VMINOR}_${NSS_VPATCH}"
119}
120livecheck.regex   {(\d+_\d+(?:_\d+)*)}
Note: See TracBrowser for help on using the repository browser.