summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-06-15 00:54:38 +0800
committerruki <[email protected]>2024-06-15 00:54:38 +0800
commit9899ce267b0728176efec6d588cb158aa0d4f668 (patch)
treeedad5a1ace0f140a308f811aa288a9a542c33fd0
parent7d0b596dec5177ec3702457bda64560cf65739ac (diff)
fix archive
-rw-r--r--core/xpack.lua4
-rw-r--r--xmake/plugins/pack/deb/main.lua18
2 files changed, 19 insertions, 3 deletions
diff --git a/core/xpack.lua b/core/xpack.lua
index e7c3bb3c4..e4999775a 100644
--- a/core/xpack.lua
+++ b/core/xpack.lua
@@ -115,7 +115,7 @@ xpack("xmakesrc")
on_buildcmd(function (package, batchcmds)
local format = package:format()
- if format == "srpm" then
+ if format == "srpm" or format == "deb" then
batchcmds:runv("./configure")
batchcmds:runv("make")
end
@@ -125,7 +125,7 @@ xpack("xmakesrc")
local format = package:format()
if format == "runself" then
batchcmds:runv("./scripts/get.sh", {"__local__"})
- elseif format == "srpm" then
+ elseif format == "srpm" or format == "deb" then
batchcmds:runv("make", {"install", path(package:install_rootdir(), function (p) return "PREFIX=" .. p end)})
end
end)
diff --git a/xmake/plugins/pack/deb/main.lua b/xmake/plugins/pack/deb/main.lua
index 4e7bed7c4..680531ff6 100644
--- a/xmake/plugins/pack/deb/main.lua
+++ b/xmake/plugins/pack/deb/main.lua
@@ -106,6 +106,12 @@ function _get_installcmds(package, installcmds, cmds)
end
end
+-- get uninstall commands
+function _get_uninstallcmds(package, uninstallcmds, cmds)
+ for _, cmd in ipairs(cmds) do
+ _get_customcmd(package, uninstallcmds, cmd)
+ end
+end
-- get specvars
function _get_specvars(package)
@@ -130,6 +136,16 @@ function _get_specvars(package)
package:set("prefixdir", prefixdir)
return table.concat(installcmds, "\n\t")
end
+ specvars.PACKAGE_UNINSTALLCMDS = function ()
+ local uninstallcmds = {}
+ _get_uninstallcmds(package, uninstallcmds, batchcmds.get_uninstallcmds(package):cmds())
+ for _, component in table.orderpairs(package:components()) do
+ if component:get("default") ~= false then
+ _get_uninstallcmds(package, uninstallcmds, batchcmds.get_uninstallcmds(component):cmds())
+ end
+ end
+ return table.concat(uninstallcmds, "\n\t")
+ end
specvars.PACKAGE_BUILDCMDS = function ()
local buildcmds = {}
_get_buildcmds(package, buildcmds, batchcmds.get_buildcmds(package):cmds())
@@ -214,7 +230,7 @@ function _pack_deb(debuild, package)
-- archive install files
local rootdir = package:source_rootdir()
- local oldir = os.cd(sourcedir)
+ local oldir = os.cd(rootdir)
local archivefiles = os.files("**")
os.cd(oldir)
local archivefile = _get_archivefile(package)