1
0

dev-lang/luajit: add 2.1.1731601260, drop 2.1.1727870382

This commit is contained in:
Puqns67 2024-11-23 22:05:40 +08:00
parent ed63304fa7
commit 7b81fcf467
Signed by: Puqns67
GPG Key ID: 9669DF042554F536
3 changed files with 103 additions and 72 deletions

View File

@ -1,2 +1,2 @@
DIST luajit-2.1.1727870382-RISCV-support.patch 364280 BLAKE2B 790ad563788a5f8b14af483f708e49017b540aaa4c4f04eac3a06174cf9cae1aa2e33dcbdf8305e1922ac144a5504cf541df4b494dca77e5fd79d13323bdb669 SHA512 9055d7ba414cfa28ae2cef762ef8e407848c835c68f0e89f20c765a02e02047561862725ebc8a79f17334129b34a05d60e3bc8dfcb0a1e547a4d000d65f19e94 DIST luajit-2.1.1731601260-RISCV-support.patch 364187 BLAKE2B 4e19fe30f2663b50f51a30574a528ea12f28731c769cac837cb6df5d4fe5fcaece27d48b01b6fe2c863b19a1aa12f42d05d42a3d87908009bfc30d6416ce649b SHA512 dd1c9e8c2e339c929cea93e5cf2072828217b6a7be0e0615008dbcb535d218f802aafb8bf7f8b1c89c827ad76e830b7bed10b384287611a2c0c37de6ef342c61
DIST luajit-2.1.1727870382.tar.gz 1082759 BLAKE2B ca2cca53238b1fcbb5a829b125f6b3efda3a863765027c8c224a01b95756255583e126ec04c115e7acc54314fb387ce1b09b9384acf0a852d51f887409bd702a SHA512 ac26594526f10e878874c02b2bbdfc6a0d1366c60456fbd09a75da5f565a2f81a1c73e385a7e7f0096a3923df5f4ac7f727100faced355bd05a9da0e95fbe1ef DIST luajit-2.1.1731601260.tar.gz 1082678 BLAKE2B 07b8a9f1457db314785f9ab6ad87907b48a2dcee2a8a85e231779661ffe9b92e8b32cf790955537e86b519d61a8316848260fb83e7ba6746a816e2e0e59976e0 SHA512 4219017edd359bd5c92a37f1e3837c6ef8d9d8be89e53d80e110801e0eb7c8c2a74460376d1e3edef328e9d94f2eef9785e253027c67e1c91716e303e303a766

View File

@ -1,70 +0,0 @@
# 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
}

View File

@ -0,0 +1,101 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# 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
# Split release channel (such as "2.1") from relver (such as "1727870382")
VER_CHANNEL=${PV%.*}
VER_RELVER=${PV##*.}
DESCRIPTION="Just-In-Time Compiler for the Lua programming language"
HOMEPAGE="https://luajit.org/"
if [[ ${VER_RELVER} == 9999999999 ]]; then
# Upstream recommends pulling rolling releases from versioned branches.
# > The old git master branch is phased out and stays pinned to the v2.0
# > branch. Please follow the versioned branches instead.
#
# See http://luajit.org/status.html for additional information.
EGIT_BRANCH="v${VER_CHANNEL}"
EGIT_REPO_URI="https://luajit.org/git/luajit.git"
inherit git-r3
else
# Update this commit hash to bump a pinned-commit ebuild.
GIT_COMMIT=fe71d0fb54ceadfb5b5f3b6baf29e486d97f6059
GIT_COMMIT_RISCV=73a97651fa04ace32e2c31495cb1334821ba720c
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}"
KEYWORDS="~amd64 ~arm ~arm64 -hppa ~mips ~ppc ~riscv -sparc ~x86 ~amd64-linux ~x86-linux"
fi
LICENSE="MIT"
# this should probably be pkgmoved to 2.1 for sake of consistency.
SLOT="2/${PV}"
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_SHLDFLAGS="${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
# For tarballs downloaded from github, the relver is provided in
# ${S}/.relver, a file populated when generating the tarball as directed by
# .gitattributes. That file will contain the same relver as the relver
# in our version number.
#
# For the live build, this is not populated, but luajit's build process
# inspects the git repository directly with this command:
#
# git show -s --format=%ct
#
# In both cases, luajit puts the relver in src/luajit_relver.txt during
# the build. We read this file to ensure we're using the same source of
# truth as luajit's own build does when generating the binary's filename.
local relver="$(cat "${S}/src/luajit_relver.txt" || die 'error retrieving relver')"
dosym luajit-"${VER_CHANNEL}.${relver}" /usr/bin/luajit
HTML_DOCS="doc/." einstalldocs
}