123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- set -e
- program=lua
- version=5.4.3
- short_version="${version%.*}"
- release=1
- pkgname="lua${short_version%.*}"
- pkgcategory=lua
- tarname=${program}-${version}.tar.gz
- fetch=https://www.lua.org/ftp/${tarname}
- description="
- A lightweight programming language designed for extending applications.
- Lua is a powerful, efficient, lightweight, embeddable scripting language.
- It supports procedural programming, object-oriented programming, functional
- programming, data-driven programming, and data description.
- "
- homepage=https://www.lua.org/
- license="MIT License"
- docs="doc/*.html doc/*.css doc/*.gif doc/*.png"
- docsdir="${docdir}/${pkgname}-${version}"
- _make_target()
- {
- make -j${jobs} \
- MYCFLAGS="$QICFLAGS -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -fPIC" \
- MYLDFLAGS="$QILDFLAGS" \
- INSTALL_LIB="${destdir}/usr/lib${libSuffix}" \
- INSTALL_LMOD="${destdir}/usr/share/lua/${short_version}" \
- INSTALL_CMOD="${destdir}/usr/lib${libSuffix}/lua/${short_version}" \
- INSTALL_DATA="cp -d" \
- INSTALL_MAN="${destdir}/${mandir}/man1" \
- INSTALL_TOP="${destdir}/usr" "$@"
- }
- build()
- {
- unpack "${tardir}/$tarname"
- cd "$srcdir"
-
- chmod -R u+w,go-w,a+rX-s .
- patch -Np1 -i "${worktree}/patches/lua/lua-5.4.2-shared_library-1.patch"
-
- sed -e 's#/usr/local/#/usr/#' \
- -e "s#lib/lua#lib${libSuffix}/lua#" \
- -i src/luaconf.h
- _make_target linux
- _make_target install
-
- make clean
- _make_target TO_LIB="liblua.so liblua.so.${short_version} liblua.so.${version}" linux
- _make_target TO_LIB="liblua.so liblua.so.${short_version} liblua.so.${version}" install
- unset -v make_target
-
- find "$destdir" -type f | xargs file | \
- awk '/ELF/ && /executable/ || /shared object/' | \
- cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
- mkdir -p "${destdir}/usr/lib${libSuffix}/pkgconfig"
- cat << EOF > "${destdir}/usr/lib${libSuffix}/pkgconfig/lua.pc"
- prefix=/usr
- INSTALL_BIN=\${prefix}/bin
- INSTALL_INC=\${prefix}/include
- INSTALL_LIB=\${prefix}/lib
- INSTALL_MAN=\${prefix}/share/man/man1
- INSTALL_LMOD=\${prefix}/share/lua/${short_version}
- INSTALL_CMOD=\${prefix}/lib${libSuffix}/lua/${short_version}
- exec_prefix=\${prefix}
- libdir=\${exec_prefix}/lib${libSuffix}
- includedir=\${prefix}/include
- Name: Lua
- Description: An Extensible Extension Language
- Version: ${version}
- Requires:
- Libs: -L\${libdir} -llua -lm -ldl
- Cflags: -I\${includedir}
- EOF
- unset -v short_version
-
- lzip -9 "${destdir}/${mandir}"/man1/*
-
- mkdir -p "${destdir}/$docsdir"
- cp -p $docs "${destdir}/$docsdir"
- }
|