aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPuqns67 <me@puqns67.icu>2024-11-04 19:30:03 +0800
committerJakov Smolić <jsmolic@gentoo.org>2024-11-16 11:45:31 +0100
commit4de1188d406284fd0f54fbabdd2b1a6ebd2573e3 (patch)
tree1ea6426bf1857029c28ba1f521c3f304cf364058 /dev-lang/luajit
parentprofiles: add eapi (diff)
downloadriscv-master.tar.gz
riscv-master.tar.bz2
riscv-master.zip
dev-lang/luajit: add 2.1.1727870382HEADmaster
Copy ebuild from the main tree, update to last git commit, then add a patch [1] to support RISC-V. Link: https://github.com/LuaJIT/LuaJIT/pull/1267 [1] Signed-off-by: Puqns67 <me@puqns67.icu> Closes: https://github.com/gentoo/riscv/pull/20 Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>
Diffstat (limited to 'dev-lang/luajit')
-rw-r--r--dev-lang/luajit/Manifest2
-rw-r--r--dev-lang/luajit/luajit-2.1.1727870382.ebuild70
-rw-r--r--dev-lang/luajit/metadata.xml14
3 files changed, 86 insertions, 0 deletions
diff --git a/dev-lang/luajit/Manifest b/dev-lang/luajit/Manifest
new file mode 100644
index 0000000..2490308
--- /dev/null
+++ b/dev-lang/luajit/Manifest
@@ -0,0 +1,2 @@
+DIST luajit-2.1.1727870382-RISCV-support.patch 364280 BLAKE2B 790ad563788a5f8b14af483f708e49017b540aaa4c4f04eac3a06174cf9cae1aa2e33dcbdf8305e1922ac144a5504cf541df4b494dca77e5fd79d13323bdb669 SHA512 9055d7ba414cfa28ae2cef762ef8e407848c835c68f0e89f20c765a02e02047561862725ebc8a79f17334129b34a05d60e3bc8dfcb0a1e547a4d000d65f19e94
+DIST luajit-2.1.1727870382.tar.gz 1082759 BLAKE2B ca2cca53238b1fcbb5a829b125f6b3efda3a863765027c8c224a01b95756255583e126ec04c115e7acc54314fb387ce1b09b9384acf0a852d51f887409bd702a SHA512 ac26594526f10e878874c02b2bbdfc6a0d1366c60456fbd09a75da5f565a2f81a1c73e385a7e7f0096a3923df5f4ac7f727100faced355bd05a9da0e95fbe1ef
diff --git a/dev-lang/luajit/luajit-2.1.1727870382.ebuild b/dev-lang/luajit/luajit-2.1.1727870382.ebuild
new file mode 100644
index 0000000..8b93f97
--- /dev/null
+++ b/dev-lang/luajit/luajit-2.1.1727870382.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+GIT_COMMIT=97813fb924edf822455f91a5fbbdfdb349e5984f
+GIT_COMMIT_RISCV=1893cf72c264f837596614a537a18e83b8c1b678
+
+# Upstream doesn't make releases anymore and instead have a (broken) "rolling
+# git tag" model.
+#
+# https://github.com/LuaJIT/LuaJIT/issues/665#issuecomment-784452583
+# https://www.freelists.org/post/luajit/LuaJIT-uses-rolling-releases
+#
+# Regular snapshots should be made from the v2.1 branch. Get the version with
+# `git show -s --format=%ct`
+
+inherit toolchain-funcs
+
+DESCRIPTION="Just-In-Time Compiler for the Lua programming language"
+HOMEPAGE="https://luajit.org/"
+SRC_URI="
+ https://github.com/LuaJIT/LuaJIT/archive/${GIT_COMMIT}.tar.gz -> ${P}.tar.gz
+ https://github.com/plctlab/LuaJIT/compare/${GIT_COMMIT}..${GIT_COMMIT_RISCV}.patch -> ${P}-RISCV-support.patch
+"
+S="${WORKDIR}/LuaJIT-${GIT_COMMIT}"
+
+LICENSE="MIT"
+# this should probably be pkgmoved to 2.0 for sake of consistency.
+SLOT="2/${PV}"
+KEYWORDS="-* ~riscv"
+IUSE="lua52compat static-libs"
+
+PATCHES=(
+ "${DISTDIR}/${P}-RISCV-support.patch"
+)
+
+_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
+ dosym luajit-"${PV}" /usr/bin/luajit
+
+ HTML_DOCS="doc/." einstalldocs
+}
diff --git a/dev-lang/luajit/metadata.xml b/dev-lang/luajit/metadata.xml
new file mode 100644
index 0000000..254a14a
--- /dev/null
+++ b/dev-lang/luajit/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <use>
+ <flag name="lua52compat">
+ Enable some upwards-compatible features
+ from Lua 5.2 that are unlikely to break existing code.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="github">LuaJIT/LuaJIT</remote-id>
+ </upstream>
+</pkgmetadata>