summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 31bb0572bbe40e2ec22095dd5b9f81b6be5a038f (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
# $Id$
# Maintainer: Franziskus Kiefer <franziskuskiefer@gmail.com>

_pkgname=nspr
pkgname=nspr-hg
# TODO: read version from source
pkgver=4.26
pkgrel=1
pkgdesc="Netscape Portable Runtime"
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR"
arch=(x86_64)
license=(MPL GPL)
depends=(glibc sh)
makedepends=(zip)
source=("hg+https://hg.mozilla.org/projects/nspr")
sha256sums=('SKIP')
conflicts=('nspr')
provides=("nspr=${pkgver}")

prepare() {
  cd $_pkgname
}

build() {
  cd $_pkgname
  tag=$(hg id https://hg.mozilla.org/projects/nspr#default)
  hg up $tag
  ./configure \
      --prefix=/usr \
      --libdir=/usr/lib \
      --includedir=/usr/include/nspr \
      --enable-optimize \
      --disable-debug \
      $([[ $CARCH == x86_64 ]] && echo --enable-64bit)
  make ${SOURCE_DATE_EPOCH:+
    SH_NOW="${SOURCE_DATE_EPOCH}000000"
    SH_DATE="$(date --utc --date="@$SOURCE_DATE_EPOCH" '+%Y-%m-%d %T')"
  }
}

package() {
  cd $_pkgname
  make DESTDIR="$pkgdir" install
  ln -s nspr.pc "$pkgdir/usr/lib/pkgconfig/mozilla-nspr.pc"
  rm -r "$pkgdir"/usr/bin/{compile-et.pl,prerr.properties} \
        "$pkgdir"/usr/include/nspr/md
}