PKGBUILDs/core/nss/PKGBUILD

120 lines
3.7 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)
2022-08-20 17:20:58 +00:00
pkgver=3.82
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)
license=(MPL GPL)
2022-05-30 19:23:59 +00:00
depends=('nspr>=4.34' sqlite zlib sh 'p11-kit>=0.23.19')
2021-12-02 15:57:54 +00:00
makedepends=(perl python gyp mercurial)
2022-04-02 14:12:54 +00:00
options=(debug)
2022-08-20 17:20:58 +00:00
_revision=dba0f1c0f2388f75f345ba188cbb99cf04ded59f
2021-12-02 15:57:54 +00:00
source=("hg+https://hg.mozilla.org/projects/nss#revision=$_revision"
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)
2021-12-02 15:57:54 +00:00
sha256sums=('SKIP'
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
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() {
[[ $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
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() {
2021-12-02 15:57:54 +00:00
local nsprver="$(pkg-config --modversion nspr)"
local libdir=/usr/lib
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
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: