Skip to content
Snippets Groups Projects
Commit 7e66e25a authored by Jakub Jirutka's avatar Jakub Jirutka :flag_ua:
Browse files

main/lua5.3: improve abuild

parent eabc7596
No related branches found
No related tags found
No related merge requests found
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua5.3
_pkgname=lua
pkgver=5.3.2
_luaver=${pkgname#lua}
pkgrel=0
......@@ -7,49 +8,43 @@ pkgdesc="Powerful light-weight programming language"
url="http://www.lua.org/"
arch="all"
license="MIT"
depends=
ldpath="/usr/lib/$pkgname"
depends_dev="$pkgname"
makedepends="libtool autoconf automake linenoise-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="http://www.lua.org/ftp/lua-$pkgver.tar.gz
source="http://www.lua.org/ftp/$_pkgname-$pkgver.tar.gz
lua-5.3-make.patch
lua-5.3-module_paths.patch
linenoise.patch
"
builddir="$srcdir/$_pkgname-$pkgver"
_builddir="$srcdir"/lua-$pkgver
prepare() {
cd "$_builddir"
for i in $source; do
case $i in
patch*|*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || return 1
;;
esac
done
default_prepare || return 1
cd "$builddir"
# disable readline
sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h
# we use libtool
cat >configure.ac <<EOF
top_buildir=.
cat > configure.ac <<-EOF
top_buildir=.
AC_INIT(src/luaconf.h)
AC_PROG_LIBTOOL
AC_OUTPUT()
EOF
AC_INIT(src/luaconf.h)
AC_PROG_LIBTOOL
AC_OUTPUT()
EOF
libtoolize --force --install && aclocal && autoconf
}
build() {
cd "$_builddir"
cd "$builddir"
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
|| return 1
cd src
make V=${pkgver%.*} \
CFLAGS="-DLUA_USE_LINUX -DLUA_COMPAT_5_2 -DLUA_USE_LINENOISE" \
......@@ -60,7 +55,9 @@ build() {
}
package() {
cd "$_builddir"
local i
cd "$builddir"
make V=${pkgver%.*} \
INSTALL_TOP="$pkgdir"/usr \
INSTALL_INC="$pkgdir"/usr/include/$pkgname \
......@@ -82,45 +79,45 @@ package() {
|| return 1
install -d "$pkgdir"/usr/lib/pkgconfig
cat > "$pkgdir"/usr/lib/pkgconfig/lua$_luaver.pc <<EOF
# lua.pc -- pkg-config data for Lua
# vars from install Makefile
# grep '^V=' ../Makefile
V= ${_luaver}
# grep '^R=' ../Makefile
R= ${pkgver}
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
prefix= /usr
INSTALL_BIN= \${prefix}/bin
INSTALL_INC= \${prefix}/include
INSTALL_LIB= \${prefix}/lib
INSTALL_MAN= \${prefix}/man/man1
INSTALL_LMOD= \${prefix}/share/lua/\${V}
INSTALL_CMOD= \${prefix}/lib/lua/\${V}
# canonical vars
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib/$pkgname
includedir=\${prefix}/include/$pkgname
Name: Lua
Description: An Extensible Extension Language
Version: \${R}
Requires:
Libs: -L\${libdir} -llua -lm
Cflags: -I\${includedir}
# (end of lua$_luaver.pc)
EOF
cat > "$pkgdir"/usr/lib/pkgconfig/lua$_luaver.pc <<-EOF
# lua.pc -- pkg-config data for Lua
# vars from install Makefile
# grep '^V=' ../Makefile
V= ${_luaver}
# grep '^R=' ../Makefile
R= ${pkgver}
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
prefix= /usr
INSTALL_BIN= \${prefix}/bin
INSTALL_INC= \${prefix}/include
INSTALL_LIB= \${prefix}/lib
INSTALL_MAN= \${prefix}/man/man1
INSTALL_LMOD= \${prefix}/share/lua/\${V}
INSTALL_CMOD= \${prefix}/lib/lua/\${V}
# canonical vars
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib/$pkgname
includedir=\${prefix}/include/$pkgname
Name: Lua
Description: An Extensible Extension Language
Version: \${R}
Requires:
Libs: -L\${libdir} -llua -lm
Cflags: -I\${includedir}
# (end of lua$_luaver.pc)
EOF
}
dev() {
depends_dev=$pkgname
default_dev
default_dev || return 1
mkdir -p "$subpkgdir"/usr/$pkgname "$subpkgdir"/usr/lib/$pkgname
ln -s ../include/$pkgname "$subpkgdir"/usr/$pkgname/include || return 1
ln -s ../lib/$pkgname "$subpkgdir"/usr/$pkgname/lib || return 1
......@@ -131,6 +128,7 @@ dev() {
libs() {
pkgdesc="Lua dynamic library runtime"
replaces="lua"
mkdir -p "$subpkgdir"/usr
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment