aboutsummaryrefslogblamecommitdiffstats
path: root/main/lua-evdev/APKBUILD
blob: 14b62fae26ff047985d9f32269ba4e6a7b818f59 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                   
                          
                 
               
            
        

                                             
          

             

                           


                                                                  
    

                                                                                                     
 
           



                                                               
            


         




                                                                                   
            


           
                          

 


                                          

                                                       
                                                                                    
 
                            
 



                                                                             


                                                            
 
 
                                                                                                                                                                     
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=lua-evdev
_rockname=evdev
pkgver=2.2.1
pkgrel=1
pkgdesc="Lua module for reading input events"
url="https://github.com/Tangent128/lua-evdev"
arch="all"
license="MIT"
depends=""
makedepends="linux-headers"
subpackages=""
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
done
source="$pkgname-$pkgver.tar.gz::https://github.com/Tangent128/$pkgname/archive/evdev-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-evdev-$pkgver"

prepare() {
	default_prepare || return 1

	local lver; for lver in $_luaversions; do
		cp -r "$builddir" "$builddir-$lver" || return 1
	done
}

build() {
	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() {
	mkdir -p "$pkgdir"
}

_package() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc (for Lua $lver)"
	depends="$depends lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_rockname/$pkgver-1"

	cd "$builddir-$lver"

	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

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="6d8bfb148013c780f7276c884e297b7d6ea55c0c257ac074c677b0dc6495a6087e0e1cb671d844b22d13c9a4c19c544d22a10f3ded5ad3580ccce33c74690871  lua-evdev-2.2.1.tar.gz"