summaryrefslogtreecommitdiff
path: root/xmake/modules/private/action/require/impl
diff options
context:
space:
mode:
authorruki <[email protected]>2026-06-06 23:54:01 +0800
committerruki <[email protected]>2026-06-06 23:54:01 +0800
commit5d85aa086f8999114a913f2b212b53285614e87c (patch)
tree13a4904a5c1901b10872c2d4a86564eee27adcd0 /xmake/modules/private/action/require/impl
parent2245e0b6ed0f954aae1dafe225c2b436ae98cfcd (diff)
improve package pathpackage
Diffstat (limited to 'xmake/modules/private/action/require/impl')
-rw-r--r--xmake/modules/private/action/require/impl/actions/install.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua
index 57257b7f6..7fb54a951 100644
--- a/xmake/modules/private/action/require/impl/actions/install.lua
+++ b/xmake/modules/private/action/require/impl/actions/install.lua
@@ -56,8 +56,9 @@ function _patch_pkgconfig(package)
local pcfile_content, count = pcfile_content:replace(installdir, "${installdir}", {plain = true})
if count > 0 then
local line_ending = pcfile_content:find("\r\n") and "\r\n" or "\n"
+ local pcfiledir = path.unix(path.normalize(path.directory(pcfile)))
pcfile_content = "# Modified by Xmake: Using relative paths to make package relocatable" .. line_ending
- .. "installdir=${pcfiledir}/" .. path.unix(path.relative(installdir, path.directory(pcfile))) .. line_ending
+ .. "installdir=${pcfiledir}/" .. path.unix(path.relative(installdir, pcfiledir)) .. line_ending
.. pcfile_content
io.writefile(pcfile, pcfile_content)
end
@@ -111,7 +112,7 @@ function _patch_pkgconfig(package)
-- @see https://github.com/xmake-io/xmake-repo/pull/8165#discussion_r2366249416
local version = package:version_str():ltrim("v")
file:print("# Generated by Xmake")
- file:print("prefix=%s", "${pcfiledir}/" .. path.unix(path.relative(installdir, path.directory(pcfile))))
+ file:print("prefix=%s", "${pcfiledir}/" .. path.unix(path.relative(installdir, path.unix(path.normalize(path.directory(pcfile))))))
file:print("exec_prefix=${prefix}")
file:print("libdir=${exec_prefix}/lib")
file:print("includedir=${prefix}/include")