From d3cae9807d33335d64ed9e4683cc61744c6b3e4e Mon Sep 17 00:00:00 2001 From: Daniel Martinez Date: Tue, 13 Feb 2024 11:57:17 -0500 Subject: [PATCH 1/2] New package: lua-lanes-3.16.1 --- .../patches/0001-threading-musl.patch | 27 ++++++++++++++++ srcpkgs/lua-lanes/patches/0002-CFLAGS.patch | 13 ++++++++ srcpkgs/lua-lanes/template | 31 +++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 srcpkgs/lua-lanes/patches/0001-threading-musl.patch create mode 100644 srcpkgs/lua-lanes/patches/0002-CFLAGS.patch create mode 100644 srcpkgs/lua-lanes/template diff --git a/srcpkgs/lua-lanes/patches/0001-threading-musl.patch b/srcpkgs/lua-lanes/patches/0001-threading-musl.patch new file mode 100644 index 0000000000000..05508a57d85dd --- /dev/null +++ b/srcpkgs/lua-lanes/patches/0001-threading-musl.patch @@ -0,0 +1,27 @@ +From 0e959e637b6ee85b0710e0608fe5d678ad7e0b78 Mon Sep 17 00:00:00 2001 +From: Conrad Kostecki +Date: Tue, 23 Jan 2024 21:58:50 +0100 +Subject: [PATCH] src/threading.h: fix compilation on musl + +Signed-off-by: Conrad Kostecki +--- + src/threading.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/threading.h b/src/threading.h +index 3925076..b1706ac 100644 +--- a/src/threading.h ++++ b/src/threading.h +@@ -113,7 +113,11 @@ enum e_status { PENDING, RUNNING, WAITING, DONE, ERROR_ST, CANCELLED }; + #include + + #ifdef PLATFORM_LINUX +- # define _MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP ++ #if defined(__GLIBC__) ++ # define _MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP ++ #else ++ # define _MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE ++ #endif + #else + /* OS X, ... */ + # define _MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE diff --git a/srcpkgs/lua-lanes/patches/0002-CFLAGS.patch b/srcpkgs/lua-lanes/patches/0002-CFLAGS.patch new file mode 100644 index 0000000000000..46680eed6af34 --- /dev/null +++ b/srcpkgs/lua-lanes/patches/0002-CFLAGS.patch @@ -0,0 +1,13 @@ +diff --git a/src/Makefile b/src/Makefile +index c4d4c30..ae8de9a 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -92,7 +92,7 @@ ifeq "$(LUAROCKS)" "" + LIBFLAG = -bundle -undefined dynamic_lookup + endif + +- CFLAGS=-Wall -Werror $(OPT_FLAGS) $(LUA_FLAGS) ++ CFLAGS+=$(LUA_FLAGS) + LIBS=$(LUA_LIBS) + endif + diff --git a/srcpkgs/lua-lanes/template b/srcpkgs/lua-lanes/template new file mode 100644 index 0000000000000..fd0542ea17c15 --- /dev/null +++ b/srcpkgs/lua-lanes/template @@ -0,0 +1,31 @@ +# Template file for 'lua-lanes' +pkgname=lua-lanes +version=3.16.1 +revision=1 +build_style=gnu-makefile +make_use_env=yes +hostmakedepends="which pkg-config" +makedepends="$(vopt_if luajit LuaJIT-devel lua51-devel)" +short_desc="Lightweight, native, lazy evaluating multithreading library for Lua" +maintainer="Daniel Martinez " +license="MIT" +homepage="https://lualanes.github.io" +changelog="https://raw.githubusercontent.com/LuaLanes/lanes/v${version}/CHANGES" +distfiles="https://github.com/LuaLanes/lanes/archive/refs/tags/v${version}.tar.gz" +checksum=bff35696fe1502270e54523e89e9c2da29738a75d49aeb8237f6b47f4b7b14f2 + +build_options="luajit" + +case "$XBPS_TARGET_MACHINE" in + # luajit doesn't support riscv64 (yet) + riscv64*) ;; + *) build_options_default="luajit" ;; +esac + +do_install() { + make install DESTDIR=${DESTDIR}/usr +} + +post_install() { + vlicense COPYRIGHT +} From eacd3ad5c158fa39f78343f24e152b96027e60eb Mon Sep 17 00:00:00 2001 From: Daniel Martinez Date: Tue, 13 Feb 2024 11:57:48 -0500 Subject: [PATCH 2/2] options.description: describe LuaJIT --- common/options.description | 1 + 1 file changed, 1 insertion(+) diff --git a/common/options.description b/common/options.description index f9e3d0ce1992c..df7d5d9fba28e 100644 --- a/common/options.description +++ b/common/options.description @@ -46,6 +46,7 @@ desc_option_ldns="Enable support for LDNS DNSSEC library" desc_option_libao="Enable support for libao sound library" desc_option_libedit="Enable support for NetBSD's libedit" desc_option_lua="Enable support for Lua" +desc_option_luajit="Enable support for LuaJIT" desc_option_lz4="Enable support for LZ4 compression format" desc_option_lzo="Enable support for LZO compression format" desc_option_microhttpd="Enable support for microhttpd"