dev-lua/cqueues: use upstream compat53

last clean of *flags

Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
This commit is contained in:
Nicolas PARLANT
2024-12-03 16:58:09 +00:00
parent b0557a4973
commit cd433ef5bd
3 changed files with 103 additions and 27 deletions

View File

@@ -24,20 +24,49 @@ REQUIRED_USE="${LUA_REQUIRED_USE}"
DEPEND="
${LUA_DEPS}
dev-libs/openssl:0=
dev-lua/compat53[${LUA_USEDEP}]
"
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"
DOCS=( "doc/." )
PATCHES="${FILESDIR}/cqueues-20200726-5-4_tests.patch"
PATCHES=(
"${FILESDIR}"/${PN}-20200726-5-4_tests.patch
"${FILESDIR}"/${PN}-20200726-rm-vendor-compat53.patch
)
lua_src_prepare() {
pushd "${BUILD_DIR}" || die
if [[ ${ELUA} != luajit ]]; then
LUA_VERSION="$(ver_cut 1-2 $(lua_get_version))"
# these two tests are forced upstream for luajit only
rm "${BUILD_DIR}"/regress/{44-resolvers-gc,51-join-defunct-thread}.lua || die
else
# Thanks to dev-lua/luaossl for this workaround
# This is a workaround for luajit, as it confirms to lua5.1
# and the 'GNUmakefile' doesn't understand LuaJITs version.
LUA_VERSION="5.1"
fi
if [[ ${LUA_VERSION} != 5.3 ]]; then
# this test is forced upstream for lua5-3 only
rm "${BUILD_DIR}"/regress/152-thread-integer-passing.lua || die
fi
# install test for lua_version only
sed -e 's:for V in 5.1 5.2 5.3 5.4:for V in '${LUA_VERSION}':' -i "${BUILD_DIR}"/regress/GNUmakefile || die
popd
}
src_prepare() {
default
sed \
-e '/LUAPATH :=/d' \
-e '/LUAPATH_FN =/d' \
-e '/HAVE_API_FN =/d' \
-e '/ALL_CFLAGS += -g/d' \
-e 's:$(shell env CC="$(CC)" $(d)/mk/vendor.cc):'$(tc-get-compiler-type)':' \
-i GNUmakefile || die
# tests deleted :
@@ -49,6 +78,7 @@ src_prepare() {
regress/30-starttls-completion.lua || die
lua_copy_sources
lua_foreach_impl lua_src_prepare
}
lua_src_compile() {
@@ -57,20 +87,13 @@ lua_src_compile() {
if [[ ${ELUA} != luajit ]]; then
LUA_VERSION="$(ver_cut 1-2 $(lua_get_version))"
else
# Thanks to dev-lua/luaossl for this workaround
# This is a workaround for luajit, as it confirms to lua5.1
# and the 'GNUmakefile' doesn't understand LuaJITs version.
LUA_VERSION="5.1"
fi
emake CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
RANLIB="$(tc-getRANLIB)" \
ALL_CFLAGS="${CFLAGS} -std=gnu99 -fPIC $(lua_get_CFLAGS)" \
ALL_CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" \
ALL_SOFLAGS="${SOFLAGS} -shared" \
ALL_LDFLAGS="${LDFLAGS}" \
all${LUA_VERSION}
tc-env_build emake \
$(lua_get_CFLAGS) \
ALL_LDFLAGS="${LDFLAGS}" \
all${LUA_VERSION}
popd
}
@@ -84,18 +107,11 @@ lua_src_test() {
if [[ ${ELUA} != luajit ]]; then
LUA_VERSION="$(ver_cut 1-2 $(lua_get_version))"
# these two tests are forced upstream for luajit only
rm "${BUILD_DIR}"/regress/{44-resolvers-gc,51-join-defunct-thread}.lua || die
else
LUA_VERSION="5.1"
fi
if [[ ${ELUA} != lua5.3 ]]; then
# this test is forced upstream for lua5-3 only
rm "${BUILD_DIR}"/regress/152-thread-integer-passing.lua || die
fi
default
emake CC=$(tc-getCC) check
popd
}
@@ -113,7 +129,8 @@ lua_src_install() {
LUA_VERSION="5.1"
fi
emake "DESTDIR=${D}" \
emake CC=$(tc-getCC) \
"DESTDIR=${D}" \
"lua${LUA_VERSION/./}cpath=$(lua_get_cmod_dir)" \
"lua${LUA_VERSION/./}path=$(lua_get_lmod_dir)" \
"prefix=${EPREFIX}/usr" \

View File

@@ -1,6 +1,3 @@
From ef7c2b2547fc3e1d26bc1d423edc2792a8056649 Mon Sep 17 00:00:00 2001
From: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
Date: Mon, 2 Dec 2024 09:14:19 +0000
Subject: [PATCH] add 5.4
---

View File

@@ -0,0 +1,62 @@
Subject: [PATCH] remove vendor compat53
---
src/GNUmakefile | 14 ++------------
src/cqueues.h | 2 +-
2 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/src/GNUmakefile b/src/GNUmakefile
index 0b15461..99aba94 100644
--- a/src/GNUmakefile
+++ b/src/GNUmakefile
@@ -22,7 +22,7 @@ VENDOR_$(d) = $(or $(CQUEUES_VENDOR),$(shell $(<D)/../mk/changelog author))
VERSION_$(d) = $(or $(CQUEUES_VERSION),$(shell $(<D)/../mk/changelog version))
COMMIT_$(d) = $(shell $(<D)/../mk/changelog commit)
-CPPFLAGS_$(d) = $(ALL_CPPFLAGS) -DCOMPAT53_PREFIX=cqueues
+CPPFLAGS_$(d) = $(ALL_CPPFLAGS)
CFLAGS_$(d) = $(ALL_CFLAGS)
SOFLAGS_$(d) = $(ALL_SOFLAGS)
LDFLAGS_$(d) = $(ALL_LDFLAGS)
@@ -50,7 +50,7 @@ define BUILD_$(d)
$$(d)/$(1)/cqueues.so: $$(addprefix $$(d)/$(1)/, $$(OBJS_$(d))) $$(d)/lib/libnonlua.a
$$(CC) -o $$@ $$^ $$(SOFLAGS_$$(abspath $$(@D)/..)) $$(LDFLAGS_$$(abspath $$(@D)/..)) $$(LIBS_$$(abspath $$(@D)/..))
-$$(d)/$(1)/%.o: $$(d)/%.c $$(d)/cqueues.h $$(d)/../vendor/compat53/c-api/compat-5.3.h $$(d)/config.h
+$$(d)/$(1)/%.o: $$(d)/%.c $$(d)/cqueues.h $$(d)/config.h
$$(MKDIR) -p $$(@D)
$$(CC) $$(CFLAGS_$$(<D)) $$(ALL_LUA$(subst .,,$(1))_CPPFLAGS) $$(CPPFLAGS_$$(<D)) -c -o $$@ $$<
@@ -66,16 +66,6 @@ $$(d)/$(1)/thread.o: $$(d)/lib/llrb.h
$$(d)/$(1)/notify.o: $$(d)/lib/notify.h
-ifneq ($(1), 5.3)
-ifneq ($(1), 5.4)
-$$(d)/$(1)/compat53.o: $$(d)/../vendor/compat53/c-api/compat-5.3.c $$(d)/../vendor/compat53/c-api/compat-5.3.h $$(d)/config.h
- $$(MKDIR) -p $$(@D)
- $$(CC) $$(CFLAGS_$(d)) $$(ALL_LUA$(subst .,,$(1))_CPPFLAGS) $$(CPPFLAGS_$(d)) -c -o $$@ $$<
-
-$$(d)/$(1)/cqueues.so: $$(d)/$(1)/compat53.o
-endif
-endif
-
.SECONDARY: liblua$(1)-cqueues cqueues$(1) cqueues
liblua$(1)-cqueues cqueues$(1) cqueues: $$(d)/$(1)/cqueues.so
diff --git a/src/cqueues.h b/src/cqueues.h
index ef803ea..bc07024 100644
--- a/src/cqueues.h
+++ b/src/cqueues.h
@@ -40,7 +40,7 @@
#include <lualib.h>
#include <lauxlib.h>
-#include "../vendor/compat53/c-api/compat-5.3.h"
+#include <compat-5.3.h>
/*
--
2.45.2