diff options
Diffstat (limited to 'xmake/modules/private/action/require/impl')
| -rw-r--r-- | xmake/modules/private/action/require/impl/actions/install.lua | 5 |
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") |
