diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-11-27 14:46:23 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-11-27 14:50:58 +0100 |
commit | 7e66e25a34f72f6e48d47181d3fdbc0328d87f8c (patch) | |
tree | 2ee22a54d920ce309c0297d50a0a8238988f5f50 /main/lua5.3 | |
parent | eabc7596b07258be17d525f0f843f7418878651d (diff) | |
download | aports-7e66e25a34f72f6e48d47181d3fdbc0328d87f8c.tar.bz2 aports-7e66e25a34f72f6e48d47181d3fdbc0328d87f8c.tar.xz |
main/lua5.3: improve abuild
Diffstat (limited to 'main/lua5.3')
-rw-r--r-- | main/lua5.3/APKBUILD | 108 |
1 files changed, 53 insertions, 55 deletions
diff --git a/main/lua5.3/APKBUILD b/main/lua5.3/APKBUILD index 1453078705..7682b0a5f0 100644 --- a/main/lua5.3/APKBUILD +++ b/main/lua5.3/APKBUILD @@ -1,5 +1,6 @@ # 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/ } |