SHA256
10
0
forked from pool/lua-macros

Accepting request 1311191 from devel:languages:lua

- Rework Lua version and path macros using RPM Lua blocks.

- Make %{lua_noarchdir} work even without lua-devel installed.

OBS-URL: https://build.opensuse.org/request/show/1311191
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua-macros?expand=0&rev=12
This commit is contained in:
2025-10-15 10:44:28 +00:00
committed by Git OBS Bridge
parent 7525e0fc06
commit e0968c8b6d
5 changed files with 61 additions and 7 deletions

18
Makefile Normal file
View File

@@ -0,0 +1,18 @@
all:
mkdir -p build && cd build/ \
&& cmake .. \
'-GUnix Makefiles' \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_BUILD_TYPE=RelWithDebInfo '-DCMAKE_C_FLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g' \
'-DCMAKE_EXE_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' \
'-DCMAKE_MODULE_LINKER_FLAGS=-flto=auto -Wl,--as-needed' \
'-DCMAKE_SHARED_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_COLOR_MAKEFILE:BOOL=OFF \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DLUA_INCLUDE_DIR:PATH=$(shell pkgconf --variable=includedir lua) \
&& make
clean:
rm -rf build CMakeCache.txt

View File

@@ -1,5 +1,5 @@
mtime: 1760049853
commit: db9766d6bd3427a28de3d6839f6f471ed86e6ae894bd85374497c35a2cc5dcdf
mtime: 1760224634
commit: 984b4bf4f2aada9069ea10fd24cedbfd7304d1b1bc74d792201a56543a747683
url: https://src.opensuse.org/lua/lua-macros.git
revision: db9766d6bd3427a28de3d6839f6f471ed86e6ae894bd85374497c35a2cc5dcdf
revision: 984b4bf4f2aada9069ea10fd24cedbfd7304d1b1bc74d792201a56543a747683
projectscmsync: https://src.opensuse.org/lua/_ObsPrj.git

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bb8d0d04e489936d74eadfd3bc50ccbaa57586c04545ff9d63b2e07f0f01283a
oid sha256:6f0dab0a704216725773db8af2af8e8f5bcdd83271b6ca6bb810062d99a0be44
size 356

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sat Oct 11 16:45:06 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Rework Lua version and path macros using RPM Lua blocks.
-------------------------------------------------------------------
Fri Oct 10 10:56:01 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Make %{lua_noarchdir} work even without lua-devel installed.
-------------------------------------------------------------------
Thu Oct 9 22:44:04 UTC 2025 - Matej Cepl <mcepl@cepl.eu>

View File

@@ -1,14 +1,39 @@
# RPM macros for Lua
# The major.minor version of Lua
%lua_version %(lua -e 'print(_VERSION)' | cut -d ' ' -f 2)
%lua_version_nodots %(lua -e 'print((string.gsub("%{lua_version}", "%.", "")))')
%lua_version %{lua:
local f = io.popen("lua -e 'print(_VERSION)'")
local output = f:read("*a")
f:close()
local ver = output:match("Lua (%d%.%d)")
print(ver)
}
%lua_version_nodots %{lua:
local ver = rpm.expand("%{lua_version}")
local nodots = ver:gsub("%.", "")
print(nodots)
}
# compiled modules should go here
%lua_archdir %(pkgconf --variable=INSTALL_CMOD lua)
# pure Lua modules should go here
%lua_noarchdir %(pkgconf --variable=INSTALL_LMOD lua)
%lua_noarchdir %{lua:
local output = ""
local f = io.popen("pkgconf --variable=INSTALL_LMOD lua")
if f ~= nil then
output = f:read("*a"):gsub("^%s*(.-)%s*$", "%1")
f:close()
end
if output:len() > 0 then
print(output)
return
end
print(rpm.expand("%{_datadir}/lua/%{lua_version}"))
}
# lua includes folder
%lua_incdir %(pkgconf --variable=includedir lua)
@@ -33,6 +58,7 @@ print(result)
%{nil}
# Lua default version
# This REQUIRES macro %{mod_name} to be defined.
# -e: Exclude lua prefix
# -n: Specify name
%lua_provides(en:) \