From 82e180fc35ec45de2bc07a980a3deec043c615f6 Mon Sep 17 00:00:00 2001 From: Marcin Deranek Date: Sun, 1 Feb 2015 12:58:07 +0100 Subject: Add dev-lang/luajit --- dev-lang/luajit/Manifest | 2 + dev-lang/luajit/files/luac.jit | 32 ++++++++++ dev-lang/luajit/luajit-2.1.9999.ebuild | 113 +++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 dev-lang/luajit/Manifest create mode 100644 dev-lang/luajit/files/luac.jit create mode 100644 dev-lang/luajit/luajit-2.1.9999.ebuild (limited to 'dev-lang') diff --git a/dev-lang/luajit/Manifest b/dev-lang/luajit/Manifest new file mode 100644 index 0000000..798e129 --- /dev/null +++ b/dev-lang/luajit/Manifest @@ -0,0 +1,2 @@ +AUX luac.jit 455 SHA256 9bcc73a9d762823fea1fe1d9f82f1285b932b9345eed13c1bcf725b66e8f4f00 SHA512 af40effccdda9dc4ef2906b284af1d248072bb4d85833da699698bc7dd766e8b5c4cbd082ed583a87129f458e531c71ceac7ef64272fefaee4f4017e16ffda18 WHIRLPOOL 5dccce9b7dc1ccba9c7621b981b15e0e9dcfaf7c3acb18d34fe20ea921c83248049cdabe26eb1b9fa03b6e772fd74ddefeda61e0c6cff6291477fc52c5c4a40d +EBUILD luajit-2.1.9999.ebuild 3177 SHA256 39d530601d91c51742cd9077b8b181b4060e0a82b2bd0c2b12f98fe622495357 SHA512 81900c5b2faae5e00c75dca16759e53c38d2af503128c2691301c89427d61fa60795fac8211cd8dcd35bb1c3fc7e52cc61f73bc4a005b0684bf122ce41f90a3f WHIRLPOOL 0dd22e6a0c41b2fdda7c99bf6a7afc6554e85a7f9df44744985812f9b5b90fac930f937433142548cd71b76f300a8cfcd886b4ff6ea340a5e9b7f5c588b52e02 diff --git a/dev-lang/luajit/files/luac.jit b/dev-lang/luajit/files/luac.jit new file mode 100644 index 0000000..2f70064 --- /dev/null +++ b/dev-lang/luajit/files/luac.jit @@ -0,0 +1,32 @@ +#!/usr/bin/env sh +help() { + echo "This binary is only wrapper for LuaJIT-not-ready software" + echo "You should use 'luajit -b' if you want to compile bytecode manually." + exit 0; +} + +out="luac.out" +i=1; +if [[ ${#} = 0 ]]; then help; fi +for args in "${@}"; do +case $args in + -o) + shift ${i} + out="${1}" + shift 1 + i=0 + ;; + -v) + luajit -v + exit 0; + ;; + -p) + out="/dev/null" + ;; + --help) + help + ;; +esac +let i=${i}+1 +done; +luajit -b "${@}" "${out}" diff --git a/dev-lang/luajit/luajit-2.1.9999.ebuild b/dev-lang/luajit/luajit-2.1.9999.ebuild new file mode 100644 index 0000000..ed103a2 --- /dev/null +++ b/dev-lang/luajit/luajit-2.1.9999.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: This ebuild is from Lua overlay; Bumped by mva; $ + +EAPI="5" + +inherit base multilib pax-utils versionator toolchain-funcs flag-o-matic check-reqs git-r3 + +MY_PV="2.1.0-alpha" + +DESCRIPTION="Just-In-Time Compiler for the Lua programming language" +HOMEPAGE="http://luajit.org/" +SRC_URI="" +EGIT_REPO_URI="http://luajit.org/git/luajit-2.0.git" +EGIT_BRANCH="v2.1" + +LICENSE="MIT" +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 + + emake \ + Q= \ + HOST_CC="$(tc-getBUILD_CC)" \ + STATIC_CC="$(tc-getCC)" \ + DYNAMIC_CC="$(tc-getCC) -fPIC" \ + TARGET_LD="$(tc-getCC)" \ + TARGET_AR="$(tc-getAR) rcus" \ + TARGET_STRIP="true" \ + XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" \ + "${opt}" +} + +src_install() { + default + base_src_install_docs + + host-is-pax && pax-mark m "${ED}usr/bin/${PN}-${MY_PV}" + dosym "${PN}-${MY_PV}" "/usr/bin/${PN}" + dobin "${FILESDIR}/luac.jit" +} -- cgit v1.2.3