diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-07-21 15:21:43 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-07-21 15:21:43 +0200 |
commit | d3528ce7e357d8a308c468766c3a3ee86ee57fab (patch) | |
tree | 1361db545dafccfa0e3bdb15c1529964985a0921 /community/moonscript/APKBUILD | |
parent | 47cf1297bc47024535a183b80220598d89cd127f (diff) | |
download | aports-d3528ce7e357d8a308c468766c3a3ee86ee57fab.tar.bz2 aports-d3528ce7e357d8a308c468766c3a3ee86ee57fab.tar.xz |
community/moonscript: move from testing
Diffstat (limited to 'community/moonscript/APKBUILD')
-rw-r--r-- | community/moonscript/APKBUILD | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/community/moonscript/APKBUILD b/community/moonscript/APKBUILD new file mode 100644 index 0000000000..0525f9dc47 --- /dev/null +++ b/community/moonscript/APKBUILD @@ -0,0 +1,76 @@ +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> +pkgname=moonscript +pkgver=0.5.0 +pkgrel=0 +pkgdesc="A language that compiles to Lua" +url="http://moonscript.org" +arch="noarch" +license="MIT" +depends="lua-alt-getopt lua-filesystem lua-lpeg" +checkdepends="lua-busted lua-loadkit" +makedepends="luarocks" +subpackages="" +source="$pkgname-$pkgver.tar.gz::https://github.com/leafo/$pkgname/archive/v$pkgver.tar.gz" +builddir="$srcdir/$pkgname-$pkgver" + +# luajit is not available for s390x +case "$CARCH" in + s390x) _luajit="";; + *) checkdepends="$checkdepends luajit" _luajit="jit";; +esac + +_luaversions="5.1 5.2 5.3" +for _v in $_luaversions; do + subpackages="$subpackages lua$_v-$pkgname:_subpackage" + checkdepends="$checkdepends lua$_v" +done + +prepare() { + default_prepare + + cd "$builddir" + local lver; for lver in $_luaversions; do + local name; for name in moon moonc; do + sed "s|^#!/usr/bin/env lua|#!/usr/bin/lua$lver|" \ + bin/$name > bin/$name-$lver + done + done +} + +check() { + cd "$builddir" + + local lver; for lver in $_luaversions $_luajit; do + msg "Testing on lua$lver" + lua$lver /usr/bin/busted + done +} + +package() { + cd "$builddir" + + local name; for name in moon moonc; do + install -D -m 755 bin/$name "$pkgdir"/usr/bin/$name + done +} + +_subpackage() { + local lver="${subpkgname:3:3}" + pkgdesc="$pkgdesc (for Lua $lver)" + depends="lua$lver ${depends//lua-/lua$lver-}" + install_if="$pkgname=$pkgver-r$pkgrel lua$lver" + local lmod_dir="$subpkgdir/usr/share/lua/$lver" + + cd "$builddir" + + mkdir -p "$lmod_dir" + cp -r moon moonscript moon.lua moonscript.lua "$lmod_dir"/ + find "$lmod_dir" -name "*.moon" -delete + + local name; for name in moon moonc; do + install -D -m 755 bin/$name-$lver "$subpkgdir"/usr/bin/$name-$lver + done +} + +sha512sums="f573f9a96502662987de637f7f62b935fab93aa775122c9ae20d98029394e3136e6b519908ce76e1e77c51fbcee162c3ad0aa58eeb1ee56a2b07951437987941 moonscript-0.5.0.tar.gz" |