forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
luajit-2.0.5-r3.ebuild
74 lines (61 loc) · 1.63 KB
/
luajit-2.0.5-r3.ebuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit pax-utils toolchain-funcs
MY_PV="$(ver_cut 1-3)"
MY_P="LuaJIT-${MY_PV}"
if [[ -n $(ver_cut 4) ]]; then
HOTFIX="v${PV}"
HOTFIX="${HOTFIX/_p/_hotfix}.patch"
fi
DESCRIPTION="Just-In-Time Compiler for the Lua programming language"
HOMEPAGE="https://luajit.org/"
SRC_URI="https://luajit.org/download/${MY_P}.tar.gz
${HOTFIX:+https://luajit.org/download/${HOTFIX}}"
LICENSE="MIT"
# this should probably be pkgmoved to 2.0 for sake of consistency.
SLOT="2"
KEYWORDS="amd64 arm ppc x86 ~amd64-linux ~x86-linux"
IUSE="lua52compat static-libs"
PATCHES=(
"${FILESDIR}/${PN}-2-ldconfig.patch"
"${FILESDIR}/CVE-2020-15890.patch"
)
S="${WORKDIR}/${MY_P}"
src_prepare() {
if [[ -n ${HOTFIX} ]]; then
eapply "${DISTDIR}/${HOTFIX}"
fi
default
}
_emake() {
emake \
Q= \
PREFIX="${EPREFIX}/usr" \
MULTILIB="$(get_libdir)" \
DESTDIR="${D}" \
CFLAGS="" \
LDFLAGS="" \
HOST_CC="$(tc-getBUILD_CC)" \
HOST_CFLAGS="${BUILD_CPPFLAGS} ${BUILD_CFLAGS}" \
HOST_LDFLAGS="${BUILD_LDFLAGS}" \
STATIC_CC="$(tc-getCC)" \
DYNAMIC_CC="$(tc-getCC) -fPIC" \
TARGET_LD="$(tc-getCC)" \
TARGET_CFLAGS="${CPPFLAGS} ${CFLAGS}" \
TARGET_LDFLAGS="${LDFLAGS}" \
TARGET_AR="$(tc-getAR) rcus" \
BUILDMODE="$(usex static-libs mixed dynamic)" \
TARGET_STRIP="true" \
INSTALL_LIB="${ED}/usr/$(get_libdir)" \
"$@"
}
src_compile() {
tc-export_build_env
_emake XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")"
}
src_install() {
_emake install
pax-mark m "${ED}/usr/bin/luajit-${MY_PV}"
HTML_DOCS="doc/." einstalldocs
}