summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/pack/deb/main.lua3
-rw-r--r--xmake/plugins/pack/xpack.lua30
2 files changed, 32 insertions, 1 deletions
diff --git a/xmake/plugins/pack/deb/main.lua b/xmake/plugins/pack/deb/main.lua
index 43f30f454..4dc23bc11 100644
--- a/xmake/plugins/pack/deb/main.lua
+++ b/xmake/plugins/pack/deb/main.lua
@@ -223,6 +223,9 @@ function _pack_deb(debuild, package)
-- build package
os.vrunv(debuild, {"-us", "-uc"}, {curdir = sourcedir})
+
+ -- copy deb file
+ os.vcp(path.join(path.directory(sourcedir), "*.deb"), package:outputfile())
end
function main(package)
diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua
index 6d82536d4..89ee5a54b 100644
--- a/xmake/plugins/pack/xpack.lua
+++ b/xmake/plugins/pack/xpack.lua
@@ -206,6 +206,24 @@ function xpack:inputkind()
return inputkind
end
+-- get the output kind
+function xpack:outputkind()
+ local outputkinds = {
+ wix = "binary",
+ nsis = "binary",
+ zip = "binary",
+ targz = "binary",
+ srczip = "source",
+ srctargz = "source",
+ runself = "source",
+ deb = "binary",
+ srpm = "source",
+ rpm = "binary"
+ }
+ local outputkind = outputkinds[self:format()] or "binary"
+ return outputkind
+end
+
-- pack from source files?
function xpack:from_source()
return self:inputkind() == "source"
@@ -216,6 +234,16 @@ function xpack:from_binary()
return self:inputkind() == "binary"
end
+-- pack with source files?
+function xpack:with_source()
+ return self:outputkind() == "source"
+end
+
+-- pack with binary files?
+function xpack:with_binary()
+ return self:outputkind() == "binary"
+end
+
-- get the build directory
function xpack:buildir()
return path.join(config.buildir(), ".xpack", self:name())
@@ -235,7 +263,7 @@ function xpack:basename()
local basename = option.get("basename") or self:get("basename")
if basename == nil then
basename = self:name()
- if self:from_source() then
+ if self:with_source() then
basename = basename .. "-src"
end
local version = self:version()