From 8a593a2d3ad47e57064516643fd8cb8442cbb52d Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 18 Nov 2023 00:42:27 +0800 Subject: add set_prefixdir --- xmake/plugins/pack/xpack.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'xmake/plugins/pack/xpack.lua') 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 -- cgit v1.3.1