Skip to content
Permalink
Browse files

Added a macports directory with updated versions of nss and nspr.

  • Loading branch information...
Stefan Arentz Stefan Arentz
Stefan Arentz authored and Stefan Arentz committed May 15, 2009
1 parent 30c1d1c commit d5d085b570b24ec14fa3d674bb9a2d5ac876c3e2
@@ -0,0 +1,58 @@
# $Id: Portfile 49105 2009-04-04 00:41:21Z jeremyhu@macports.org $

PortSystem 1.0

name nspr
version 4.7.4
revision 1
categories devel
maintainers jeremyhu openmaintainer
platforms darwin
description A platform-neutral API for system level and libc like functions.

long_description ${description}

homepage http://www.mozilla.org/projects/nspr
master_sites http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${version}/src/ \
ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${version}/src/
checksums md5 ec1a991fc211450085149905c5e340da

worksrcdir ${worksrcdir}/mozilla/nsprpub

post-patch {
reinplace "s|@executable_path|${prefix}/lib/nspr|g" \
${worksrcpath}/configure.in \
${worksrcpath}/configure
}

universal_variant no

configure.args \
--disable-debug \
--enable-optimize='-O2' \
--enable-strip \
--libdir=${prefix}/lib/nspr

variant debug description "build with debugging symbols" {
configure.args-delete --disable-debug \
--enable-optimize='-O2' \
--enable-strip

configure.args-append --enable-debug='-ggdb3' \
--disable-optimize \
--disable-strip

configure.cflags ""
}

post-destroot {
file mkdir ${destroot}${prefix}/lib/pkgconfig
copy ${filespath}/nspr.pc ${destroot}${prefix}/lib/pkgconfig
reinplace "s|@@prefix@@|${prefix}|" ${destroot}${prefix}/lib/pkgconfig/nspr.pc
set mylibs [exec ${destroot}${prefix}/bin/nspr-config --libs]
set mycflags [exec ${destroot}${prefix}/bin/nspr-config --cflags]
set myversion [exec ${destroot}${prefix}/bin/nspr-config --version]
reinplace "s|@@FULL_NSPR_LIBS@@|${mylibs}|" ${destroot}${prefix}/lib/pkgconfig/nspr.pc
reinplace "s|@@FULL_NSPR_CFLAGS@@|${mycflags}|" ${destroot}${prefix}/lib/pkgconfig/nspr.pc
reinplace "s|@@NSPR_VERSION@@|${myversion}|" ${destroot}${prefix}/lib/pkgconfig/nspr.pc
}
@@ -0,0 +1,12 @@
prefix=@@prefix@@
exec_prefix=@@prefix@@
libdir=@@prefix@@/lib
includedir=@@prefix@@/include

Name: NSPR
Description: The Netscape Portable Runtime
Version: @@NSPR_VERSION@@
Libs: @@FULL_NSPR_LIBS@@
Cflags: @@FULL_NSPR_CFLAGS@@


@@ -0,0 +1,89 @@
# $Id$

PortSystem 1.0

name nss
version 3.12.3
set NSS_VMAJOR 3
set NSS_VMINOR 12
set NSS_VPATCH 3
categories net
maintainers jeremyhu openmaintainer
description Network Security Service libraries.
depends_lib port:nspr

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 yes
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 md5 ecb7079ba4ebcf29b7716775384f1f18 \
sha1 eeca14a37629287baa10eb7562a5fb927e9dd171 \
rmd160 b5339eda9dfc87385b2c11e2ca53be249b75ed69

depends_lib \
port:nspr \
port:sqlite3

patchfiles patch-UNIX.mk.diff \
patch-Darwin.mk.diff

post-patch {
reinplace "s|@executable_path|${prefix}/lib/nss|g" \
${worksrcpath}/mozilla/security/coreconf/Darwin.mk \
${worksrcpath}/mozilla/security/nss/cmd/platlibs.mk \
${worksrcpath}/mozilla/security/nss/lib/smime/config.mk \
${worksrcpath}/mozilla/security/nss/lib/ssl/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
}

build {system "cd ${worksrcpath} && make -C mozilla/security/coreconf/nsinstall && make -C mozilla/security/dbm && make -C mozilla/security/nss NSPR_LIB_DIR=${prefix}/lib/nspr NSS_USE_SYSTEM_SQLITE=1"}

