xmake.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package("geos")
  2. set_homepage("https://trac.osgeo.org/geos/")
  3. set_description("GEOS (Geometry Engine - Open Source) is a C++ port of the JTS Topology Suite (JTS).")
  4. set_license("LGPL-2.1")
  5. add_urls("https://github.com/libgeos/geos/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/libgeos/geos.git")
  7. add_versions("3.14.1", "512118b3be3ccefbca66b36b0f3e895576d08d6ff330ba1511a31a306abbb477")
  8. add_versions("3.14.0", "47dbfad4e90073c7593ae5cfd560bc961f049af2b6868882cc1e7a9b9885a22c")
  9. add_versions("3.13.1", "724788988fa32a59b3853b876b3d865595c11dfcda7883e4e6a78e44334ac8ce")
  10. add_versions("3.13.0", "351375d3697000d94a6b3d4041f08e12221f4eb065ed412c677960a869518631")
  11. add_versions("3.12.1", "f6e2f3aaa417410d3fa4c78a9c5ef60d46097ef7ad0aee3bbbb77327350e1e01")
  12. add_versions("3.11.3", "3c517fcccdd3d562122d59c93e0982ef9bc10e775a177ad88882fca1d7d28d08")
  13. add_versions("3.9.1", "e9e20e83572645ac2af0af523b40a404627ce74b3ec99727754391cdf5b23645")
  14. add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
  15. add_links("geos_c", "geos")
  16. add_deps("cmake")
  17. if on_check then
  18. on_check("android", function (package)
  19. local ndk = package:toolchain("ndk"):config("ndkver")
  20. assert(ndk and tonumber(ndk) > 22, "package(geos) require ndk version > 22")
  21. end)
  22. end
  23. on_install(function (package)
  24. local configs = {"-DBUILD_BENCHMARKS=OFF", "-DBUILD_TESTING=OFF"}
  25. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  26. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  27. table.insert(configs, "-DBUILD_GEOSOP=" .. (package:config("tools") and "ON" or "OFF"))
  28. import("package.tools.cmake").install(package, configs)
  29. end)
  30. on_test(function (package)
  31. assert(package:has_cfuncs("initGEOS", {includes = "geos_c.h"}))
  32. end)