void-packages/srcpkgs/LuaJIT/template
q66 f642382ad7 LuaJIT: update to 2.1.0-beta3, add patches
The patches enable support on ppc64 targets and some other things,
taken from Ubuntu, plus a bcsave.lua patch made by myself.
2019-01-22 13:07:19 -02:00

82 lines
2.1 KiB
Bash

# Template file for 'LuaJIT'
pkgname=LuaJIT
version=2.1.0beta3
revision=1
_so_version=2.1.0
_dist_version=${_so_version}-beta3
wrksrc="${pkgname}-${_dist_version}"
hostmakedepends="lua52-BitOp"
short_desc="Just-In-Time Compiler for Lua"
maintainer="q66 <daniel@octaforge.org>"
license="MIT"
homepage="http://www.luajit.org"
distfiles="http://luajit.org/download/${pkgname}-${_dist_version}.tar.gz"
checksum=1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3
if [ "$CROSS_BUILD" -a "$XBPS_MACHINE" = "x86_64" ]; then
hostmakedepends+=" gcc-multilib"
fi
_cross_cc="cc"
if [ "$CROSS_BUILD" ]; then
# cross toolchains are only for x86_64, ppc64 and i686 hosts
# luajit needs matching bitness for host and target
# on x86_64 we can multilib, on others we can't
case "$XBPS_MACHINE" in
x86_64)
case "$XBPS_TARGET_MACHINE" in
ppc64*) ;;
arm*|i686*|mips*|ppc*) _cross_cc="cc -m32";;
esac
;;
ppc64*|x86_64-musl)
case "$XBPS_TARGET_MACHINE" in
ppc64*) ;;
arm*|i686*|mips*|ppc*)
broken="Mismatched bitness on non-multilib host"
;;
esac
;;
i686*)
case "$XBPS_TARGET_MACHINE" in
x86_64*|ppc64*|aarch64*)
broken="Mismatched bitness on non-multilib host"
;;
esac
;;
esac
fi
do_build() {
local _cflags=$CFLAGS
local _ldflags=$LDFLAGS
if [ "$CROSS_BUILD" ]; then
local cross="CROSS=${XBPS_CROSS_TRIPLET}-"
fi
unset CFLAGS LDFLAGS
make ${makejobs} PREFIX=/usr HOST_LUA=lua5.2 HOST_CC="${_cross_cc}" \
HOST_CFLAGS="$XBPS_CFLAGS" HOST_LDFLAGS="$XBPS_LDFLAGS" \
TARGET_CFLAGS="${_cflags}" TARGET_LDFLAGS="${_ldflags}" ${cross}
}
do_install() {
make DPREFIX=${DESTDIR}/usr DESTDIR=${DESTDIR} \
INSTALL_SHARE=${DESTDIR}/usr/share PREFIX=/usr install
mv ${DESTDIR}/usr/bin/luajit-* ${DESTDIR}/usr/bin/luajit
ln -fs libluajit-5.1.so.${_so_version} ${DESTDIR}/usr/lib/libluajit-5.1.so.2
vlicense COPYRIGHT
}
LuaJIT-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
}
}