xmake.lua 1.3 KB

123456789101112131415161718192021222324252627
  1. package("pkg-config")
  2. set_kind("binary")
  3. set_homepage("https://freedesktop.org/wiki/Software/pkg-config/")
  4. set_description("A helper tool used when compiling applications and libraries.")
  5. if is_host("macosx", "linux", "bsd") then
  6. add_urls("https://pkgconfig.freedesktop.org/releases/pkg-config-$(version).tar.gz")
  7. add_urls("http://fresh-center.net/linux/misc/pkg-config-$(version).tar.gz")
  8. add_versions("0.29.2", "6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591")
  9. end
  10. on_install("@macosx", "@linux", "@bsd", function (package)
  11. local pcpath = {"/usr/local/lib/pkgconfig", "/usr/lib/pkgconfig"}
  12. if package:is_plat("linux") and package:is_arch("x86_64") then
  13. table.insert(pcpath, "/usr/lib64/pkgconfig")
  14. table.insert(pcpath, "/usr/lib/x86_64-linux-gnu/pkgconfig")
  15. end
  16. if is_host("macosx") then
  17. table.insert(pcpath, "/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/" .. macos.version():major() .. '.' .. macos.version():minor())
  18. end
  19. import("package.tools.autoconf").install(package, {"--disable-debug", "--disable-host-tool", "--with-internal-glib", ["with-pc-path"] = table.concat(pcpath, ':')})
  20. end)
  21. on_test(function (package)
  22. os.vrun("pkg-config --version")
  23. end)