aboutsummaryrefslogtreecommitdiffstats
path: root/testing/quickjs/APKBUILD
blob: 9203091ce7c54a22496972ca654ea8520626456f (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
# Maintainer: Chloe Kudryavtsev <toast@toastin.space>
pkgname="quickjs"
_pkgver=2019-09-01
pkgver=0.${_pkgver//-}
pkgrel=0
pkgdesc="A small and embeddable Javascript engine"
url="https://bellard.org/quickjs/"
arch="all !s390x !ppc64le" # build segfaults on s390x and ppc64le
license="MIT"
options="!check" # disabled because bug/issue on builders
subpackages="$pkgname-doc $pkgname-static"
source="https://bellard.org/quickjs/quickjs-$_pkgver.tar.xz
	00-makefile.patch
	"
builddir="$srcdir/$pkgname-$_pkgver"

build() {
	make CONFIG_STATIC=y
	for bin in qjs qjsc qjsbn qjsbnc; do
		cp $bin $bin.static
	done
	make clean

	make
}

check() {
	make test
}

package() {
	make install prefix="$pkgdir"/usr
	for bin in qjs.static qjsc.static qjsbn.static qjsbnc.static; do
		install -Dm755 $bin "$pkgdir"/usr/bin/$bin
	done
	for doc in doc/*.html; do
		install -Dm644 $doc "$pkgdir"/usr/share/doc/quickjs/$doc
	done
}

static() {
	pkgdesc="$pkgdesc - static binaries"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/*.static "$subpkgdir"/usr/bin/
}

sha512sums="aaa2de18c36f4e49a81669d200e5b80decba05ebb3e4d08c3c602cdd57b7edfa682289c26b727a3533fbe783a884efba806e3a1be9f9d9fc5de9ff502634304c  quickjs-2019-09-01.tar.xz
7fb6e9fa9fdbe5967eaebd3530b4ea38bcea3d854746c52513d3ea8b4f01c25969e42e19e974b97da87f6d89d21aced3c548e34dfa7a809c2f8799c5d967fff6  00-makefile.patch"