summaryrefslogtreecommitdiff
path: root/xmake/plugins/pack/srpm
diff options
context:
space:
mode:
authorruki <[email protected]>2023-12-20 23:59:20 +0800
committerruki <[email protected]>2023-12-20 23:59:20 +0800
commit1976625c2296c156511922d6792df6f2da8a1b23 (patch)
treec3bdcbb69c75402508dca7a8755797111aa49d8b /xmake/plugins/pack/srpm
parent496c749bc97222b3c2607540407f4b617d02de38 (diff)
add buildcmds for srpm
Diffstat (limited to 'xmake/plugins/pack/srpm')
-rw-r--r--xmake/plugins/pack/srpm/main.lua17
1 files changed, 15 insertions, 2 deletions
diff --git a/xmake/plugins/pack/srpm/main.lua b/xmake/plugins/pack/srpm/main.lua
index 2b67ce40c..a65f3b4f6 100644
--- a/xmake/plugins/pack/srpm/main.lua
+++ b/xmake/plugins/pack/srpm/main.lua
@@ -64,7 +64,7 @@ function _translate_filepath(package, filepath)
end
-- get install command
-function _get_installcmd(package, installcmds, cmd)
+function _get_customcmd(package, installcmds, cmd)
local opt = cmd.opt or {}
local kind = cmd.kind
if kind == "cp" then
@@ -102,10 +102,17 @@ function _get_installcmd(package, installcmds, cmd)
end
end
+-- get build commands
+function _get_buildcmds(package, buildcmds, cmds)
+ for _, cmd in ipairs(cmds) do
+ _get_customcmd(package, buildcmds, cmd)
+ end
+end
+
-- get install commands
function _get_installcmds(package, installcmds, cmds)
for _, cmd in ipairs(cmds) do
- _get_installcmd(package, installcmds, cmd)
+ _get_customcmd(package, installcmds, cmd)
end
end
@@ -132,6 +139,12 @@ function _get_specvars(package)
package:set("prefixdir", prefixdir)
return table.concat(installcmds, "\n")
end
+ specvars.PACKAGE_BUILDCMDS = function ()
+ local buildcmds = {}
+ _get_buildcmds(package, buildcmds, batchcmds.get_buildcmds(package):cmds())
+ return table.concat(buildcmds, "\n")
+ end
+
return specvars
end