2
0

xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829
  1. package("mpc")
  2. set_homepage("http://www.multiprecision.org/mpc/")
  3. set_description("GNU MPC is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result.")
  4. set_license("LGPL-3.0")
  5. add_urls("https://ftpmirror.gnu.org/gnu/mpc/mpc-$(version).tar.gz",
  6. "https://ftp.gnu.org/gnu/mpc/mpc-$(version).tar.gz")
  7. add_versions("1.2.1", "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459")
  8. add_versions("1.3.1", "ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8")
  9. add_deps("gmp", "mpfr")
  10. on_install("macosx", "linux", function (package)
  11. local configs = {"--disable-dependency-tracking"}
  12. table.insert(configs, "--with-gmp=" .. package:dep("gmp"):installdir())
  13. table.insert(configs, "--with-mpfr=" .. package:dep("mpfr"):installdir())
  14. if package:config("shared") then
  15. table.insert(configs, "--enable-shared=yes")
  16. table.insert(configs, "--enable-static=no")
  17. else
  18. table.insert(configs, "--enable-static=yes")
  19. table.insert(configs, "--enable-shared=no")
  20. end
  21. import("package.tools.autoconf").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cfuncs("mpc_add", {includes = "mpc.h"}))
  25. end)