Last active
December 10, 2015 13:08
-
-
Save 3van/4438835 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -eu | |
| NSPR_VERSION=4.9.4 | |
| build_libnspr() { | |
| prereq "libnspr" \ | |
| "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.9.4/src/nspr-4.9.4.tar.gz" | |
| quiet pushd "$ROOTDIR/source/libnspr/mozilla/nsprpub" | |
| if needsconfigure $@; then | |
| ( | |
| status "Configuring libnspr" | |
| CONFIG_CMD="./configure \ | |
| --prefix="$ROOTDIR/build" \ | |
| --with-macos-sdk="$SDK_ROOT" \ | |
| --enable-macos-target="$MIN_OS_VERSION" \ | |
| --enable-ipv6 \ | |
| --enable-pthreads \ | |
| --enable-strip" | |
| xconfigure "${BASE_CFLAGS}" "${BASE_LDFLAGS}" "${CONFIG_CMD}" | |
| ) | |
| fi | |
| status "Building and installing libnspr" | |
| log make | |
| log make install | |
| quiet popd | |
| } | |
| NSS_VERSION=3.14.1 | |
| build_libnss() { | |
| prereq "libnss" \ | |
| "ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_14_1_RTM/src/nss-3.14.1.tar.gz" | |
| quiet pushd "$ROOTDIR/source/libnss/mozilla/security/nss" | |
| export BUILD_OPT=1 | |
| export NSS_ENABLE_ECC=1 | |
| export NSS_USE_SYSTEM_SQLITE=1 | |
| export NSPR_INCLUDE_DIR="$ROOTDIR/build/include/nspr" | |
| export NSPR_LIB_DIR="$ROOTDIR/build/lib" | |
| # i know this looks crazy. it is. thanks, mozilla. | |
| export CC="$CC -arch x86_64 -Xarch_x86_64 -DNSS_USE_64\\ -DNSS_X64\\ -DNSS_X86_OR_X64 -arch i386 -Xarch_i386 -DNSS_X86\\ -DNSS_X86_OR_X64" | |
| status "Building and installing libnss" | |
| log make -e build_coreconf | |
| log make -e build_dbm | |
| # we have to disable the shlibsign stuff since it doesn't work when we're compiling like this. don't panic. | |
| fwdpatch "$ROOTDIR/patches/nss-shlibsign-Makefile.diff" -p0 || true | |
| log make -e all | |
| revpatch "$ROOTDIR/patches/nss-shlibsign-Makefile.diff" -p0 | |
| status "Copying libnss binaries" | |
| log cp $ROOTDIR/source/libnss/mozilla/dist/Darwin*/bin/* $ROOTDIR/build/bin/ | |
| log cp $ROOTDIR/source/libnss/mozilla/dist/Darwin*/lib/* $ROOTDIR/build/lib/ | |
| status "Staging libnss headers" | |
| quiet mkdir $ROOTDIR/build/include/nss | |
| quiet mkdir $ROOTDIR/build/include/nss/private | |
| log cp $ROOTDIR/source/libnss/mozilla/dist/public/dbm/* $ROOTDIR/build/include/nss/ | |
| log cp $ROOTDIR/source/libnss/mozilla/dist/public/nss/* $ROOTDIR/build/include/nss/ | |
| log cp $ROOTDIR/source/libnss/mozilla/dist/private/nss/* $ROOTDIR/build/include/nss/private/ | |
| cat <<-EOF > $ROOTDIR/build/lib/pkgconfig/nss.pc | |
| prefix=${ROOTDIR}/build | |
| EOF | |
| cat <<-'EOF' >> $ROOTDIR/build/lib/pkgconfig/nss.pc | |
| exec_prefix=${prefix} | |
| libdir=${exec_prefix}/lib | |
| includedir=${prefix}/include/nss | |
| Name: NSS | |
| Description: Mozilla Network Security Services | |
| Version: 3.14.1 | |
| Requires: nspr | |
| Libs: -L${libdir} -lnss3 -lnssutil3 -lsmime3 -lssl3 | |
| Cflags: -I${includedir} | |
| EOF | |
| quiet popd | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment