66 lines
1.8 KiB
Bash
66 lines
1.8 KiB
Bash
# Template file for 'LuaJIT'
|
|
pkgname=LuaJIT
|
|
# the minor version is the contents of the .relver file in the source tarball
|
|
version=2.1.1725453128
|
|
revision=1
|
|
_commit_hash=87ae18af97fd4de790bb6c476b212e047689cc93
|
|
build_style=gnu-makefile
|
|
hostmakedepends="lua52-BitOp"
|
|
short_desc="Just-In-Time Compiler for Lua"
|
|
maintainer="Daniel Martinez <danielmartinez@cock.li>"
|
|
license="MIT"
|
|
homepage="https://www.luajit.org"
|
|
distfiles="https://repo.or.cz/luajit-2.0.git/snapshot/${_commit_hash}.tar.gz"
|
|
checksum=c4ab3972a6d00d138caadab27ee53e646342e5d2f52adbffab6a916287b3fe57
|
|
|
|
build_options="lua52compat"
|
|
desc_option_lua52compat="higher compatibility with lua 5.2"
|
|
|
|
_host_cc="cc"
|
|
if [ -n "$CROSS_BUILD" ]; then
|
|
if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
|
|
if [ "${XBPS_MACHINE%%-*}" = "x86_64" ]; then
|
|
hostmakedepends+=" cross-i686-linux-musl"
|
|
_host_cc="i686-linux-musl-gcc -static"
|
|
else
|
|
broken="Host and target wordsize must match when not on x86_64"
|
|
fi
|
|
fi
|
|
|
|
make_build_args+=" CROSS=${XBPS_CROSS_TRIPLET}-"
|
|
fi
|
|
|
|
pre_build() {
|
|
if [ "$build_option_lua52compat" ]; then
|
|
make_build_args+=" XCFLAGS=-DLUAJIT_ENABLE_LUA52COMPAT"
|
|
fi
|
|
}
|
|
|
|
do_build() {
|
|
# if we don't unset, the build fails to cross-compile
|
|
# due to confliction with the makefile macros
|
|
local _cflags="$CFLAGS"
|
|
local _ldflags="$LDFLAGS"
|
|
unset CFLAGS LDFLAGS
|
|
|
|
make amalg ${makejobs} PREFIX=/usr HOST_LUA=lua5.2 \
|
|
HOST_CFLAGS="$XBPS_CFLAGS" HOST_LDFLAGS="$XBPS_LDFLAGS" \
|
|
TARGET_CFLAGS="${_cflags}" TARGET_LDFLAGS="${_ldflags}" \
|
|
HOST_CC="${_host_cc}" ${make_build_args}
|
|
}
|
|
|
|
post_install() {
|
|
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"
|
|
}
|
|
}
|