1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 GIT_COMMIT
=97813fb924edf822455f91a5fbbdfdb349e5984f
6 GIT_COMMIT_RISCV
=1893cf72c264f837596614a537a18e83b8c1b678
8 # Upstream doesn't make releases anymore and instead have a (broken) "rolling
11 # https://github.com/LuaJIT/LuaJIT/issues/665#issuecomment-784452583
12 # https://www.freelists.org/post/luajit/LuaJIT-uses-rolling-releases
14 # Regular snapshots should be made from the v2.1 branch. Get the version with
15 # `git show -s --format=%ct`
17 inherit toolchain-funcs
19 DESCRIPTION
="Just-In-Time Compiler for the Lua programming language"
20 HOMEPAGE
="https://luajit.org/"
22 https://github.com/LuaJIT/LuaJIT/archive/${GIT_COMMIT}.tar.gz -> ${P}.tar.gz
23 https://github.com/plctlab/LuaJIT/compare/${GIT_COMMIT}..${GIT_COMMIT_RISCV}.patch -> ${P}-RISCV-support.patch
25 S
="${WORKDIR}/LuaJIT-${GIT_COMMIT}"
28 # this should probably be pkgmoved to 2.0 for sake of consistency.
31 IUSE
="lua52compat static-libs"
34 "${DISTDIR}/${P}-RISCV-support.patch"
40 PREFIX
="${EPREFIX}/usr" \
41 MULTILIB
="$(get_libdir)" \
45 HOST_CC
="$(tc-getBUILD_CC)" \
46 HOST_CFLAGS
="${BUILD_CPPFLAGS} ${BUILD_CFLAGS}" \
47 HOST_LDFLAGS
="${BUILD_LDFLAGS}" \
48 STATIC_CC
="$(tc-getCC)" \
49 DYNAMIC_CC
="$(tc-getCC) -fPIC" \
50 TARGET_LD
="$(tc-getCC)" \
51 TARGET_CFLAGS
="${CPPFLAGS} ${CFLAGS}" \
52 TARGET_LDFLAGS
="${LDFLAGS}" \
53 TARGET_AR
="$(tc-getAR) rcus" \
54 BUILDMODE
="$(usex static-libs mixed dynamic)" \
56 INSTALL_LIB
="${ED}/usr/$(get_libdir)" \
62 _emake XCFLAGS
="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")"
67 dosym luajit-
"${PV}" /usr
/bin
/luajit
69 HTML_DOCS
="doc/." einstalldocs