From bb19e46dc93c092b9be318dffe887813364de8bb Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Tue, 21 Dec 2021 17:34:49 -0500 Subject: [PATCH] Add libimobiledevice (#778) --- packages/l/libimobiledevice/xmake.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/l/libimobiledevice/xmake.lua diff --git a/packages/l/libimobiledevice/xmake.lua b/packages/l/libimobiledevice/xmake.lua new file mode 100644 index 000000000..df2e7b560 --- /dev/null +++ b/packages/l/libimobiledevice/xmake.lua @@ -0,0 +1,25 @@ +package("libimobiledevice") + + set_homepage("https://github.com/libimobiledevice/libimobiledevice") + set_description("A cross-platform protocol library to communicate with iOS devices") + + add_urls("https://github.com/libimobiledevice/libimobiledevice/archive/refs/tags/$(version).tar.gz", + "https://github.com/libimobiledevice/libimobiledevice.git") + add_versions("1.3.0", "acbfb73eabee162e64c0d9de207d71c0a5f47c40cd5ad32a5097f734328ce10a") + + add_deps("libplist", "libusbmuxd", "openssl", "libimobiledevice-glue") + on_install("macosx", "linux", function (package) + io.replace("tools/Makefile.am", "bin_PROGRAMS = \\", "bin_PROGRAMS =") + local configs = {} + if package:is_plat("linux") and package:config("pic") ~= false then + table.insert(configs, "--with-pic") + end + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + table.insert(configs, "--enable-debug=" .. (package:config("debug") and "yes" or "no")) + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("idevice_event_subscribe", {includes = "libimobiledevice/libimobiledevice.h"})) + end)