APKBUILD examples:Lua: Difference between revisions

From Alpine Linux
(minor updates)
(Add rock_manifest)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Module with Makefile supporting multiple Lua versions ==


This needs to receive LUA APKBUILD data , oh yeah
<pre>
pkgname=lua-foo
_rockname=${pkgname#lua-}
...
arch="all"
depends=""
makedepends=""
subpackages=""
...


== private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm ==
_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
makedepends="$makedepends lua$_v-dev"
subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done


Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm
build() {
cd "$builddir"


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
local lver; for lver in $_luaversions; do
msg "Building for Lua $lver..."
make all$lver
done
}


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
package() {
mkdir -p "$pkgdir"
}


== private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm ==
_subpackage() {
local lver="${subpkgname:3:3}"
pkgdesc="$pkgdesc (for Lua $lver)"
depends="lua$lver"
install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_rockname/$pkgver-0"


Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm
cd "$builddir"
make PREFIX="/usr" DESTDIR="$subpkgdir" install$lver


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
mkdir -p "$rockdir"
echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}
</pre>


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
== Module with simple Makefile ==


== private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm ==
<pre>
pkgname=lua-foo
_rockname=${pkgname#lua-}
...
arch="all"
depends=""
makedepends=""
subpackages=""
...


Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm
_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
makedepends="$makedepends lua$_v-dev"
subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
prepare() {
default_prepare


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
local lver; for lver in $_luaversions; do
cp -r "$builddir" "$builddir-$lver"
done
}


== private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm ==
build() {
local lver; for lver in $_luaversions; do
msg "Building for Lua $lver..."
make -C "$builddir-$lver"
done
}


Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm
package() {
mkdir -p "$pkgdir"
}


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
_subpackage() {
local lver="${subpkgname:3:3}"
pkgdesc="$pkgdesc (for Lua $lver)"
depends="lua$lver"
install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_rockname/$pkgver-0"


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
cd "$builddir-$lver"
make PREFIX="/usr" DESTDIR="$subpkgdir" install


== private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm ==
mkdir -p "$rockdir"
echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}
</pre>


Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm
== Module with rockspec ==


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
<pre>
pkgname=lua-foo
_rockname=${pkgname#lua-}
...
arch="all"
depends=""
makedepends=""
subpackages=""
...


[[http://ultra-high-end.com/custom-made.html private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]]
_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
makedepends="$makedepends lua$_v-dev luarocks$_v"
subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done
 
build() {
cd "$builddir"
 
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 $_rockname-$pkgver-0.rockspec
done
}
 
package() {
mkdir -p "$pkgdir"
}
 
_subpackage() {
local lver="${subpkgname:3:3}"
pkgdesc="$pkgdesc (for Lua $lver)"
depends="lua$lver"
install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_rockname/$pkgver-0"
 
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
}
</pre>
 
[[Category:Development]]
[[Category:Lua]]

Latest revision as of 12:33, 29 December 2017

Module with Makefile supporting multiple Lua versions

pkgname=lua-foo
_rockname=${pkgname#lua-}
...
arch="all"
depends=""
makedepends=""
subpackages=""
...

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done

build() {
	cd "$builddir"

	local lver; for lver in $_luaversions; do
		msg "Building for Lua $lver..."
		make all$lver
	done
}

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

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

	cd "$builddir"
	make PREFIX="/usr" DESTDIR="$subpkgdir" install$lver

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

Module with simple Makefile

pkgname=lua-foo
_rockname=${pkgname#lua-}
...
arch="all"
depends=""
makedepends=""
subpackages=""
...

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done

prepare() {
	default_prepare

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

build() {
	local lver; for lver in $_luaversions; do
		msg "Building for Lua $lver..."
		make -C "$builddir-$lver"
	done
}

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

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

	cd "$builddir-$lver"
	make PREFIX="/usr" DESTDIR="$subpkgdir" install

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

Module with rockspec

pkgname=lua-foo
_rockname=${pkgname#lua-}
...
arch="all"
depends=""
makedepends=""
subpackages=""
...

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev luarocks$_v"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done

build() {
	cd "$builddir"

	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 $_rockname-$pkgver-0.rockspec
	done
}

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

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

	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
}