ソースを参照

improve usbmuxd (#777)

* Update usbmuxd to later version

maintainers refactored some functions in libusbmuxd to
a separate library, libimobiledevice-glue. But a new version haven't
released yet. Add a new git version.

* Update xmake.lua

* Update xmake.lua

* fix libusbmuxd

Co-authored-by: Kelvin Zhang <[email protected]>
ruki 3 年 前
コミット
959f324176

+ 10 - 2
packages/l/libimobiledevice-glue/xmake.lua

@@ -6,9 +6,17 @@ package("libimobiledevice-glue")
     add_urls("https://github.com/libimobiledevice/libimobiledevice-glue.git")
     add_urls("https://github.com/libimobiledevice/libimobiledevice-glue.git")
     add_versions("2021.11.24", "106cea58ae2d92fc755705a79e1753b3750edd15")
     add_versions("2021.11.24", "106cea58ae2d92fc755705a79e1753b3750edd15")
 
 
-    add_deps("libplist")
-    on_install("macosx", "linux", function (package)
+    add_deps("autoconf", "automake", "libplist")
+
+    if is_plat("windows", "mingw") then
+        add_syslinks("ws2_32", "iphlpapi")
+    end
+
+    on_install("macosx", "linux", "mingw@macosx", function (package)
         local configs = {}
         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-shared=" .. (package:config("shared") and "yes" or "no"))
         table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
         table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
         table.insert(configs, "--enable-debug=" .. (package:config("debug") and "yes" or "no"))
         table.insert(configs, "--enable-debug=" .. (package:config("debug") and "yes" or "no"))

+ 1 - 0
packages/l/libplist/xmake.lua

@@ -24,6 +24,7 @@ package("libplist")
         if package:is_plat("linux") and package:config("pic") ~= false then
         if package:is_plat("linux") and package:config("pic") ~= false then
             cxflags = "-fPIC"
             cxflags = "-fPIC"
         end
         end
+        io.replace("src/plist.c", "void thread_once", "static void thread_once")
         import("package.tools.autoconf").install(package, configs, {cxflags = cxflags})
         import("package.tools.autoconf").install(package, configs, {cxflags = cxflags})
     end)
     end)
 
 

+ 4 - 23
packages/l/libusbmuxd/xmake.lua

@@ -4,22 +4,14 @@ package("libusbmuxd")
     set_description("A client library to multiplex connections from and to iOS devices")
     set_description("A client library to multiplex connections from and to iOS devices")
     set_license("LGPL-2.1")
     set_license("LGPL-2.1")
 
 
-    add_urls("https://github.com/libimobiledevice/libusbmuxd/archive/refs/tags/$(version).tar.gz",
-             "https://github.com/libimobiledevice/libusbmuxd.git")
-    add_versions("2.0.2", "8ae3e1d9340177f8f3a785be276435869363de79f491d05d8a84a59efc8a8fdc")
+    add_urls("https://github.com/libimobiledevice/libusbmuxd.git")
+    add_versions("2021.09.13", "2ec5354a6ff2ba5e2740eabe7402186f29294f79")
+    add_deps("libimobiledevice-glue")
 
 
     if is_plat("windows", "mingw") then
     if is_plat("windows", "mingw") then
         add_syslinks("ws2_32")
         add_syslinks("ws2_32")
     end
     end
 
 
-    on_load(function (package)
-        if package:is_plat("mingw") and package:config("shared") then
-            package:add("deps", "libplist", {configs = {shared = true}})
-        else
-            package:add("deps", "libplist")
-        end
-    end)
-
     on_install("macosx", "linux", "mingw@macosx", function (package)
     on_install("macosx", "linux", "mingw@macosx", function (package)
         local configs = {}
         local configs = {}
         table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
         table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
@@ -27,19 +19,8 @@ package("libusbmuxd")
         if package:is_plat("linux") and package:config("pic") ~= false then
         if package:is_plat("linux") and package:config("pic") ~= false then
             table.insert(configs, "--with-pic")
             table.insert(configs, "--with-pic")
         end
         end
-        local cflags
-        if package:is_plat("mingw") then
-            -- disable ifaddrs for mingw
-            cflags = {"-DWIN32", "-D_WIN32_WINNT=0x0600"}
-            io.replace("common/socket.c", "AF_INET6", "AF_INET6_")
-        end
-        -- disable tools
         io.replace("tools/Makefile.am", "bin_PROGRAMS = iproxy inetcat", "bin_PROGRAMS =")
         io.replace("tools/Makefile.am", "bin_PROGRAMS = iproxy inetcat", "bin_PROGRAMS =")
-        -- fix multiple definition with libplist
-        io.replace("common/thread.c", " thread_once(", " thread_once_(", {plain = true})
-        io.replace("common/thread.h", " thread_once(", " thread_once_(", {plain = true})
-        io.replace("src/libusbmuxd.c", "\tthread_once(", " thread_once_(", {plain = true})
-        import("package.tools.autoconf").install(package, configs, {cflags = cflags})
+        import("package.tools.autoconf").install(package, configs)
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)