PKGBUILDs/core/nss/PKGBUILD

116 lines
3.8 KiB
Bash
Raw Normal View History

2020-05-20 12:42:45 +00:00
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
2019-09-04 00:29:18 +00:00
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2020-05-31 16:12:50 +00:00
# - remove --target x64 from build.sh line
2020-08-23 21:34:35 +00:00
# - add -Ddisable_arm32_neon=1 -Ddisable_arm_hw_aes=1 -Ddisable_arm_hw_sha1=1 -Ddisable_arm_hw_sha2=1 to build.sh
2019-09-04 00:29:18 +00:00
# - remove -march=armv8-a in AArch64 CFLAGS to not conflict with -march=armv8-a+crypto being added
pkgbase=nss
pkgname=(nss ca-certificates-mozilla)
2020-10-20 13:47:39 +00:00
pkgver=3.58
2020-08-22 21:25:16 +00:00
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-05-20 12:42:45 +00:00
depends=(nspr 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
2020-05-03 19:30:49 +00:00
0002-fix-armv8_c_lib-dependency.patch)
2020-10-20 13:47:39 +00:00
sha256sums=('9f73cf789b5f109b978e5239551b609b0cafa88d18f0bc8ce3f976cb629353c0'
2020-01-24 13:27:43 +00:00
'd2a1579dae05fd16175fac27ef08b54731ecefdf414085c610179afcf62b096c'
2020-01-25 01:21:27 +00:00
'3bfadf722da6773bdabdd25bdf78158648043d1b7e57615574f189a88ca865dd'
2020-07-29 14:56:55 +00:00
'4587713da0a82ac2a994f71c08f6b73a8fbba95e4373f39402f22f813fc4259e'
'1799db595ce8d8f7672731b4ccad2bf5e10d014e9b0032432e9cf0483c252c0a')
2019-09-04 00:29:18 +00:00
prepare() {
2019-10-03 23:12:29 +00:00
mkdir certs
2020-07-29 14:56:55 +00:00
ln -srt certs nss-$pkgver/nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h}
2019-09-04 00:29:18 +00:00
cd nss-$pkgver
2020-01-25 01:21:27 +00:00
cd nss
patch -p1 -i "${srcdir}"/0001-Don-t-USE_ARM_GCM.patch
2020-05-03 19:30:49 +00:00
patch -p1 -i "${srcdir}"/0002-fix-armv8_c_lib-dependency.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-05-31 16:12:50 +00:00
./build.sh \
--opt \
--system-sqlite \
--system-nspr \
--enable-libpkix \
--disable-tests \
-Ddisable_arm32_neon=1 \
2020-06-28 18:08:54 +00:00
-Ddisable_arm_hw_aes=1 \
2020-08-23 21:34:35 +00:00
-Ddisable_arm_hw_sha1=1 \
2020-06-28 18:08:54 +00:00
-Ddisable_arm_hw_sha2=1
2019-09-04 00:29:18 +00:00
}
package_nss() {
cd nss-$pkgver
2020-05-20 12:42:45 +00:00
local libdir=/usr/lib nsprver="$(pkg-config --modversion nspr)"
2019-09-04 00:29:18 +00:00
sed nss/pkg/pkg-config/nss.pc.in \
2020-05-20 12:42:45 +00:00
-e "s,%libdir%,$libdir,g" \
2019-09-04 00:29:18 +00:00
-e "s,%prefix%,/usr,g" \
-e "s,%exec_prefix%,/usr/bin,g" \
-e "s,%includedir%,/usr/include/nss,g" \
2020-05-20 12:42:45 +00:00
-e "s,%NSPR_VERSION%,$nsprver,g" \
2019-09-04 00:29:18 +00:00
-e "s,%NSS_VERSION%,$pkgver,g" |
2020-05-20 12:42:45 +00:00
install -Dm644 /dev/stdin "$pkgdir$libdir/pkgconfig/nss.pc"
ln -s nss.pc "$pkgdir$libdir/pkgconfig/mozilla-nss.pc"
2019-09-04 00:29:18 +00:00
2020-05-20 12:42:45 +00:00
install -Dt "$pkgdir$libdir" dist/Release/lib/*.so
install -Dt "$pkgdir$libdir" -m644 dist/Release/lib/*.chk
local vmajor vminor vpatch
{ read vmajor; read vminor; read vpatch; } \
< <(awk '/#define.*NSS_V(MAJOR|MINOR|PATCH)/ {print $3}' nss/lib/nss/nss.h)
2019-09-04 00:29:18 +00:00
sed nss/pkg/pkg-config/nss-config.in \
2020-05-20 12:42:45 +00:00
-e "s,@libdir@,$libdir,g" \
2019-09-04 00:29:18 +00:00
-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"
2020-05-20 12:42:45 +00:00
install -Dt "$pkgdir/usr/bin" \
dist/Release/bin/{*util,shlibsign,signtool,signver,ssltap}
2019-09-04 00:29:18 +00:00
2020-05-20 12:42:45 +00:00
install -Dt "$pkgdir/usr/include/nss" -m644 dist/public/nss/*.h
2019-09-04 00:29:18 +00:00
2020-05-20 12:42:45 +00:00
install -Dt "$pkgdir/usr/share/man/man1" -m644 \
nss/doc/nroff/{*util,signtool,signver,ssltap}.1
2019-09-04 00:29:18 +00:00
# Replace built-in trust with p11-kit connection
2020-05-20 12:42:45 +00:00
ln -s pkcs11/p11-kit-trust.so "$pkgdir$libdir/p11-kit-trust.so"
ln -sf p11-kit-trust.so "$pkgdir$libdir/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"
}
2020-05-31 16:12:50 +00:00
# vim:set sw=2 et: