summaryrefslogtreecommitdiff
path: root/dev-lua/lanes
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lua/lanes')
-rw-r--r--dev-lua/lanes/Manifest1
-rw-r--r--dev-lua/lanes/files/lanes-4.0.0-glibc-2.43.patch10
-rw-r--r--dev-lua/lanes/files/lanes-4.0.0-makefile.patch21
-rw-r--r--dev-lua/lanes/lanes-4.0.0.ebuild100
4 files changed, 132 insertions, 0 deletions
diff --git a/dev-lua/lanes/Manifest b/dev-lua/lanes/Manifest
index 69a736731c5a..8acfc401c345 100644
--- a/dev-lua/lanes/Manifest
+++ b/dev-lua/lanes/Manifest
@@ -1 +1,2 @@
DIST lanes-3.17.2.tar.gz 448975 BLAKE2B 8efc10175fbbaf91f47da02fbce7b115b99cd82b9fda11825d39e6bb5e32b76ff3d31c7e384a13476b5b5605e9c2adfcab3111f4a97fd67748d42a7af2ad0977 SHA512 1d5a7594eb321cfaf2d46668ad2a84e74240e261bc9e7e279b51afa2d8f61024f73fa6ba31a9c05d686bde863f817bb8622b0878b0b2a5e18e87e8348e7eec62
+DIST lanes-4.0.0.tar.gz 536121 BLAKE2B 38b6694923eeb6277dd2e7225d62be8e54999b44d18b55b70f9c58996dc29b38c550b1d1c1149640bcdb386e576cf236e3ebba56f568500a8d64739a3fe8810e SHA512 9e7e3aa83214ac554950055b0f518135029f6cdbdc5e6a909364b8d7dcbfa38fd7d76f462e4b6430f917ac5884eb21548466174f433229b2c1566bb6faba4039
diff --git a/dev-lua/lanes/files/lanes-4.0.0-glibc-2.43.patch b/dev-lua/lanes/files/lanes-4.0.0-glibc-2.43.patch
new file mode 100644
index 000000000000..9f613589a5e9
--- /dev/null
+++ b/dev-lua/lanes/files/lanes-4.0.0-glibc-2.43.patch
@@ -0,0 +1,10 @@
+--- a/src/universe.hpp
++++ b/src/universe.hpp
+@@ -7,6 +7,7 @@
+ #include "threading.hpp"
+ #include "tracker.hpp"
+ #include "uniquekey.hpp"
++#include <unistd.h>
+
+ // #################################################################################################
+
diff --git a/dev-lua/lanes/files/lanes-4.0.0-makefile.patch b/dev-lua/lanes/files/lanes-4.0.0-makefile.patch
new file mode 100644
index 000000000000..b8ac12411824
--- /dev/null
+++ b/dev-lua/lanes/files/lanes-4.0.0-makefile.patch
@@ -0,0 +1,21 @@
+--- a/Makefile
++++ b/Makefile
+@@ -277,7 +277,6 @@
+ mkdir -p $(LUA_LIBDIR) $(LUA_SHAREDIR)
+ install -m 644 $(_LANES_TARGET) $(LUA_LIBDIR)
+ cp -p src/lanes.lua $(LUA_SHAREDIR)
+- install -m 644 $(_DUE_TARGET) $(LUA_LIBDIR)
+
+ uninstall:
+ rm $(LUA_LIBDIR)/lanes_core.$(_SO)
+--- a/src/Lanes.makefile
++++ b/src/Lanes.makefile
+@@ -29,7 +29,7 @@
+ # Note: Don't put $(LUA_LIBS) ahead of $^; MSYS will not like that (I think)
+ #
+ $(_TARGET): $(_OBJ)
+- $(CC) $(LIBFLAG) $^ $(LIBS) $(LUA_LIBS) -o $@
++ $(CC) $(LDFLAGS) $(LIBFLAG) $^ $(LIBS) $(LUA_LIBS) -o $@
+
+ clean:
+ -rm -rf $(_TARGET) *.o *.map *.gch
diff --git a/dev-lua/lanes/lanes-4.0.0.ebuild b/dev-lua/lanes/lanes-4.0.0.ebuild
new file mode 100644
index 000000000000..7a9d2c462565
--- /dev/null
+++ b/dev-lua/lanes/lanes-4.0.0.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-{1,3,4} luajit )
+
+inherit lua toolchain-funcs
+
+DESCRIPTION="Lightweight, native, lazy evaluating multithreading library"
+HOMEPAGE="https://github.com/LuaLanes/lanes"
+SRC_URI="https://github.com/LuaLanes/lanes/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="test"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+# Tests are currently somehow problematic.
+# https://github.com/LuaLanes/lanes/issues/197
+# https://github.com/LuaLanes/lanes/issues/198
+RESTRICT="test"
+
+RDEPEND="${LUA_DEPS}"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ virtual/pkgconfig
+ test? ( ${RDEPEND} )
+"
+
+HTML_DOCS=( "docs/." )
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.0.0-glibc-2.43.patch"
+ "${FILESDIR}/${PN}-4.0.0-makefile.patch"
+)
+
+src_prepare() {
+ default
+
+ # Replace which with 'command -v'
+ sed -e 's/which/command -v/g' -i Makefile || die
+ sed -e 's/which/command -v/g' -i Shared.makefile || die
+
+ lua_copy_sources
+}
+
+lua_src_compile() {
+ pushd "${BUILD_DIR}" || die
+
+ local myemakeargs=(
+ "CC=$(tc-getCC)"
+ "LUA=${ELUA}"
+ "LUA_FLAGS=$(lua_get_CFLAGS)"
+ "LUA_LIBS="
+ "OPT_FLAGS=${CFLAGS}"
+ )
+
+ tc-export PKG_CONFIG
+
+ emake "${myemakeargs[@]}"
+
+ popd
+}
+
+src_compile() {
+ lua_foreach_impl lua_src_compile
+}
+
+lua_src_test() {
+ pushd "${BUILD_DIR}" || die
+
+ emake LUA="${ELUA}" test
+
+ popd
+}
+
+src_test() {
+ lua_foreach_impl lua_src_test
+}
+
+lua_src_install() {
+ pushd "${BUILD_DIR}" || die
+
+ local myemakeargs=(
+ "LUA_LIBDIR=${ED}/$(lua_get_cmod_dir)"
+ "LUA_SHAREDIR=${ED}/$(lua_get_lmod_dir)"
+ )
+
+ emake "${myemakeargs[@]}" install
+
+ popd
+}
+
+src_install() {
+ lua_foreach_impl lua_src_install
+
+ einstalldocs
+}