x11-terms/ghostty: add missing depend dev-libs/oniguruma
[gentoo-zh.git] / dev-lang / luajit / luajit-2.1.1727870382.ebuild
blob8b93f974b1fb3f6764acd584208cb81eec751451
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
5 GIT_COMMIT=97813fb924edf822455f91a5fbbdfdb349e5984f
6 GIT_COMMIT_RISCV=1893cf72c264f837596614a537a18e83b8c1b678
8 # Upstream doesn't make releases anymore and instead have a (broken) "rolling
9 # git tag" model.
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/"
21 SRC_URI="
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}"
27 LICENSE="MIT"
28 # this should probably be pkgmoved to 2.0 for sake of consistency.
29 SLOT="2/${PV}"
30 KEYWORDS="-* ~riscv"
31 IUSE="lua52compat static-libs"
33 PATCHES=(
34 "${DISTDIR}/${P}-RISCV-support.patch"
37 _emake() {
38 emake \
39 Q= \
40 PREFIX="${EPREFIX}/usr" \
41 MULTILIB="$(get_libdir)" \
42 DESTDIR="${D}" \
43 CFLAGS="" \
44 LDFLAGS="" \
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)" \
55 TARGET_STRIP="true" \
56 INSTALL_LIB="${ED}/usr/$(get_libdir)" \
57 "$@"
60 src_compile() {
61 tc-export_build_env
62 _emake XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")"
65 src_install() {
66 _emake install
67 dosym luajit-"${PV}" /usr/bin/luajit
69 HTML_DOCS="doc/." einstalldocs