# -*- 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
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
license {MPL-2 GPL-2+ LGPL-2.1+}
description Network Security Service libraries.
long_description ${description}
homepage http://www.mozilla.org/projects/security/pki/nss/
set my_release NSS_[strsed ${version} {g/\./_/}]_RTM
master_sites https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${my_release}/src/ \
ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${my_release}/src/
checksums rmd160 cc281100c6ae0cc0c9c45918f79b518cbc61b3d5 \
sha256 1ae3d1cb1de345b258788f2ef6b10a460068034c3fd64f42427a183d8342a6fb \
# build fails with gcc-4.2 on Intel, but succeeds with gcc-4.2 on PPC
# cc1: error: unrecognized command line option "-mpclmul"
# cc1: error: unrecognized command line option "-maes"
if {${build_arch} eq "x86_64" || ${build_arch} eq "i386"} {
compiler.blacklist-append *gcc-4.* *gcc-3.*
destroot.dir ${destroot.dir}/dist
build.dir ${build.dir}/nss
# external tests require C++11
build.args NSS_DISABLE_GTESTS=1
build.args-append NSS_ENABLE_WERROR=0
# muniversal destroot requires a Makefile
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