smlinux/base/mozilla-nss/mozilla-nss.SMBuild

111 lines
3 KiB
Text
Executable file

app=mozilla-nss
version=3.73.1
nsprversion=4.32
build=1sml
homepage='https://mozilla.org'
desc="set of cryptographic libraries from Mozilla for use in security-focused applications"
requires="gyp"
NJOBS="(echo $MAKEFLAGS | sed 's/-j//')"
build() {
mkandenterbuilddir
rm -rf nss-$version
rm -rf nspr-*
tar xf $srcdir/nss-$version.tar.?z*
cd nss-$version
tar xf $srcdir/nspr-$nsprversion.tar.?z*
mv nspr*/nspr .
fixbuilddirpermissions
# NSS doesn't like our ARM64-specific optimization C/CXXFLAGS
if [ "$arch" == "aarch64" ] ; then
unset CFLAGS CXXFLAGS
fi
# Disable Werror
export NSS_ENABLE_WERROR=0
# Disable deprecated ciphers
export NSS_DISABLE_DEPRECATED_SEED=1
export NSS_DISABLE_DEPRECATED_RC2=1
cd nss
./build.sh -v -j 8 --opt --system-sqlite --enable-libpkix --disable-tests
cd -
# Install all the needed stuff to the package directory
mkdir -p $pkg/{bin,lib,include/{nss,nspr}}
cd dist/Release
cp -pL bin/{certutil,cmsutil,crlutil,modutil,pk12util,shlibsign,signtool,signver,ssltap} $pkg/bin/
cp -pL lib/*.{so,a} $pkg/lib/
chmod 755 $pkg/lib/*.so*
cp -rL include/* $pkg/include/
cp -rpL ../public/nss/*.h $pkg/include/nss/
cd -
cd nss/cmd/smimetools
install -m 755 smime $pkg/bin/smime
sed -i -e 's#/usr/local/bin#/bin#g' $pkg/bin/smime
cd -
# Install nspr-config
cat nspr/Release/config/nspr-config | sed -e "s,^prefix=.*$,prefix=,g" > $pkg/bin/nspr-config
chmod 755 $pkg/bin/nspr-config
# Install nss-config
sed -e "s,@prefix@,,g" \
-e "s,@MOD_MAJOR_VERSION@,$(printf $version | cut -d. -f1),g" \
-e "s,@MOD_MAJOR_VERSION@,$(printf $version | cut -d. -f2),g" \
-e "s,@MOD_MAJOR_VERSION@,$(printf $version | cut -d. -f3),g" \
$srcdir/nss-config.in > $pkg/bin/nss-config
chmod 755 $pkg/bin/nss-config
# Provide pkg-config files
mkdir -p $pkg/lib/pkgconfig
cat <<EOT > $pkg/lib/pkgconfig/mozilla-nss.pc
prefix=
exec_prefix=\${prefix}
libdir=/lib
includedir=\${prefix}/include/nss
Name: NSS
Description: Network Security Services
Version: $version
Requires: nspr >= $nsprversion sqlite3
Libs: -L\${libdir} -lnss3 -lsmime3 -lssl3 -lsoftokn3 -lnssutil3
Cflags: -I\${includedir}
EOT
cat <<EOT > $pkg/lib/pkgconfig/mozilla-nspr.pc
prefix=
exec_prefix=\${prefix}
libdir=/lib
includedir=\${prefix}/include/nspr
Name: NSPR
Description: The Netscape Portable Runtime
Version: $nsprversion
Libs: -L\${libdir} -lplds4 -lplc4 -lnspr4
Cflags: -I\${includedir}
EOT
# Create pkgconfig symlinks
(
cd $pkg/lib/pkgconfig
ln -s mozilla-nspr.pc nspr.pc
ln -s mozilla-nss.pc nss.pc
)
cp -a $srcdir/{MPL-1.1.txt,gpl-2.0.txt,lgpl-2.1.txt} $pkgdocs/
removestaticlibs
mkfinalpkg
}
sha512sums="
f9d9f04f2ae95d569d100561db57b00c2ecc305ddff89698cb6c82352e5a279354546d4df12598bdac1b619bedfdb3b491120a364b959a591a2fbd3f7e40a705 nspr-4.32.tar.lz
3987f82d8d75eb18721ba94cd86261fbf3f61d2d21687fc975d9753b5b722e597ce6f7a5aabd34128b087ddee6aa3691a647f916c2227fd3d783683f4971a814 nss-3.73.1.tar.lz
"