xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("swisseph")
  2. set_homepage("https://www.astro.com/swisseph/")
  3. set_description("The SWISS EPHEMERIS is the high precision ephemeris developed by Astrodienst")
  4. set_urls("https://github.com/aloistr/swisseph/archive/refs/tags/$(version).zip")
  5. add_versions("v2.10.03", "4e32fd543e8d9cd99eb58dbd67128feb1c52ab160ca8223a4045d4a2f814f8a4")
  6. on_install("linux", "macosx", function (package)
  7. io.writefile("xmake.lua", [[
  8. add_rules("mode.debug", "mode.release")
  9. target("swisseph")
  10. set_kind("$(kind)")
  11. add_files(
  12. "swedate.c",
  13. "swehouse.c",
  14. "swejpl.c",
  15. "swemmoon.c",
  16. "swemplan.c",
  17. "sweph.c",
  18. "swephlib.c",
  19. "swecl.c",
  20. "swehel.c"
  21. )
  22. add_headerfiles("*.h", {prefixdir = "swisseph"})
  23. ]])
  24. local configs = {}
  25. if package:config("shared") then
  26. configs.kind = "shared"
  27. end
  28. import("package.tools.xmake").install(package, configs)
  29. end)
  30. on_test("linux", "macosx", function (package)
  31. assert(package:has_cfuncs("swe_version", {includes = {"swisseph/swephexp.h", "swisseph/sweph.h"}}))
  32. end)