summaryrefslogtreecommitdiff
path: root/xmake/plugins/pack/xpack.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/plugins/pack/xpack.lua')
-rw-r--r--xmake/plugins/pack/xpack.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua
index 71fd3ac08..d0dc56697 100644
--- a/xmake/plugins/pack/xpack.lua
+++ b/xmake/plugins/pack/xpack.lua
@@ -446,10 +446,20 @@ function xpack:installfiles()
return self:_copiedfiles("installfiles", self:installdir())
end
--- get the install directory, this is just a temporary sandbox installation path,
+-- get the root directory, this is just a temporary sandbox installation path,
-- we may replace it with the actual installation path in the specfile
+function xpack:rootdir()
+ return path.join(self:buildir(), "installed", self:format())
+end
+
+-- get the installed directory
function xpack:installdir(...)
- return path.normalize(path.join(self:buildir(), "installed", self:format(), ...))
+ local installdir = self:rootdir()
+ local prefixdir = self:get("prefixdir")
+ if prefixdir then
+ installdir = path.join(installdir, prefixdir)
+ end
+ return path.normalize(path.join(installdir, ...))
end
-- get the binary directory