13 Commits

Author SHA256 Message Date
d1f0f1035b One level down to copy. 2025-10-21 00:38:19 +02:00
60b20c88fb Rewrite %luarocks_install to use a shell script
install-lua-rock.sh, which is packaged as well.
2025-10-21 00:05:32 +02:00
6e7d7d058f Fix %luarocks_* macros. 2025-10-15 03:04:59 +02:00
8ee4d34fad fix: we cannot use %global in a macro file 2025-10-14 14:50:29 +02:00
c1d442702b Fix %%lua_provides. 2025-10-14 12:38:25 +02:00
d4f21b0c0c Quote %%lua_archdir macro. 2025-10-13 19:20:45 +02:00
984b4bf4f2 feat: Rework Lua version and path macros using RPM Lua blocks
The `%lua_version`, `%lua_version_nodots`, and `%lua_noarchdir`
macros have been refactored to use the RPM internal Lua
interpreter blocks (`%{lua:...}`) instead of relying solely on
shell command execution (`%()`).

This change offers several benefits:
1. Consistency: Standardizes the approach, as other macros like
   `%lua_version_default` already use RPM Lua blocks.
2. Robustness: Improves path handling by explicitly trimming
   whitespace/newlines from the `pkgconf` output in
   `%lua_noarchdir`.
3. Clarity: Simplifies the logic for extracting the version
   number and calculating the no-dots version.

The `%lua_noarchdir` logic was also improved to correctly handle
a failure of the `pkgconf` command (e.g., when the package isn't
installed) by checking for `f == nil`.

A comment was also added to `%lua_provides` to clarify the
required definition of `%mod_name`.
2025-10-12 01:17:14 +02:00
21cfcf02e2 chore: I can use a good Makefile for some testing 2025-10-11 01:29:30 +02:00
22fe4289a4 Make %{lua_noarchdir} work even without lua-devel installed. 2025-10-10 12:56:20 +02:00
db9766d6bd Make definition of variables dynamic based on pkgconf output 2025-10-10 00:44:13 +02:00
df6ced835e Run obs-git-init . 2025-10-10 00:27:10 +02:00
efd19cb701 On Factory BR lua-interpreter. 2025-08-05 16:05:45 +02:00
91f3720965 Add functional .gitignore. 2025-08-04 15:20:48 +02:00
5 changed files with 24 additions and 8 deletions

1
.gitattributes vendored
View File

@@ -21,3 +21,4 @@
*.xz filter=lfs diff=lfs merge=lfs -text *.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text
*.changes merge=merge-changes

8
.gitignore vendored
View File

@@ -1 +1,9 @@
.osc .osc
_scmsync.obsinfo
_buildconfig-*
_buildinfo-*.xml
lua-macros-*-build/
*.obscpio
*.osc
_build.*
.pbuild

View File

@@ -1,5 +0,0 @@
mtime: 1760999899
commit: d1f0f1035bb04d30b4b3f2362fd2a8fa757179cdb184b24e5b6d27f1245ff673
url: https://src.opensuse.org/lua/lua-macros.git
revision: d1f0f1035bb04d30b4b3f2362fd2a8fa757179cdb184b24e5b6d27f1245ff673
projectscmsync: https://src.opensuse.org/lua/_ObsPrj.git

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9dabaf8e4bc02c3a8cc74d03d2b6f464921ef2f2f0e0b010379148c1485ac786
size 864

15
install-lua-rock.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -ex
# 1. %{lua_version}
# 2. %{buildroot}%{_prefix}
# 3. %{buildroot}%{luarocks_treedir}/%{mod_name}
SOURCE_DIR="$3"
luarocks --lua-version="$1" --tree="$2" install --deps-mode=none --no-manifest "${*:$#}"
if [ -d "${SOURCE_DIR}" ] && [ "$(find "${SOURCE_DIR}" -type f | wc -l)" -gt 0 ]
then
mkdir -p __rocktree
mv -v "${SOURCE_DIR}"/*/* __rocktree
fi