summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-06-15 00:37:48 +0800
committerruki <[email protected]>2024-06-15 00:37:48 +0800
commita71bfc26daf8a5f609c8653134ad8124f3870ab0 (patch)
tree83853ae0d52e3002df36baf4337f81f5f9c3161d
parent52c27245a11bdc8063090345b2432497b5b84148 (diff)
fix source dir
-rw-r--r--xmake/plugins/pack/deb/main.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/xmake/plugins/pack/deb/main.lua b/xmake/plugins/pack/deb/main.lua
index 3fd3907a2..43f30f454 100644
--- a/xmake/plugins/pack/deb/main.lua
+++ b/xmake/plugins/pack/deb/main.lua
@@ -36,7 +36,7 @@ end
-- get archive file
function _get_archivefile(package)
- return path.absolute(path.join(package:buildir(), package:name() .. "_" .. package:version() .. ".orig.tar.gz"))
+ return path.absolute(path.join(path.directory(package:sourcedir()), package:name() .. "_" .. package:version() .. ".orig.tar.gz"))
end
-- translate the file path
@@ -169,11 +169,10 @@ end
-- pack deb package
function _pack_deb(debuild, package)
- local buildir = package:buildir()
- local workdir = path.join(buildir, "working")
-- install the initial debian directory
- local debiandir = path.join(workdir, "debian")
+ local sourcedir = package:sourcedir()
+ local debiandir = path.join(sourcedir, "debian")
if not os.isdir(debiandir) then
local debiandir_template = package:get("specfile") or path.join(os.programdir(), "scripts", "xpack", "deb", "debian")
os.cp(debiandir_template, debiandir)
@@ -215,15 +214,15 @@ function _pack_deb(debuild, package)
-- archive install files
local rootdir = package:source_rootdir()
- local oldir = os.cd(rootdir)
+ local oldir = os.cd(sourcedir)
local archivefiles = os.files("**")
os.cd(oldir)
local archivefile = _get_archivefile(package)
os.tryrm(archivefile)
archive.archive(archivefile, archivefiles, {curdir = rootdir, compress = "best"})
- -- build package, TODO modify key
- os.vrunv(debuild, {"-us", "-uc"}, {curdir = workdir})
+ -- build package
+ os.vrunv(debuild, {"-us", "-uc"}, {curdir = sourcedir})
end
function main(package)