From 5100490af6233af32c49fe6d27fb7dc66b010c4d Mon Sep 17 00:00:00 2001 From: Marcin Deranek Date: Thu, 20 Feb 2020 21:28:40 +0100 Subject: Sync with portage --- dev-lang/luajit/luajit-2.1.9999.ebuild | 107 +++++++-------------------------- 1 file changed, 23 insertions(+), 84 deletions(-) (limited to 'dev-lang/luajit/luajit-2.1.9999.ebuild') diff --git a/dev-lang/luajit/luajit-2.1.9999.ebuild b/dev-lang/luajit/luajit-2.1.9999.ebuild index 43e3bb4..c0cb360 100644 --- a/dev-lang/luajit/luajit-2.1.9999.ebuild +++ b/dev-lang/luajit/luajit-2.1.9999.ebuild @@ -1,11 +1,12 @@ -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# $Header: This ebuild is from Lua overlay; Bumped by mva; $ -EAPI="5" +EAPI=6 -inherit base multilib pax-utils versionator toolchain-funcs flag-o-matic check-reqs git-r3 +inherit pax-utils toolchain-funcs versionator git-r3 +#MY_PV="$(get_version_component_range 1-4)" +#MY_PV="${MY_PV/_beta/-beta}" MY_PV="2.1.0-beta3" DESCRIPTION="Just-In-Time Compiler for the Lua programming language" @@ -15,99 +16,37 @@ EGIT_REPO_URI="https://luajit.org/git/luajit-2.0.git" EGIT_BRANCH="v2.1" LICENSE="MIT" +# this should probably be pkgmoved to 2.0 for sake of consistency. SLOT="2" KEYWORDS="" -IUSE="debug lua52compat +optimization" - -HTML_DOCS=( "doc/" ) - -check_req() { - if use optimization; then - CHECKREQS_MEMORY="200M" - ewarn "Optimized (amalgamated) build wants at least 200MB of RAM" - ewarn "If you have no such RAM - try to disable 'optimization' flag" - check-reqs_pkg_${1} - fi -} - -pkg_pretend() { - check_req pretend -} - -pkg_setup() { - check_req setup -} - -src_prepare(){ - # fixing prefix and version - sed -r \ - -e "s|( PREFIX)=.*|\1=/usr|" \ - -e "s|( MULTILIB)=.*|\1=$(get_libdir)|" \ - -i Makefile || die "failed to fix prefix in Makefile" - - use debug && ( - sed -r \ - -e 's/#(CCDEBUG= -g)/\1 -ggdb/' \ - -i src/Makefile || die "Failed to enable debug" - ) -} - -src_compile() { - local opt; - use optimization && opt="amalg"; - - if gcc-fullversion 4 7 3 && gcc-specs-pie && has ccache ${FEATURES}; then - # It is three ways to avoid compilation breaking - # in case, when user use gcc-4.7.3+pie+ccache: - # a) append -fPIC to CFLAGS, to use it even for temporary - # build-time only static host/* bins and luajit binary itself. - # b) append -nopie to LDFLAGS - # (for same binaries and same reason) - # c) disable ccache (even in per-package basis). - # This will slow down amalgamated build, but is prefered and - # recommended by upstream method. - # So, since it is impossible to use method "c" directly from - # ebuild, I choose method "a" - # (since it is more secure on hardened systems, imho) + - # + ewarn user, that he really should disable ccache. - -# append-ldflags -nopie - append-cflags -fPIC - - ewarn "As we detected, that you're using gcc-4.7.3+pie+ccache," - ewarn "we need to either:" - ewarn " a) add -fPIC to CFLAGS, or" - ewarn " b) add -nopie to LDFLAGS, or" - ewarn " c) disable ccache (even on per-package basis)." - ewarn "" - ewarn "We suggest you to use variant 'c' and disable it via" - ewarn "/etc/portage/{,package.}env (read portage manual)" - ewarn "" - ewarn "But, since we can't do that from ebuild, we'll continue" - ewarn "with -fPIC (variant 'a') for now, since it gives more security" - ewarn "on hardened systems (in our opinion)." - ewarn "" - ewarn "But, anyway, we still *HIGHLY* recommend you" - ewarn "to disable ccache instead." - fi +IUSE="lua52compat static-libs" +_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" \ - XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" \ - "${opt}" + INSTALL_LIB="${ED%/}/usr/$(get_libdir)" \ + "$@" } -src_install() { - default - base_src_install_docs +src_compile() { + _emake XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" +} + +src_install(){ + _emake install - host-is-pax && pax-mark m "${ED}usr/bin/${PN}-${MY_PV}" dosym "${PN}-${MY_PV}" "/usr/bin/${PN}" - dobin "${FILESDIR}/luac.jit" + pax-mark m "${ED}usr/bin/luajit-${MY_PV}" + + HTML_DOCS="doc/." einstalldocs } -- cgit v1.2.3