aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-evdev/APKBUILD
blob: 6de00726f6f71b0f06b550d33db90f18d7eace59 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-evdev
pkgver=1.2
pkgrel=0
pkgdesc="Lua module for reading input events"
url="https://github.com/Tangent128/lua-evdev"
arch="all"
license="MIT"
depends=""
depends_dev=""
makedepends="$depends_dev lua5.2-dev linux-headers"
install=""
subpackages="lua5.2-evdev:_split52"
source="lua-evdev-$pkgver.tar.gz::https://github.com/Tangent128/lua-evdev/archive/evdev-$pkgver.tar.gz
	cflags.patch"

_builddir="$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
}

build() {
	cd "$_builddir"
	make CFLAGS="$CFLAGS $(pkg-config --cflags lua5.2)" || return 1
}

package() {
	cd "$_builddir"
	local _v=5.2
	rm -f "$pkgdir"/usr/lib/*.la
	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
}

_split52() {
	pkgdesc="$pkgdesc - Lua 5.2"
	depends=""
	mkdir -p "$subpkgdir"
	mv "$pkgdir"/usr "$subpkgdir"/
}


md5sums="9781899b15890f6930b0df1bbf01da89  lua-evdev-1.2.tar.gz
b1c0f7d2c7212219e98ec40045a4c848  cflags.patch"
sha256sums="5026db512a5c0c68b8a15a36736aca0fe432a1825bff6e796cb272d78437b76a  lua-evdev-1.2.tar.gz
20042880b39a3a7bd04a3ee3df00f9df1bde507fc2a902835023fee8e67bc680  cflags.patch"
sha512sums="9d2ae229129ad806e9c854e4089acf747bb35bd1f9c21d160850afc277206aada61564df296a45f8a27e993f4118a8ff6bd5805cbd9ae7e09110153c59db4e72  lua-evdev-1.2.tar.gz
2804adb8a07ec9ba1e7c139e7db26cf3bb809058cab4b09e52344d3e351c22923c08ae3c51d4883bbef2167ea3497addce13c4ed2c2f3e1e68b23f8bdf6c83d6  cflags.patch"