forked from pool/lua-macros
Compare commits
3 Commits
Author | SHA256 | Date | |
---|---|---|---|
e0968c8b6d | |||
7525e0fc06 | |||
accd1b4891 |
18
Makefile
Normal file
18
Makefile
Normal 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
|
5
_scmsync.obsinfo
Normal file
5
_scmsync.obsinfo
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
mtime: 1760224634
|
||||||
|
commit: 984b4bf4f2aada9069ea10fd24cedbfd7304d1b1bc74d792201a56543a747683
|
||||||
|
url: https://src.opensuse.org/lua/lua-macros.git
|
||||||
|
revision: 984b4bf4f2aada9069ea10fd24cedbfd7304d1b1bc74d792201a56543a747683
|
||||||
|
projectscmsync: https://src.opensuse.org/lua/_ObsPrj.git
|
3
build.specials.obscpio
Normal file
3
build.specials.obscpio
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:6f0dab0a704216725773db8af2af8e8f5bcdd83271b6ca6bb810062d99a0be44
|
||||||
|
size 356
|
@@ -1,3 +1,23 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
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>
|
||||||
|
|
||||||
|
- Make definition of variables dynamic based on pkgconf output.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Aug 5 14:05:41 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||||
|
|
||||||
|
- On Factory BR lua-interpreter.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Nov 25 19:15:41 UTC 2022 - Michal Suchanek <msuchanek@suse.com>
|
Fri Nov 25 19:15:41 UTC 2022 - Michal Suchanek <msuchanek@suse.com>
|
||||||
|
|
||||||
|
@@ -27,10 +27,13 @@ License: MIT
|
|||||||
Group: Development/Languages/Other
|
Group: Development/Languages/Other
|
||||||
URL: https://www.lua.org
|
URL: https://www.lua.org
|
||||||
Source0: macros.lua
|
Source0: macros.lua
|
||||||
%if 0%{?suse_version} >= 1500
|
%if 0%{?suse_version} > 1600
|
||||||
|
Requires: lua-interpreter
|
||||||
|
%elif 0%{?suse_version} >= 1500
|
||||||
# on SLE 12 lua is lua5.2 unconditionally, avoid
|
# on SLE 12 lua is lua5.2 unconditionally, avoid
|
||||||
Requires: lua
|
Requires: lua
|
||||||
%endif
|
%endif
|
||||||
|
Requires: pkgconfig
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -38,9 +41,6 @@ RPM macros for lua packaging
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
cp -p %{SOURCE0} .
|
cp -p %{SOURCE0} .
|
||||||
%if 0%{?rhel} || 0%{?fedora}
|
|
||||||
sed -i -e '/includedir/s!/lua!&-!' macros.lua
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
:
|
:
|
||||||
|
36
macros.lua
36
macros.lua
@@ -1,17 +1,42 @@
|
|||||||
# RPM macros for Lua
|
# RPM macros for Lua
|
||||||
|
|
||||||
# The major.minor version of Lua
|
# The major.minor version of Lua
|
||||||
%lua_version %(lua -e 'print(_VERSION)' | cut -d ' ' -f 2)
|
%lua_version %{lua:
|
||||||
%lua_version_nodots %(lua -e 'print((string.gsub("%{lua_version}", "%.", "")))')
|
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
|
# compiled modules should go here
|
||||||
%lua_archdir %{_libdir}/lua/%{lua_version}
|
%lua_archdir %(pkgconf --variable=INSTALL_CMOD lua)
|
||||||
|
|
||||||
# pure Lua modules should go here
|
# pure Lua modules should go here
|
||||||
%lua_noarchdir %{_datadir}/lua/%{lua_version}
|
%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 includes folder
|
||||||
%lua_incdir %{_includedir}/lua%{lua_version}
|
%lua_incdir %(pkgconf --variable=includedir lua)
|
||||||
|
|
||||||
%lua_version_default %{lua:
|
%lua_version_default %{lua:
|
||||||
local result = 5.4
|
local result = 5.4
|
||||||
@@ -33,6 +58,7 @@ print(result)
|
|||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
# Lua default version
|
# Lua default version
|
||||||
|
# This REQUIRES macro %{mod_name} to be defined.
|
||||||
# -e: Exclude lua prefix
|
# -e: Exclude lua prefix
|
||||||
# -n: Specify name
|
# -n: Specify name
|
||||||
%lua_provides(en:) \
|
%lua_provides(en:) \
|
||||||
|
Reference in New Issue
Block a user