summaryrefslogtreecommitdiff
path: root/system/nspr/APKBUILD
blob: 9700b0491149664fb425fb050429920f2ddbceec (plain) (blame)
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
65
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=nspr
pkgver=4.21
pkgrel=0
pkgdesc="Netscape Portable Runtime"
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR"
arch="all"
options="!check"  # No test suite.
license="MPL-1.1 AND GPL-2.0-only AND LGPL-2.1-only"
depends=""
# -dev package does not ship any symlinks so dependency cannot be autodetected
depends_dev="nspr"
makedepends="autoconf automake"
subpackages="$pkgname-dev"
source="https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$pkgver/src/nspr-$pkgver.tar.gz
	fix-getproto.patch
	stacksize.patch
	"

prepare() {
	mkdir build inst
	default_prepare
}

build() {
	local conf=
	case "$CARCH" in
		*64* | s390x) conf="--enable-64bit";;
	esac
	cd "$builddir"/build
	# ./nspr/pr/include/md/_linux.h tests only __GLIBC__ version
	# to detect c-library features, list musl features here for now.
	CFLAGS="$CFLAGS -D_PR_POLL_AVAILABLE -D_PR_HAVE_OFF64_T -D_PR_INET6 -D_PR_HAVE_INET_NTOP -D_PR_HAVE_GETHOSTBYNAME2 -D_PR_HAVE_GETADDRINFO -D_PR_INET6_PROBE" \
	../nspr/configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-debug \
		--enable-optimize \
		--enable-ipv6 \
		$conf
	make CC="${CC:-gcc}" CXX="${CXX:-g++}"
}

package() {
	local file=

	cd "$builddir"/build
	make DESTDIR="$pkgdir" install

	cd "$pkgdir"/usr/lib
	rm -f *.a

	cd "$builddir"/build/config
	install -Dm755 nspr-config "$pkgdir"/usr/bin/nspr-config
	install -Dm644 nspr.pc "$pkgdir"/usr/lib/pkgconfig/nspr.pc
	rm -rf "$pkgdir"/usr/bin/prerr.properties \
		"$pkgdir"/usr/bin/compile-et.pl \
		"$pkgdir"/usr/share/aclocal/nspr.m4 \
		"$pkgdir"/usr/include/nspr/md
}

sha512sums="4f152c6ca32d9dd4cf3d92b4b54f249ac1fa39047811f7c0c7a67bdc73173cf7de0dce36dc278ad781189ea2fdc71fa70e044597676a8b1f5e6d664907e5ab7c  nspr-4.21.tar.gz
ee654f609a90b9a95c1901ad1d56cdef7cce8bca9efc092198607944f142f8fec924b13219ca6663facd0f0d59b671b8b3de58ab3449c4c863d42e2937f02184  fix-getproto.patch
1f694fc151f6578080449e3aa999c520486bbe117b8237150966ec43092db4156e81412ac889045e0c0c3bf65d459af5bdc1cf19c9fa3dab120405a60732f15a  stacksize.patch"