destroot {
xinstall -m 755 -d ${destroot}${prefix}/include/nss
eval xinstall -m 755 [glob ${worksrcpath}/mozilla/dist/public/nss/*] ${destroot}${prefix}/include/nss
eval xinstall -m 755 [glob ${worksrcpath}/mozilla/dist/public/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
eval xinstall -m 755 [glob ${worksrcpath}/mozilla/dist/Darwin*/lib/*.dylib] ${destroot}${prefix}/lib/nss
eval xinstall -m 644 [glob ${worksrcpath}/mozilla/dist/Darwin*/lib/libcrmf.a] ${destroot}${prefix}/lib/nss

xinstall -m 755 -d ${destroot}${prefix}/lib/pkgconfig

xinstall ${filespath}/nss.pc.in ${destroot}${prefix}/lib/pkgconfig/nss.pc
xinstall -m 755 ${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]

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
}
@@ -0,0 +1,145 @@
#!/bin/sh

prefix=@prefix@

major_version=@MOD_MAJOR_VERSION@
minor_version=@MOD_MINOR_VERSION@
patch_version=@MOD_PATCH_VERSION@

usage()
{
cat <<EOF
Usage: nss-config [OPTIONS] [LIBRARIES]
Options:
[--prefix[=DIR]]
[--exec-prefix[=DIR]]
[--includedir[=DIR]]
[--libdir[=DIR]]
[--version]
[--libs]
[--cflags]
Dynamic Libraries:
nss
ssl
smime
nssutil
EOF
exit $1
}

if test $# -eq 0; then
usage 1 1>&2
fi

lib_ssl=yes
lib_smime=yes
lib_nss=yes
lib_nssutil=yes

while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac

case $1 in
--prefix=*)
prefix=$optarg
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
;;
--exec-prefix)
echo_exec_prefix=yes
;;
--includedir=*)
includedir=$optarg
;;
--includedir)
echo_includedir=yes
;;
--libdir=*)
libdir=$optarg
;;
--libdir)
echo_libdir=yes
;;
--version)
echo ${major_version}.${minor_version}.${patch_version}
;;
--cflags)
echo_cflags=yes
;;
--libs)
echo_libs=yes
;;
ssl)
lib_ssl=yes
;;
smime)
lib_smime=yes
;;
nss)
lib_nss=yes
;;
nssutil)
lib_nssutil=yes
;;
*)
usage 1 1>&2
;;
esac
shift
done

# Set variables that may be dependent upon other variables
if test -z "$exec_prefix"; then
exec_prefix=@exec_prefix@
fi
if test -z "$includedir"; then
includedir=@includedir@
fi
if test -z "$libdir"; then
libdir=@libdir@
fi

if test "$echo_prefix" = "yes"; then
echo $prefix
fi

if test "$echo_exec_prefix" = "yes"; then
echo $exec_prefix
fi

if test "$echo_includedir" = "yes"; then
echo $includedir
fi

if test "$echo_libdir" = "yes"; then
echo $libdir
fi

if test "$echo_cflags" = "yes"; then
echo -I$includedir
fi

if test "$echo_libs" = "yes"; then
libdirs="-L$libdir"
if test -n "$lib_ssl"; then
libdirs="$libdirs -lssl${major_version}"
fi
if test -n "$lib_smime"; then
libdirs="$libdirs -lsmime${major_version}"
fi
if test -n "$lib_nss"; then
libdirs="$libdirs -lnss${major_version}"
fi
if test -n "$lib_nssutil"; then
libdirs="$libdirs -lnssutil${major_version}"
fi
echo $libdirs
fi

@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: NSS
Description: Network Security Services
Version: @NSS_VERSION@
Requires: nspr >= @NSPR_VERSION@
Libs: -L${libdir} -lssl3 -lsmime3 -lnssutil3 -lnss3
Cflags: -I${includedir}
@@ -0,0 +1,29 @@
--- mozilla/security/coreconf/Darwin.mk.orig 2008-01-05 04:17:18.000000000 +0100
+++ mozilla/security/coreconf/Darwin.mk 2008-01-05 04:16:10.000000000 +0100
@@ -74,7 +74,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
@@ -83,7 +83,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
@@ -111,7 +111,7 @@

DSO_CFLAGS = -fPIC
# May override this with -bundle to create a loadable module.
-DSO_LDOPTS = -dynamiclib -compatibility_version 1 -current_version 1 -install_name @executable_path/$(notdir $@) -headerpad_max_install_names
+DSO_LDOPTS = -dynamiclib -compatibility_version 1 -current_version 1 -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
@@ -0,0 +1,11 @@
--- 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

0 comments on commit d5d085b

Please sign in to comment.
You can’t perform that action at this time.