aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-02 12:28:23 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-02 12:29:55 +0200
commit42bca71946061ee3bc545e63b2e3cbc74ad99c3a (patch)
tree3313704bf0527388f2ac9c6629b91bd2d9a8cf6f /main
parent9bb8646b1702893485030bd32e2e57efbc21c55a (diff)
downloadaports-42bca71946061ee3bc545e63b2e3cbc74ad99c3a.tar.bz2
aports-42bca71946061ee3bc545e63b2e3cbc74ad99c3a.tar.xz
main/lua-evdev: simplify abuild
Diffstat (limited to 'main')
-rw-r--r--main/lua-evdev/APKBUILD68
1 files changed, 28 insertions, 40 deletions
diff --git a/main/lua-evdev/APKBUILD b/main/lua-evdev/APKBUILD
index 766165e0be..50183bf4eb 100644
--- a/main/lua-evdev/APKBUILD
+++ b/main/lua-evdev/APKBUILD
@@ -5,65 +5,53 @@ pkgver=2.2.1
pkgrel=0
pkgdesc="Lua module for reading input events"
url="https://github.com/Tangent128/lua-evdev"
-arch="all"
+arch="noarch"
license="MIT"
depends=""
-install=""
makedepends="linux-headers"
subpackages=""
-for _i in $_luaversions; do
- makedepends="$makedepends lua$_i-dev"
- subpackages="$subpackages lua$_i-evdev:split_${_i/./_}"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
done
-source="lua-evdev-$pkgver.tar.gz::https://github.com/Tangent128/lua-evdev/archive/evdev-$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/Tangent128/$pkgname/archive/evdev-$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-evdev-$pkgver"
-_sdir="$srcdir"/lua-evdev-evdev-$pkgver
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
- for _v in $_luaversions; do
- cp -r "$_sdir" "$srcdir"/build-$_v
+ default_prepare || return 1
+
+ local lver; for lver in $_luaversions; do
+ cp -r "$builddir" "$builddir-$lver" || return 1
done
}
build() {
- for _v in $_luaversions; do
- cd "$srcdir"/build-$_v
- make MYCFLAGS="$CFLAGS $(pkg-config --cflags lua$_v)" || return 1
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+
+ cd "$builddir-$lver"
+ make MYCFLAGS="$CFLAGS $(pkg-config --cflags lua$lver)" || return 1
done
}
package() {
- for _v in $_luaversions; do
- cd "$srcdir"/build-$_v
- for i in evdev.lua evdev/constants.lua; do
- install -D $i "$pkgdir"/usr/share/lua/$_v/$i || return 1
- done
- for i in evdev/core.so; do
- install -D $i "$pkgdir"/usr/lib/lua/$_v/$i || return 1
- done
- done
+ mkdir -p "$pkgdir"
}
-_split() {
- local _ver=$1
- pkgdesc="$pkgdesc - Lua $_ver"
- depends=""
- install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
+_package() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ arch="all"
+ depends="$depends lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
- mkdir -p "$subpkgdir"/usr/share/lua "$subpkgdir"/usr/lib/lua
- mv "$pkgdir"/usr/share/lua/$_ver "$subpkgdir"/usr/share/lua
- mv "$pkgdir"/usr/lib/lua/$_ver "$subpkgdir"/usr/lib/lua
-}
+ cd "$builddir-$lver"
-for _i in $_luaversions; do
- eval "split_${_i/./_}() { _split $_i; }"
-done
+ local f; for f in evdev.lua evdev/constants.lua; do
+ install -D $f "$subpkgdir"/usr/share/lua/$lver/$f || return 1
+ done
+ install -D evdev/core.so "$subpkgdir"/usr/lib/lua/$lver/evdev/core.so
+}
md5sums="8db10a3079bda7acd20046e0793df678 lua-evdev-2.2.1.tar.gz"
sha256sums="8ccec638250a839e8567f55e5c61982396ec81f9e339dbf36ee809cb5375c0ae lua-evdev-2.2.1.tar.gz"