From 35539cb231ee30f419937e009b1f3d18ee1a9111 Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Mon, 24 Sep 2018 16:16:03 -0700 Subject: dev-lang/luajit: Fix 2.0.5 cross-compilation build luajit passes CFLAGS/LDFLAGS to both host and target builds. This breaks when the host cpu does not support the target flags e.g. using march=bdver4 in CFLAGS when cross-compiling for AMD on an Intel host. Instead, pass the flags in {HOST|TARGET}-{CFLAGS|LDFLAGS} which is supported by luajit [1]. [1] https://github.com/LuaJIT/LuaJIT/blob/master/doc/install.html#L607 Closes: https://github.com/gentoo/gentoo/pull/9970 Signed-off-by: Manoj Gupta Signed-off-by: William Hubbs --- dev-lang/luajit/luajit-2.0.5-r2.ebuild | 67 ------------------------- dev-lang/luajit/luajit-2.0.5-r3.ebuild | 74 ++++++++++++++++++++++++++++ dev-lang/luajit/luajit-2.1.0_beta3-r1.ebuild | 56 --------------------- dev-lang/luajit/luajit-2.1.0_beta3-r2.ebuild | 56 +++++++++++++++++++++ 4 files changed, 130 insertions(+), 123 deletions(-) delete mode 100644 dev-lang/luajit/luajit-2.0.5-r2.ebuild create mode 100644 dev-lang/luajit/luajit-2.0.5-r3.ebuild delete mode 100644 dev-lang/luajit/luajit-2.1.0_beta3-r1.ebuild create mode 100644 dev-lang/luajit/luajit-2.1.0_beta3-r2.ebuild (limited to 'dev-lang') diff --git a/dev-lang/luajit/luajit-2.0.5-r2.ebuild b/dev-lang/luajit/luajit-2.0.5-r2.ebuild deleted file mode 100644 index 3dd7bad80377..000000000000 --- a/dev-lang/luajit/luajit-2.0.5-r2.ebuild +++ /dev/null @@ -1,67 +0,0 @@ -# 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}" \ - HOST_CC="$(tc-getBUILD_CC)" \ - STATIC_CC="$(tc-getCC)" \ - DYNAMIC_CC="$(tc-getCC) -fPIC" \ - TARGET_LD="$(tc-getCC)" \ - TARGET_AR="$(tc-getAR) rcus" \ - BUILDMODE="$(usex static-libs mixed dynamic)" \ - TARGET_STRIP="true" \ - INSTALL_LIB="${ED}/usr/$(get_libdir)" \ - "$@" -} - -src_compile() { - _emake XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" -} - -src_install() { - _emake install - - pax-mark m "${ED}/usr/bin/luajit-${MY_PV}" - - HTML_DOCS="doc/." einstalldocs -} diff --git a/dev-lang/luajit/luajit-2.0.5-r3.ebuild b/dev-lang/luajit/luajit-2.0.5-r3.ebuild new file mode 100644 index 000000000000..5816d1feccfe --- /dev/null +++ b/dev-lang/luajit/luajit-2.0.5-r3.ebuild @@ -0,0 +1,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 +} diff --git a/dev-lang/luajit/luajit-2.1.0_beta3-r1.ebuild b/dev-lang/luajit/luajit-2.1.0_beta3-r1.ebuild deleted file mode 100644 index cb942e454d02..000000000000 --- a/dev-lang/luajit/luajit-2.1.0_beta3-r1.ebuild +++ /dev/null @@ -1,56 +0,0 @@ -# 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-5)" -MY_PV="${MY_PV/_beta/-beta}" -MY_P="LuaJIT-${MY_PV}" - -DESCRIPTION="Just-In-Time Compiler for the Lua programming language" -HOMEPAGE="https://luajit.org/" -SRC_URI="https://luajit.org/download/${MY_P}.tar.gz" - -LICENSE="MIT" -# this should probably be pkgmoved to 2.0 for sake of consistency. -SLOT="2" -KEYWORDS="~arm64" -IUSE="lua52compat static-libs" - -PATCHES=( - "${FILESDIR}/${PN}-2-ldconfig.patch" - "${FILESDIR}/CVE-2020-15890.patch" -) - -S="${WORKDIR}/${MY_P}" - -_emake() { - emake \ - Q= \ - PREFIX="${EPREFIX}/usr" \ - MULTILIB="$(get_libdir)" \ - DESTDIR="${D}" \ - HOST_CC="$(tc-getBUILD_CC)" \ - STATIC_CC="$(tc-getCC)" \ - DYNAMIC_CC="$(tc-getCC) -fPIC" \ - TARGET_LD="$(tc-getCC)" \ - TARGET_AR="$(tc-getAR) rcus" \ - BUILDMODE="$(usex static-libs mixed dynamic)" \ - TARGET_STRIP="true" \ - INSTALL_LIB="${ED}/usr/$(get_libdir)" \ - "$@" -} - -src_compile() { - _emake XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" -} - -src_install() { - _emake install - - pax-mark m "${ED}/usr/bin/luajit-${MY_PV}" - - HTML_DOCS="doc/." einstalldocs -} diff --git a/dev-lang/luajit/luajit-2.1.0_beta3-r2.ebuild b/dev-lang/luajit/luajit-2.1.0_beta3-r2.ebuild new file mode 100644 index 000000000000..cb942e454d02 --- /dev/null +++ b/dev-lang/luajit/luajit-2.1.0_beta3-r2.ebuild @@ -0,0 +1,56 @@ +# 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-5)" +MY_PV="${MY_PV/_beta/-beta}" +MY_P="LuaJIT-${MY_PV}" + +DESCRIPTION="Just-In-Time Compiler for the Lua programming language" +HOMEPAGE="https://luajit.org/" +SRC_URI="https://luajit.org/download/${MY_P}.tar.gz" + +LICENSE="MIT" +# this should probably be pkgmoved to 2.0 for sake of consistency. +SLOT="2" +KEYWORDS="~arm64" +IUSE="lua52compat static-libs" + +PATCHES=( + "${FILESDIR}/${PN}-2-ldconfig.patch" + "${FILESDIR}/CVE-2020-15890.patch" +) + +S="${WORKDIR}/${MY_P}" + +_emake() { + emake \ + Q= \ + PREFIX="${EPREFIX}/usr" \ + MULTILIB="$(get_libdir)" \ + DESTDIR="${D}" \ + HOST_CC="$(tc-getBUILD_CC)" \ + STATIC_CC="$(tc-getCC)" \ + DYNAMIC_CC="$(tc-getCC) -fPIC" \ + TARGET_LD="$(tc-getCC)" \ + TARGET_AR="$(tc-getAR) rcus" \ + BUILDMODE="$(usex static-libs mixed dynamic)" \ + TARGET_STRIP="true" \ + INSTALL_LIB="${ED}/usr/$(get_libdir)" \ + "$@" +} + +src_compile() { + _emake XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" +} + +src_install() { + _emake install + + pax-mark m "${ED}/usr/bin/luajit-${MY_PV}" + + HTML_DOCS="doc/." einstalldocs +} -- cgit v1.2.3-65-gdbad