aboutsummaryrefslogblamecommitdiffstats
path: root/community/lua-compat53/APKBUILD
blob: 103b61a6e8be2a558d7c149f0989ef5751684ead (plain) (tree)
1
2
3
4
5
6
7
8
9
10



                                               
                  
                       

          

                                                                   
          











                                                                                                    


















                                                                                   

                                                       
                                                                                    


                                                                 
                                                                  
            


                                                            

 
                                                                                                                                                                      
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
_luaversions="5.1 5.2 5.3"
pkgname=lua-compat53
_rockname=compat53
_pkgname=lua-compat-5.3
pkgver=0.7
pkgrel=0
pkgdesc="Compatibility module providing Lua-5.3-style APIs for Lua"
url="https://github.com/keplerproject/lua-compat-5.3"
arch="all"
license="MIT"
depends=""
makedepends=""
subpackages=""
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev luarocks$_v"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
done
source="$pkgname-$pkgver.tar.gz::https://github.com/keplerproject/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	local lver; for lver in $_luaversions; do
		msg "Building for Lua $lver..."

		luarocks-$lver \
			CC="$CC" \
			CFLAGS="$CFLAGS -fPIC" \
			LUA_INCDIR="$(pkg-config --variable=includedir lua$lver)" \
			LUA_LIBDIR="$(pkg-config --variable=libdir lua$lver)" \
			make --tree=./build rockspecs/compat53-scm-0.rockspec
	done
}

package() {
	mkdir -p "$pkgdir"
}

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

	local path; for path in lib/lua/$lver share/lua/$lver; do
		mkdir -p "$subpkgdir"/usr/${path%/*}
		mv "$builddir"/build/$path "$subpkgdir"/usr/$path/
	done

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

sha512sums="665ece98422a105b818cffd96eea5788696fbb854d2ba41d2d387e8bd25c1fa9de601468e55e22e9e749979a66d4d2e0f7dfd656e5bf27b489d37bb07c96f48d  lua-compat53-0.7.tar.gz"