diff --git a/srcpkgs/luarocks-lua51 b/srcpkgs/luarocks-lua51 new file mode 120000 index 00000000000..9c289adc714 --- /dev/null +++ b/srcpkgs/luarocks-lua51 @@ -0,0 +1 @@ +luarocks \ No newline at end of file diff --git a/srcpkgs/luarocks-lua51/template b/srcpkgs/luarocks-lua51/template deleted file mode 100644 index e755046cfab..00000000000 --- a/srcpkgs/luarocks-lua51/template +++ /dev/null @@ -1,39 +0,0 @@ -# Template file for 'luarocks-lua51' -pkgname=luarocks-lua51 -version=2.4.4 -revision=2 -archs=noarch -wrksrc="${pkgname%-*}-${version}" -build_style=configure -configure_args=" - --prefix=/usr - --sysconfdir=/etc/luarocks - --lua-version=5.1 - --lua-suffix=5.1 - --with-lua-include=/usr/include/lua5.1 - --with-downloader=curl - --versioned-rocks-dir" -hostmakedepends="lua51-devel" -depends="lua51 curl unzip" -conf_files="/etc/luarocks/config-5.1.lua" -short_desc="Package management for Lua modules - Lua 5.1" -maintainer="Duncaen " -license="MIT" -homepage="http://luarocks.org/" -distfiles="http://luarocks.org/releases/luarocks-${version}.tar.gz" -checksum="3938df33de33752ff2c526e604410af3dceb4b7ff06a770bc4a240de80a1f934" - -alternatives=" - luarocks:luarocks:/usr/bin/luarocks-5.1 - luarocks:luarocks-admin:/usr/bin/luarocks-admin-5.1" - -pre_configure() { - sed -i -e '/unzip/d' configure -} -pre_install() { - sed -i -e 's;env lua;env lua5.1;g' src/bin/luarocks{,-admin} -} -post_install() { - vlicense COPYING - rm -rfv ${DESTDIR}/usr/bin/luarocks{,-admin} -} diff --git a/srcpkgs/luarocks-lua52 b/srcpkgs/luarocks-lua52 new file mode 120000 index 00000000000..9c289adc714 --- /dev/null +++ b/srcpkgs/luarocks-lua52 @@ -0,0 +1 @@ +luarocks \ No newline at end of file diff --git a/srcpkgs/luarocks-lua52/template b/srcpkgs/luarocks-lua52/template deleted file mode 100644 index 7e15370ada4..00000000000 --- a/srcpkgs/luarocks-lua52/template +++ /dev/null @@ -1,40 +0,0 @@ -# Template file for 'luarocks-lua52' -pkgname=luarocks-lua52 -version=2.4.4 -revision=1 -archs=noarch -wrksrc="${pkgname%-*}-${version}" -build_style=configure -configure_args=" - --prefix=/usr - --sysconfdir=/etc/luarocks - --lua-version=5.2 - --lua-suffix=5.2 - --with-lua-include=/usr/include/lua5.2 - --with-downloader=curl - --versioned-rocks-dir" -hostmakedepends="lua52-devel" -makedepends="lua52-devel" -depends="lua52 curl unzip" -conf_files="/etc/luarocks/config-5.2.lua" -short_desc="Package management for Lua modules - Lua 5.2" -maintainer="Duncaen " -license="MIT" -homepage="http://luarocks.org/" -distfiles="http://luarocks.org/releases/luarocks-${version}.tar.gz" -checksum="3938df33de33752ff2c526e604410af3dceb4b7ff06a770bc4a240de80a1f934" - -alternatives=" - luarocks:luarocks:/usr/bin/luarocks-5.2 - luarocks:luarocks-admin:/usr/bin/luarocks-admin-5.2" - -pre_configure() { - sed -i -e '/unzip/d' configure -} -pre_install() { - sed -i -e 's;env lua;env lua5.2;g' src/bin/luarocks{,-admin} -} -post_install() { - vlicense COPYING - rm -rfv ${DESTDIR}/usr/bin/luarocks{,-admin} -} diff --git a/srcpkgs/luarocks/template b/srcpkgs/luarocks/template index 182e8636991..9e736c7d8d8 100644 --- a/srcpkgs/luarocks/template +++ b/srcpkgs/luarocks/template @@ -1,38 +1,79 @@ # Template file for 'luarocks' pkgname=luarocks -version=2.4.4 +version=3.0.4 revision=1 archs=noarch build_style=configure configure_args=" --prefix=/usr - --sysconfdir=/etc/luarocks + --sysconfdir=/etc --lua-version=5.3 - --lua-suffix=5.3 --with-lua-include=/usr/include/lua5.3 - --with-downloader=curl --versioned-rocks-dir" hostmakedepends="lua-devel" depends="lua curl unzip" -conf_files="/etc/luarocks/config-5.3.lua" short_desc="Package management for Lua modules" maintainer="Duncaen " license="MIT" -homepage="http://luarocks.org/" -distfiles="http://luarocks.org/releases/luarocks-${version}.tar.gz" -checksum="3938df33de33752ff2c526e604410af3dceb4b7ff06a770bc4a240de80a1f934" +homepage="https://luarocks.org/" +distfiles="https://luarocks.org/releases/luarocks-${version}.tar.gz" +checksum=1236a307ca5c556c4fed9fdbd35a7e0e80ccf063024becc8c3bf212f37ff0edf -alternatives=" - luarocks:luarocks:/usr/bin/luarocks-5.3 - luarocks:luarocks-admin:/usr/bin/luarocks-admin-5.3" +conf_files="/etc/luarocks/config-5.3.lua" pre_configure() { - sed -i -e '/unzip/d' configure + vsed -i -e '457,465d' configure } + +post_build() { + for lv in 5.1 5.2; do + make LUA_VERSION=$lv LUA_INTERPRETER=lua$lv \ + LUA_INCDIR=/usr/include/lua$lv ./build/config-$lv.lua + done +} + pre_install() { - sed -i -e 's;env lua;env lua5.3;g' src/bin/luarocks{,-admin} + vsed -i -e 's;env lua;env lua5.3;g' src/bin/luarocks{,-admin} } + post_install() { vlicense COPYING - rm -rfv ${DESTDIR}/usr/bin/luarocks{,-admin} + + vmkdir usr/bin + for lv in 5.1 5.2; do + make DESTDIR="${DESTDIR}" LUA_VERSION=$lv install-config + make DESTDIR="${DESTDIR}" LUA_VERSION=$lv install-config + + echo "#!/bin/sh" > ${DESTDIR}/usr/bin/luarocks-$lv + echo "exec luarocks --lua-version $lv \"\$@\"" >> ${DESTDIR}/usr/bin/luarocks-$lv + chmod +x ${DESTDIR}/usr/bin/luarocks-$lv + + echo "#!/bin/sh" > ${DESTDIR}/usr/bin/luarocks-admin-$lv + echo "exec luarocks-admin --lua-version $lv \"\$@\"" >> ${DESTDIR}/usr/bin/luarocks-admin-$lv + chmod +x ${DESTDIR}/usr/bin/luarocks-admin-$lv + done +} + +luarocks-lua52_package() { + archs=noarch + short_desc+=" - Lua52" + depends="luarocks>=${version}_${revision} lua52" + conf_files="/etc/luarocks/config-5.2.lua" + pkg_install() { + vmove usr/bin/luarocks-5.2 + vmove usr/bin/luarocks-admin-5.2 + vmove etc/luarocks/config-5.2.lua + } +} + +luarocks-lua51_package() { + archs=noarch + short_desc+=" - Lua51" + depends="luarocks>=${version}_${revision} lua51" + conf_files="/etc/luarocks/config-5.1.lua" + pkg_install() { + vmove usr/bin/luarocks-5.1 + vmove usr/bin/luarocks-admin-5.1 + vmove etc/luarocks/config-5.1.lua + } }