xmake.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. package("libplist")
  2. set_homepage("https://www.libimobiledevice.org/")
  3. set_description("Library for Apple Binary- and XML-Property Lists")
  4. set_license("LGPL-2.1")
  5. set_urls("https://github.com/libimobiledevice/libplist/archive/$(version).tar.gz",
  6. "https://github.com/libimobiledevice/libplist.git")
  7. add_versions("2.2.0", "7e654bdd5d8b96f03240227ed09057377f06ebad08e1c37d0cfa2abe6ba0cee2")
  8. add_deps("autoconf", "automake", "libtool", "pkg-config")
  9. if is_plat("linux") then
  10. add_syslinks("pthread")
  11. end
  12. on_install("macosx", "linux", "mingw@macosx", "iphoneos", "cross", function (package)
  13. local configs = {"--disable-dependency-tracking",
  14. "--disable-silent-rules",
  15. "--without-cython"}
  16. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  17. table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
  18. local cxflags
  19. if package:is_plat("linux") and package:config("pic") ~= false then
  20. cxflags = "-fPIC"
  21. end
  22. io.replace("src/plist.c", "void thread_once", "static void thread_once")
  23. import("package.tools.autoconf").install(package, configs, {cxflags = cxflags})
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("plist_new_dict", {includes = "plist/plist.h"}))
  27. end)