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
|
2023-07-02 03:03:46 +00:00
|
|
|
pkgname=(
|
|
|
|
nss
|
|
|
|
ca-certificates-mozilla
|
|
|
|
)
|
|
|
|
pkgver=3.91
|
2021-12-02 15:57:54 +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)
|
2023-02-14 12:47:23 +00:00
|
|
|
license=(
|
|
|
|
GPL
|
|
|
|
MPL
|
|
|
|
)
|
|
|
|
depends=(
|
|
|
|
'nspr>=4.35'
|
|
|
|
'p11-kit>=0.23.19'
|
|
|
|
sqlite
|
|
|
|
zlib
|
2023-07-02 03:03:46 +00:00
|
|
|
|
|
|
|
sh # nss-config script
|
2023-02-14 12:47:23 +00:00
|
|
|
)
|
|
|
|
makedepends=(
|
|
|
|
gyp
|
|
|
|
mercurial
|
|
|
|
perl
|
|
|
|
python
|
|
|
|
)
|
2023-07-02 03:03:46 +00:00
|
|
|
_revision=b7888f994479307ea70bfbd5c2b1bb4cd6c36a55
|
2023-02-14 12:47:23 +00:00
|
|
|
source=(
|
|
|
|
"hg+https://hg.mozilla.org/projects/nss#revision=$_revision"
|
|
|
|
bundle.sh
|
|
|
|
certdata2pem.py
|
|
|
|
0001-Don-t-USE_ARM_GCM.patch
|
|
|
|
0002-fix-armv8_c_lib-dependency.patch
|
|
|
|
)
|
|
|
|
b2sums=('SKIP'
|
|
|
|
'4be5dd836c844fdd7b63302a6994d62149082c3bc81eef70f373f416fed80a61a923960e4390d1c391b81ab01b409370d788818a30ffdd3a4ed467b670f990f6'
|
|
|
|
'6bb59dcc9289916dcbf8fb6d73db0c0cd7582dc12a3aa4e8be19ec62c9ede65fdd9470a2d92ec5a114506b78d2d21b8ae0a1b45a17dc1f90f7d75434a93da510'
|
|
|
|
'8e442a1844012fafad9750631114167a842f32eba413380b1d9ca11b16c1c0e43b6b73d22280e6a55b5133e181530c8377cf6e030e5f8f2a842fa1c24b9aaeb6'
|
|
|
|
'670ed1e0223f23f88d5f7d9ae7a3a24ac31a19396e3a1cedb89bf87d8ce32afbad74bc7fb76e234c8f47d28ddb4fcd7386a1f7e78196c4fb03cff200ebbe985d')
|
2019-09-04 00:29:18 +00:00
|
|
|
|
2021-12-02 15:57:54 +00:00
|
|
|
pkgver() {
|
|
|
|
cd nss
|
2022-03-05 16:39:10 +00:00
|
|
|
hg id -t -r. | sed 's/^NSS_//;s/_RTM$//;s/_/./g'
|
2021-12-02 15:57:54 +00:00
|
|
|
}
|
2020-11-04 14:54:28 +00:00
|
|
|
|
2021-12-02 15:57:54 +00:00
|
|
|
prepare() {
|
|
|
|
mkdir -p certs
|
|
|
|
ln -srft certs nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h}
|
2019-09-04 00:29:18 +00:00
|
|
|
|
2021-12-02 15:57:54 +00:00
|
|
|
cd nss
|
2020-01-25 01:21:27 +00:00
|
|
|
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() {
|
2023-05-07 14:12:31 +00:00
|
|
|
local buildsh_options=(
|
|
|
|
--disable-tests
|
|
|
|
--enable-libpkix
|
|
|
|
--opt
|
|
|
|
--system-nspr
|
|
|
|
--system-sqlite
|
|
|
|
-Ddisable_arm32_neon=1
|
|
|
|
-Ddisable_arm_hw_aes=1
|
|
|
|
-Ddisable_arm_hw_sha1=1
|
|
|
|
-Ddisable_arm_hw_sha2=1
|
|
|
|
)
|
2019-09-04 00:29:18 +00:00
|
|
|
[[ $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
|
|
|
|
2021-12-02 15:57:54 +00:00
|
|
|
cd nss
|
2023-05-07 14:12:31 +00:00
|
|
|
./build.sh "${buildsh_options[@]}"
|
2019-09-04 00:29:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_nss() {
|
2021-12-02 15:57:54 +00:00
|
|
|
local nsprver="$(pkg-config --modversion nspr)"
|
2023-05-07 14:12:31 +00:00
|
|
|
local libdir=/usr/lib includedir=/usr/include/nss
|
2019-09-04 00:29:18 +00:00
|
|
|
|
|
|
|
sed nss/pkg/pkg-config/nss.pc.in \
|
|
|
|
-e "s,%prefix%,/usr,g" \
|
2023-05-07 14:12:31 +00:00
|
|
|
-e "s,%exec_prefix%,\${prefix},g" \
|
|
|
|
-e "s,%libdir%,$libdir,g" \
|
|
|
|
-e "s,%includedir%,$includedir,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
|
|
|
|
|
|
|
|
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 \
|
2023-05-07 14:12:31 +00:00
|
|
|
-e "s,@prefix@,/usr,g" \
|
|
|
|
-e "s,@exec_prefix@,/usr,g" \
|
2020-05-20 12:42:45 +00:00
|
|
|
-e "s,@libdir@,$libdir,g" \
|
2023-05-07 14:12:31 +00:00
|
|
|
-e "s,@includedir@,$includedir,g" \
|
2019-09-04 00:29:18 +00:00
|
|
|
-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
|
|
|
|
2023-05-07 14:12:31 +00:00
|
|
|
install -Dt "$pkgdir$includedir" -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
|
|
|
|
2023-03-12 17:57:26 +00:00
|
|
|
# vim:set sw=2 sts=-1 et:
|