xmake.lua 1.3 KB

12345678910111213141516171819202122232425
  1. package("libimobiledevice")
  2. set_homepage("https://github.com/libimobiledevice/libimobiledevice")
  3. set_description("A cross-platform protocol library to communicate with iOS devices")
  4. add_urls("https://github.com/libimobiledevice/libimobiledevice/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/libimobiledevice/libimobiledevice.git")
  6. add_versions("1.3.0", "acbfb73eabee162e64c0d9de207d71c0a5f47c40cd5ad32a5097f734328ce10a")
  7. add_deps("libplist", "libusbmuxd", "openssl", "libimobiledevice-glue")
  8. on_install("macosx", "linux", function (package)
  9. io.replace("tools/Makefile.am", "bin_PROGRAMS = \\", "bin_PROGRAMS =")
  10. local configs = {}
  11. if package:is_plat("linux") and package:config("pic") ~= false then
  12. table.insert(configs, "--with-pic")
  13. end
  14. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  15. table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
  16. table.insert(configs, "--enable-debug=" .. (package:config("debug") and "yes" or "no"))
  17. import("package.tools.autoconf").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:has_cfuncs("idevice_event_subscribe", {includes = "libimobiledevice/libimobiledevice.h"}))
  21. end)