blob: bd7d46751943a59948926d430e2ee608e9de47c9 (
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
77
78
79
80
81
82
|
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lowjs
pkgver=1.4.2
_gitrev_open62541="9f1cbfa96fd050220c86d3e5939d88cab1b680ce"
_gitrev_duktape="44ca54f726bfa651a7ab59286dd5c371dba2ddfc"
pkgrel=1
pkgdesc="A port of Node.JS with far lower system requirements"
url="https://www.neonious.com/lowjs/"
arch="all !s390x !ppc64le" # excluded archs are not supported
license="custom"
makedepends="c-ares-dev cmake jq mbedtls-dev npm python2 py2-pip"
subpackages="$pkgname-doc"
source="https://github.com/neonious/lowjs/archive/v$pkgver/$pkgname-$pkgver.tar.gz
https://github.com/neonious/open62541/archive/$_gitrev_open62541/open62541-$_gitrev_open62541.tar.gz
https://github.com/svaarala/duktape/archive/$_gitrev_duktape/duktape-$_gitrev_duktape.tar.gz
use-npm-ci.patch
lib-path.patch
open62541-gcc9.patch
unbundle-c-ares.patch
unbundle-mbedtls.patch
make-flags.patch
test.js
"
builddir="$srcdir/$pkgname-$pkgver"
prepare() {
cd "$builddir"
rm -Rf deps/open62541
mv ../open62541-$_gitrev_open62541 deps/open62541
rm -Rf deps/duktape
mv ../duktape-$_gitrev_duktape deps/duktape
pip2 install --user pyyaml
default_prepare
}
build() {
local resp=$(curl -fsSL https://api.github.com/repos/neonious/lowjs/commits/v$pkgver)
local commit_sha=$(echo "$resp" | jq -r '.sha | .[0:10]')
local commit_date=$(echo "$resp" | jq -r '.commit.committer.date | .[0:4]+.[5:7]+.[8:10]')
[ "$commit_sha" ] && [ "$commit_date" ] || { eerror "Failed to get commit SHA or date"; return 1; }
unset LDFLAGS # fails to build with -Wl,--as-needed
make -j1 \
LOW_LIB_PATH="../lib/low/" \
LOW_VERSION="${commit_date}_${commit_sha}"
}
check() {
# XXX: See https://github.com/neonious/lowjs/issues/81
#( cd test/tests_script && npm ci )
#npm run test -- run
test -L lib/low || ln -s . lib/low
./bin/low "$srcdir"/test.js
rm lib/low
}
package() {
install -d "$pkgdir"/usr/lib/low
cp -r lib/* "$pkgdir"/usr/lib/low/
rm "$pkgdir"/usr/lib/low/BUILT
install -D -m 0755 bin/low "$pkgdir"/usr/bin/low
install -D -m 0644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
sha512sums="fa7f41eb7753060a0c613301f2ce12622c12521a668d65f2d6198b1489b5542b9bf7cd2c1c2946eaa92e1ed9b852c8cd7d4316a1775b0a89eb428bdf2e11484d lowjs-1.4.2.tar.gz
7c71ff0ce8cda56e4a4cc8e416172fd847f7289d45c4e44e54e56f3081b914d9401c86341ae3d0a4bccd7b6e9c3b274c92892e67e3cd300824bf900cd9f02ac1 open62541-9f1cbfa96fd050220c86d3e5939d88cab1b680ce.tar.gz
e7f4eaf3f5cb8c791a25c9a1a213953423c6e063d7e3049ccab70fee977bfb4949e23aed50d9720539b798dc9d2e65227bca165ad4faa04797318492b4f06cfc duktape-44ca54f726bfa651a7ab59286dd5c371dba2ddfc.tar.gz
b8aecec6aa87eb2ab7ffecaca1989f922042ee534612229872bad10bc0e304951cb66a1d1aa3ba4e76384ca2ea28b8c5b7176eacf6b7df3d59ea7435b7894a48 use-npm-ci.patch
f1ce54e839160f559b31d588cc61b068b28e7844d4f6987f17396d7dfee8417ae861896742c746131c25686204c729f305610644c5526963622c4a8bc5517b41 lib-path.patch
c2c7f10d327d2e56d2824db02c647c05773c652179f40eff7b376dfbf7eecd72b7d07c18458d59fd195993b261cb9a48e9f521ccb1a519807270c036ed8d5746 open62541-gcc9.patch
a0ff4c6ad0891be0d8246cd2cddd7d6015d948778ec52e49fcd1eb8da53c2b7f861b3d38e52f3bf7ec1ad6c2cdba35657cee7dddeb1e7e77e9430995cce23291 unbundle-c-ares.patch
d90f1f16390530cc328804f8232f821217a705e12e8d3cd47b787f779ec2f9cafbb7416c05d8d8ed96cc71e52bd86deee8deffded80ee297c50735998b9af70e unbundle-mbedtls.patch
577653248d6e80cf7065f2b763355bdd1a24853821643a4b14e768e32ae8b88db08ad9820549a7cf49ea1462d0d920a5008fd158a35afebdde5784b48e51718c make-flags.patch
9ee7d585c9ce17ca00e86e0f74976883fa14e70f3728cf230256f2570dafdaa3adeae1922de5f0dcb74bba8577f9394c54441bc3729c1bb58bb6a298c26651d0 test.js"
|