summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua25
1 files changed, 24 insertions, 1 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 9a69ddc58..f6afc7845 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -182,7 +182,7 @@ end
function _instance:installdir(...)
-- make the given install directory
- local dir = path.join(self:directory(), "install", ...)
+ local dir = path.join(self:cachedir(), "install", ...)
-- ensure the install directory
if not os.isdir(dir) then
@@ -191,6 +191,16 @@ function _instance:installdir(...)
return dir
end
+-- get the prefix directory
+function _instance:prefixdir(...)
+ return package.prefixdir(self:from("global"), ...)
+end
+
+-- get the prefix info file
+function _instance:prefixfile()
+ return path.join(self:prefixdir(".info"), self:name() .. "-" .. (self:version_str() or "") .. ".txt")
+end
+
-- get the downloaded original file
function _instance:originfile()
return self._ORIGINFILE
@@ -540,6 +550,19 @@ function package.cachedir()
return path.join(global.directory(), "cache", "packages")
end
+-- get the prefix directory
+function package.prefixdir(is_global, ...)
+
+ -- make the given prefix directory
+ local dir = path.join(package.directory(is_global), "prefix", config.get("plat") or os.host(), config.get("arch") or os.arch(), ...)
+
+ -- ensure the prefix directory
+ if not os.isdir(dir) then
+ os.mkdir(dir)
+ end
+ return dir
+end
+
-- load the package from the system directories
function package.load_from_system(packagename)