summaryrefslogtreecommitdiff
path: root/libre/nss-static/PKGBUILD
blob: 4887f4f34a171408f2c1b8f2906fd8913ee7a5f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: Márcio Silva <coadde@parabola.nu>
# based of nss

pkgbase=nss
pkgname=nss-static
pkgver=3.23
pkgrel=3
pkgdesc="Mozilla Network Security Services (static libraries only)"
arch=(i686 x86_64 armv7h)
url="http://www.mozilla.org/projects/security/pki/nss/"
license=('MPL' 'GPL')
_nsprver=4.12
depends=('nspr-static' 'sqlite-static' 'p11-kit-static' 'nss')
makedepends=('perl' 'python2')
options=('!strip' '!makeflags' 'staticlibs')
source=("https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_${pkgver//./_}_RTM/src/${pkgbase}-${pkgver}.tar.gz"
        legacy-certs.patch)
sha256sums=('94b383e31c9671e9dfcca81084a8a813817e8f05a57f54533509b318d26e11cf'
            '5f793af9c8558324e4188163862e0e70a5b069a44ad9e7817e0767093739f2a0')

prepare() {
  mkdir certs

  cd nss-$pkgver

  # Still needed - Evolution (Camel) and Telepathy-Gabble (Wocky) use
  # their own validation which doesn't work with trusted intermediates
  patch nss/lib/ckfw/builtins/certdata.txt ../legacy-certs.patch

  # Respect LDFLAGS
  sed -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/' \
      -i nss/coreconf/rules.mk

  ln -sr nss/lib/ckfw/builtins/certdata.txt ../certs/
  ln -sr nss/lib/ckfw/builtins/nssckbi.h ../certs/
}


build() {
  cd nss-$pkgver/nss
  export BUILD_OPT=1
  export NSS_USE_SYSTEM_SQLITE=1
  export NSS_ENABLE_ECC=1
  export NSPR_INCLUDE_DIR="`nspr-config --includedir`"
  export NSPR_LIB_DIR="`nspr-config --libdir`"
  export XCFLAGS="${CFLAGS}"

  [ "$CARCH" = "x86_64" ] && export USE_64=1

  make -C coreconf
  make -C lib/dbm
  make
}

package() {
  cd nss-$pkgver
  install -d "$pkgdir"/usr/lib
  cd dist/*.OBJ/lib
  install -t "$pkgdir/usr/lib" lib{freebl,gtest,nss,nssdbm,nsssysinit,nssutil,smime,softokn,ssl}.a
  # list of static libraries are build:
  # certdb certhi crmf cryptohi dbm freebl gtest jar nss nssb nssckfw nssdbm nssdev nsspki nsssysinit nssutil
  # pk11wrap pkcs12 pkcs7 pkixcertsel pkixchecker pkixcrlsel pkixmodule pkixparams pkixpki pkixresults
  # pkixstore pkixsystem pkixtop pkixutil sectool smime softokn ssl
}