xmake.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package("babl")
  2. set_homepage("https://gegl.org/babl/")
  3. set_description("A pixel encoding and color space conversion engine.")
  4. set_license("LGPL-3.0-or-later")
  5. add_urls("https://ftp.fau.de/gimp/babl/$(version).tar.xz", {version = function (version)
  6. return format("%d.%d/babl-%s", version:major(), version:minor(), version)
  7. end})
  8. add_versions("0.1.110", "bf47be7540d6275389f66431ef03064df5376315e243d0bab448c6aa713f5743")
  9. add_configs("lcms", {description = "Build with lcms", default = false, type = "boolean"})
  10. if is_plat("mingw", "msys") then
  11. add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
  12. end
  13. if is_plat("linux", "bsd", "android") then
  14. add_syslinks("dl", "m")
  15. end
  16. add_deps("meson", "ninja")
  17. on_load(function (package)
  18. if package:config("lcms") then
  19. package:add("deps", "lcms")
  20. end
  21. end)
  22. on_install("!iphoneos and !windows and !wasm", function (package)
  23. local configs = {"-Dwith-docs=false", "-Denable-gir=false", "-Denable-vapi=false", "-Dgi-docgen=disabled"}
  24. table.insert(configs, "-Dwith-lcms=" .. (package:config("lcms") and "true" or "false"))
  25. table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
  26. import("package.tools.meson").install(package, configs)
  27. os.cp(package:installdir("include/babl-0.1/babl/*.h"), package:installdir("include/babl"))
  28. end)
  29. on_test(function (package)
  30. assert(package:has_cfuncs("babl_init", {includes = "babl/babl.h"}))
  31. end)