aboutsummaryrefslogtreecommitdiffstats
path: root/main/js/APKBUILD
blob: ec55fff25208cefab75fee8e6162d343496ca868 (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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=js
pkgver=1.8.5
_ver=${pkgver//./}-1.0.0
pkgrel=0
pkgdesc="JavaScript interpreter and libraries"
url="http://www.mozilla.org/js/"
arch="all"
license="GPLv2+ or LGPLv2+ or MPLv1.1"
depends=""
depends_dev="nspr-dev"
makedepends="$depends_dev zip readline-dev ncurses-dev python perl"
install=""
subpackages="$pkgname-dev"
source="http://ftp.mozilla.org/pub/mozilla.org/js/js$_ver.tar.gz
	js185-destdir.patch
	isfinite.patch"

_builddir="$srcdir"/js-1.8.5/js/src
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	# create pkg-config file
	cat > libjs.pc << EOF
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include

Name: libjs
Description: JS library
Requires: nspr >= 4.7
Version: $pkgver
Libs: -L\${libdir} -ljs
Cflags: -DXP_UNIX=1 -DJS_THREADSAFE=1 -I\${includedir}/js
EOF
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--with-system-nspr \
		--enable-threadsafe \
		--enable-readline \
		--disable-warnings-as-errors \
		|| return 1
	make
}

package() {
	cd "$_builddir"
	make install DESTDIR="$pkgdir" || return 1
	install -Dm 0644 libjs.pc "$pkgdir"/usr/lib/pkgconfig/
	# compat symlinks
	ln -s libmozjs185.so.1.0 "$pkgdir"/usr/lib/libmozjs.so.1
	ln -s libmozjs185.so.1.0 "$pkgdir"/usr/lib/libjs.so.1
	ln -s libmozjs185.so "$pkgdir"/usr/lib/libmozjs.so
	ln -s libmozjs185.so "$pkgdir"/usr/lib/libjs.so

}

md5sums="a4574365938222adca0a6bd33329cb32  js185-1.0.0.tar.gz
ca5cd660341767b60c09701f8dd6bf38  js185-destdir.patch
8f5db1b780888900c7fa8caec9c37275  isfinite.patch"