aboutsummaryrefslogtreecommitdiffstats
path: root/main/nspr/APKBUILD
blob: 4974f0b86b80cf50f0ee546dee096fcb9b936b1c (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
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nspr
pkgver=4.10.8
pkgrel=1
pkgdesc="Netscape Portable Runtime"
url="http://www.mozilla.org/projects/nspr/"
arch="all"
license="MPL-1.1 GPL-2 LGPL-2.1"
depends=
# -dev package does not ship any symlinks so dependency cannot be autodetected
depends_dev="nspr"
makedepends="autoconf automake sed"
subpackages="$pkgname-dev"
source="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$pkgver/src/nspr-$pkgver.tar.gz
	fix-getproto.patch
	"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	mkdir build inst
	for i in $source; do
		case $i in
		*.patch)
			msg "Applying $i"
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done
}

build() {
	local conf=
	if [ "$CARCH" = "x86_64" ];then
		conf="--enable-64bit"
	fi
	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 \
		|| return 1
	make CC="${CC:-gcc}" CXX="${CXX:-g++}" || return 1
}

package() {
	local file=

	cd "$_builddir"/build
	make DESTDIR="$pkgdir" install || return 1

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

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

md5sums="8d7c5bd0a5b0a7d0e705be66479030a0  nspr-4.10.8.tar.gz
c417cf87161ee2d12c5c1c772c94cc38  fix-getproto.patch"
sha256sums="507ea57c525c0c524dae4857a642b4ef5c9d795518754c7f83422d22fe544a15  nspr-4.10.8.tar.gz
46bf377b7e19f8450b81366905237630a85691a55fccddb355b2f55d60e8b4a6  fix-getproto.patch"
sha512sums="f14e3bd46cd1dee9d7163adbf3b09a450ea8c6c65499c5b6696eba7e85b6b12d3f90561a1dfe0dc0dc5fe1b14758b4191e546d9f0e29a66f33c69dd6ed6f50d9  nspr-4.10.8.tar.gz
197f0e644bf402ee9cf1c621a0daf3426659ca05610aa7b6d8bed3d81f1d1c77c0a81ef35a92fa42b271c7f814d718ec1d1b61f5f4b554b3735142903b70e32b  fix-getproto.patch"