PKGBUILDs/core/nss/PKGBUILD

105 lines
3.4 KiB
Bash
Raw Normal View History

2019-09-04 00:29:18 +00:00
# Maintainer: Jan de Groot <jgc@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove -march=armv8-a in AArch64 CFLAGS to not conflict with -march=armv8-a+crypto being added
# this is a stupid, dirty hack that shouldn't be necessary
pkgbase=nss
pkgname=(nss ca-certificates-mozilla)
2020-02-08 17:10:19 +00:00
pkgver=3.50
pkgrel=1
2019-09-04 00:29:18 +00:00
pkgdesc="Network Security Services"
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS"
arch=(x86_64)
license=(MPL GPL)
2020-02-08 17:10:19 +00:00
_nsprver=4.25
2020-01-24 13:27:43 +00:00
depends=("nspr>=${_nsprver}" sqlite zlib sh 'p11-kit>=0.23.19')
2019-10-03 23:12:29 +00:00
makedepends=(perl python gyp)
2019-09-04 00:29:18 +00:00
source=("https://ftp.mozilla.org/pub/security/nss/releases/NSS_${pkgver//./_}_RTM/src/nss-${pkgver}.tar.gz"
2020-01-25 01:21:27 +00:00
certdata2pem.py bundle.sh
0001-Don-t-USE_ARM_GCM.patch
0002-disable-arm-neon.patch)
2020-02-08 17:10:19 +00:00
sha256sums=('185df319775243f5f5daa9d49b7f9cc5f2b389435be3247c3376579bee063ba7'
2020-01-24 13:27:43 +00:00
'd2a1579dae05fd16175fac27ef08b54731ecefdf414085c610179afcf62b096c'
2020-01-25 01:21:27 +00:00
'3bfadf722da6773bdabdd25bdf78158648043d1b7e57615574f189a88ca865dd'
'a25f7dc6c9233d729e3d8f2c30e839371feec63dcd2f805d138fe51ca54637a4'
'cb34218332a4a4a84436f3a805caec92fc6ece6ae33759a82117b3cd30719408')
2019-09-04 00:29:18 +00:00
prepare() {
2019-10-03 23:12:29 +00:00
mkdir certs
2019-09-04 00:29:18 +00:00
cd nss-$pkgver
ln -sr nss/lib/ckfw/builtins/certdata.txt ../certs/
ln -sr nss/lib/ckfw/builtins/nssckbi.h ../certs/
2020-01-25 01:21:27 +00:00
cd nss
patch -p1 -i "${srcdir}"/0001-Don-t-USE_ARM_GCM.patch
patch -p1 -i "${srcdir}"/0002-disable-arm-neon.patch
2019-09-04 00:29:18 +00:00
}
build() {
[[ $CARCH == "aarch64" ]] && CFLAGS=`echo $CFLAGS | sed -e 's/-march=armv8-a//'` && CXXFLAGS="$CFLAGS"
2019-10-03 23:12:29 +00:00
cd certs
../certdata2pem.py
cd ..
./bundle.sh
2019-09-04 00:29:18 +00:00
cd nss-$pkgver/nss
2020-01-25 01:21:27 +00:00
./build.sh -v --opt --system-sqlite --system-nspr --enable-libpkix --disable-tests -Ddisable_arm_neon=1 -Ddisable_arm_hw_aes=1
2019-09-04 00:29:18 +00:00
}
package_nss() {
local vmajor vminor vpatch
cd nss-$pkgver
{ read vmajor; read vminor; read vpatch; } \
< <(awk '/#define.*NSS_V(MAJOR|MINOR|PATCH)/ {print $3}' nss/lib/nss/nss.h)
sed nss/pkg/pkg-config/nss.pc.in \
-e "s,%libdir%,/usr/lib,g" \
-e "s,%prefix%,/usr,g" \
-e "s,%exec_prefix%,/usr/bin,g" \
-e "s,%includedir%,/usr/include/nss,g" \
-e "s,%NSPR_VERSION%,$_nsprver,g" \
-e "s,%NSS_VERSION%,$pkgver,g" |
install -Dm644 /dev/stdin "$pkgdir/usr/lib/pkgconfig/nss.pc"
ln -s nss.pc "$pkgdir/usr/lib/pkgconfig/mozilla-nss.pc"
sed nss/pkg/pkg-config/nss-config.in \
-e "s,@libdir@,/usr/lib,g" \
-e "s,@prefix@,/usr/bin,g" \
-e "s,@exec_prefix@,/usr/bin,g" \
-e "s,@includedir@,/usr/include/nss,g" \
-e "s,@MOD_MAJOR_VERSION@,$vmajor,g" \
-e "s,@MOD_MINOR_VERSION@,$vminor,g" \
-e "s,@MOD_PATCH_VERSION@,$vpatch,g" |
install -D /dev/stdin "$pkgdir/usr/bin/nss-config"
cd nss/doc/nroff
install -Dt "$pkgdir/usr/share/man/man1" -m644 *util.1 signtool.1 signver.1 ssltap.1
cd ../../../dist
install -Dt "$pkgdir/usr/include/nss" -m644 public/nss/*.h
cd Release/bin
install -Dt "$pkgdir/usr/bin" *util shlibsign signtool signver ssltap
cd ../lib
install -Dt "$pkgdir/usr/lib" *.so
install -Dt "$pkgdir/usr/lib" -m644 *.chk
# Replace built-in trust with p11-kit connection
2020-01-28 20:27:23 +00:00
ln -sf pkcs11/p11-kit-trust.so "$pkgdir/usr/lib/libnssckbi.so"
2019-09-04 00:29:18 +00:00
}
package_ca-certificates-mozilla() {
pkgdesc="Mozilla's set of trusted CA certificates"
2020-01-24 13:27:43 +00:00
depends=('ca-certificates-utils>=20181109-3')
2019-09-04 00:29:18 +00:00
install -Dm644 ca-bundle.trust.p11-kit \
"$pkgdir/usr/share/ca-certificates/trust-source/mozilla.trust.p11-kit"
}