diff options
| author | ruki <[email protected]> | 2023-11-18 00:42:27 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-18 00:42:27 +0800 |
| commit | 8a593a2d3ad47e57064516643fd8cb8442cbb52d (patch) | |
| tree | ad565098d347bcc293f0f635cf6e6816a9d7054d /xmake/plugins/pack/xpack.lua | |
| parent | 4ec6682dea22ec5a2e4b818700288e625f761d52 (diff) | |
add set_prefixdir
Diffstat (limited to 'xmake/plugins/pack/xpack.lua')
| -rw-r--r-- | xmake/plugins/pack/xpack.lua | 14 |
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 |
