diff options
| author | chooyy <[email protected]> | 2025-12-01 14:50:41 +0800 |
|---|---|---|
| committer | chooyy <[email protected]> | 2025-12-01 14:50:41 +0800 |
| commit | d51dfaebebec3f3f3886cf12f1f683021991cac9 (patch) | |
| tree | 1b3537b64d294ad5050ae9a7ef2d47cc32fc4ef6 | |
| parent | e6833974942a093cee2bbfc5d39f3ac154495cd6 (diff) | |
fix pacman find package
| -rw-r--r-- | xmake/modules/package/manager/pacman/find_package.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xmake/modules/package/manager/pacman/find_package.lua b/xmake/modules/package/manager/pacman/find_package.lua index 7a38b0f46..af7fd837f 100644 --- a/xmake/modules/package/manager/pacman/find_package.lua +++ b/xmake/modules/package/manager/pacman/find_package.lua @@ -218,8 +218,6 @@ function main(name, opt) result.libfiles = result.libfiles or {} table.insert(result.libfiles, libfile) end - -- version should be the same if a pacman package contains multiples .pc - result.version = pcresult.version result.shared = pcresult.shared result.static = pcresult.static end @@ -238,6 +236,11 @@ function main(name, opt) if result.links then result.links = table.reverse_unique(result.links) end + + -- We should get version from pacman, because if a pacman package contains multiples .pc we may get a wrong version + local version = try { function() return os.iorunv(pacman.program, {"-Q", name}) end } + version = version:trim():split('%s+')[2] + result.version = version:split('-')[1] else -- if there is no .pc, we parse the package content to obtain the data we want result = _find_package_from_list(list, name, pacman, opt) |
