diff options
Diffstat (limited to 'vcpkg/ports/libimobiledevice')
| -rw-r--r-- | vcpkg/ports/libimobiledevice/001_fix_msvc.patch | 166 | ||||
| -rw-r--r-- | vcpkg/ports/libimobiledevice/002_fix_static_build.patch | 22 | ||||
| -rw-r--r-- | vcpkg/ports/libimobiledevice/003_fix_api.patch | 21 | ||||
| -rw-r--r-- | vcpkg/ports/libimobiledevice/004_fix_tools_msvc.patch | 273 | ||||
| -rw-r--r-- | vcpkg/ports/libimobiledevice/CMakeLists.txt | 183 | ||||
| -rw-r--r-- | vcpkg/ports/libimobiledevice/exports.def | 369 | ||||
| -rw-r--r-- | vcpkg/ports/libimobiledevice/portfile.cmake | 71 | ||||
| -rw-r--r-- | vcpkg/ports/libimobiledevice/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/libimobiledevice/vcpkg.json | 33 |
9 files changed, 1142 insertions, 0 deletions
diff --git a/vcpkg/ports/libimobiledevice/001_fix_msvc.patch b/vcpkg/ports/libimobiledevice/001_fix_msvc.patch new file mode 100644 index 0000000..bea25f0 --- /dev/null +++ b/vcpkg/ports/libimobiledevice/001_fix_msvc.patch @@ -0,0 +1,166 @@ +diff --git a/common/userpref.c b/common/userpref.c +index b64c703..7ff325c 100644 +--- a/common/userpref.c ++++ b/common/userpref.c +@@ -35,7 +35,9 @@ + #ifndef WIN32 + #include <pwd.h> + #endif ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <usbmuxd.h> + #if defined(HAVE_OPENSSL) + #include <openssl/bn.h> +@@ -65,7 +67,9 @@ + #endif + + #include <dirent.h> ++#ifndef _MSC_VER + #include <libgen.h> ++#endif + #include <sys/stat.h> + #include <errno.h> + +diff --git a/include/libimobiledevice/libimobiledevice.h b/include/libimobiledevice/libimobiledevice.h +index 6851145..55ef753 100644 +--- a/include/libimobiledevice/libimobiledevice.h ++++ b/include/libimobiledevice/libimobiledevice.h +@@ -30,6 +30,11 @@ + extern "C" { + #endif + ++#if defined(_MSC_VER) ++#include <BaseTsd.h> ++typedef SSIZE_T ssize_t; ++#endif ++ + #include <stdint.h> + #include <sys/types.h> + #include <sys/stat.h> +diff --git a/src/afc.c b/src/afc.c +index d8c3db0..ab2c4ff 100644 +--- a/src/afc.c ++++ b/src/afc.c +@@ -26,7 +26,9 @@ + #endif + #include <stdio.h> + #include <stdlib.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <string.h> + + #include "afc.h" +diff --git a/src/house_arrest.c b/src/house_arrest.c +index ac92130..e12bde5 100644 +--- a/src/house_arrest.c ++++ b/src/house_arrest.c +@@ -24,7 +24,9 @@ + #endif + #include <string.h> + #include <stdlib.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <plist/plist.h> + + #include "house_arrest.h" +diff --git a/src/installation_proxy.c b/src/installation_proxy.c +index 9602876..2f02514 100644 +--- a/src/installation_proxy.c ++++ b/src/installation_proxy.c +@@ -26,7 +26,9 @@ + #include <string.h> + #include <stdlib.h> + #include <inttypes.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <plist/plist.h> + + #include "installation_proxy.h" +diff --git a/src/lockdown-cu.c b/src/lockdown-cu.c +index d8d7f42..eb11afa 100644 +--- a/src/lockdown-cu.c ++++ b/src/lockdown-cu.c +@@ -29,7 +29,9 @@ + #define __USE_GNU 1 + #include <stdio.h> + #include <ctype.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <plist/plist.h> + + #include "idevice.h" +diff --git a/src/lockdown.c b/src/lockdown.c +index 92af186..a9b9b88 100644 +--- a/src/lockdown.c ++++ b/src/lockdown.c +@@ -32,7 +32,9 @@ + #define __USE_GNU 1 + #include <stdio.h> + #include <ctype.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <plist/plist.h> + #include <libimobiledevice-glue/utils.h> + +diff --git a/src/misagent.c b/src/misagent.c +index af925f9..5fe618e 100644 +--- a/src/misagent.c ++++ b/src/misagent.c +@@ -24,7 +24,9 @@ + #endif + #include <string.h> + #include <stdlib.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <plist/plist.h> + #include <stdio.h> + +diff --git a/src/mobile_image_mounter.c b/src/mobile_image_mounter.c +index 9ccfd85..c4f540c 100644 +--- a/src/mobile_image_mounter.c ++++ b/src/mobile_image_mounter.c +@@ -24,7 +24,9 @@ + #endif + #include <string.h> + #include <stdlib.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <plist/plist.h> + + #include "mobile_image_mounter.h" +diff --git a/src/notification_proxy.c b/src/notification_proxy.c +index e17e2fe..679739c 100644 +--- a/src/notification_proxy.c ++++ b/src/notification_proxy.c +@@ -24,7 +24,9 @@ + #endif + #include <string.h> + #include <stdlib.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <plist/plist.h> + + #include "notification_proxy.h" +diff --git a/src/sbservices.c b/src/sbservices.c +index ccb7c4b..f0b832e 100644 +--- a/src/sbservices.c ++++ b/src/sbservices.c +@@ -24,7 +24,9 @@ + #endif + #include <string.h> + #include <stdlib.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <plist/plist.h> + + #include "sbservices.h" diff --git a/vcpkg/ports/libimobiledevice/002_fix_static_build.patch b/vcpkg/ports/libimobiledevice/002_fix_static_build.patch new file mode 100644 index 0000000..3ea317b --- /dev/null +++ b/vcpkg/ports/libimobiledevice/002_fix_static_build.patch @@ -0,0 +1,22 @@ +diff --git a/src/idevice.c b/src/idevice.c +index 719cd28..0ae8a1c 100644 +--- a/src/idevice.c ++++ b/src/idevice.c +@@ -124,6 +124,8 @@ static void id_function(CRYPTO_THREADID *thread) + #endif + #endif /* HAVE_OPENSSL */ + ++#ifndef LIBIMOBILEDEVICE_STATIC // disable dll constructor ++ + static void internal_idevice_init(void) + { + #if defined(HAVE_OPENSSL) +@@ -219,6 +221,8 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved) + #warning No compiler support for constructor/destructor attributes, some features might not be available. + #endif + ++#endif // disable dll constructor ++ + struct idevice_subscription_context { + idevice_event_cb_t callback; + void *user_data; diff --git a/vcpkg/ports/libimobiledevice/003_fix_api.patch b/vcpkg/ports/libimobiledevice/003_fix_api.patch new file mode 100644 index 0000000..1558ab6 --- /dev/null +++ b/vcpkg/ports/libimobiledevice/003_fix_api.patch @@ -0,0 +1,21 @@ +diff --git a/src/idevice.h b/src/idevice.h +index 2509e48..384f178 100644 +--- a/src/idevice.h ++++ b/src/idevice.h +@@ -37,15 +37,11 @@ + #include <mbedtls/ctr_drbg.h> + #endif + +-#ifdef WIN32 +-#define LIBIMOBILEDEVICE_API __declspec( dllexport ) +-#else +-#ifdef HAVE_FVISIBILITY ++#if !defined(_WIN32) && !defined(LIBIMOBILEDEVICEGLUE_STATIC) + #define LIBIMOBILEDEVICE_API __attribute__((visibility("default"))) + #else + #define LIBIMOBILEDEVICE_API + #endif +-#endif + + #include "common/userpref.h" + #include "libimobiledevice/libimobiledevice.h" diff --git a/vcpkg/ports/libimobiledevice/004_fix_tools_msvc.patch b/vcpkg/ports/libimobiledevice/004_fix_tools_msvc.patch new file mode 100644 index 0000000..395eb1d --- /dev/null +++ b/vcpkg/ports/libimobiledevice/004_fix_tools_msvc.patch @@ -0,0 +1,273 @@ +diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c +index 5694c12..77fd81f 100644 +--- a/tools/idevicebackup.c ++++ b/tools/idevicebackup.c +@@ -50,7 +50,9 @@ + #else + #error No supported crypto library enabled + #endif ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <ctype.h> + #include <time.h> + +@@ -68,6 +70,18 @@ + #define LOCK_ATTEMPTS 50 + #define LOCK_WAIT 200000 + ++#ifdef _MSC_VER ++static void usleep(__int64 usec) { ++ HANDLE timer; ++ LARGE_INTEGER ft; ++ ft.QuadPart = -(10*usec); ++ timer = CreateWaitableTimer(NULL, TRUE, NULL); ++ SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0); ++ WaitForSingleObject(timer, INFINITE); ++ CloseHandle(timer); ++} ++#endif ++ + #ifdef WIN32 + #include <windows.h> + #define sleep(x) Sleep(x*1000) +diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c +index c73b269..33157c9 100644 +--- a/tools/idevicebackup2.c ++++ b/tools/idevicebackup2.c +@@ -31,9 +31,13 @@ + #include <errno.h> + #include <stdlib.h> + #include <signal.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <dirent.h> ++#ifndef _MSC_VER + #include <libgen.h> ++#endif + #include <ctype.h> + #include <time.h> + #include <getopt.h> +@@ -54,6 +58,62 @@ + #define LOCK_ATTEMPTS 50 + #define LOCK_WAIT 200000 + ++#ifdef _MSC_VER ++static void usleep(__int64 usec) { ++ HANDLE timer; ++ LARGE_INTEGER ft; ++ ft.QuadPart = -(10*usec); ++ timer = CreateWaitableTimer(NULL, TRUE, NULL); ++ SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0); ++ WaitForSingleObject(timer, INFINITE); ++ CloseHandle(timer); ++} ++#ifndef ISSLASH ++#define ISSLASH(C) ((C) == '/' || (C) == '\\') ++#endif ++#ifndef FILESYSTEM_PREFIX_LEN ++#define FILESYSTEM_PREFIX_LEN(Filename) 0 ++#endif ++static char *basename(char const *name) { ++ char const *base = name + FILESYSTEM_PREFIX_LEN(name); ++ char const *p; ++ ++ for (p = base; *p; p++) { ++ if (ISSLASH(*p)) { ++ do p++; ++ while (ISSLASH(*p)); ++ ++ if (!*p) { ++ if (ISSLASH(*base)) ++ base = p - 1; ++ break; ++ } ++ base = p; ++ } ++ } ++ ++ return (char *) base; ++} ++static size_t dirlen(char const *path) { ++ size_t prefix_length = FILESYSTEM_PREFIX_LEN(path); ++ size_t length; ++ for (length = basename(path) - path; prefix_length < length; length--) ++ if (!ISSLASH(path[length - 1])) ++ return length; ++ return prefix_length + ISSLASH(path[prefix_length]); ++} ++static char *dirname(char const *path) { ++ size_t length = dirlen(path); ++ int append_dot = (length == FILESYSTEM_PREFIX_LEN(path)); ++ char *newpath = (char *) malloc(length + append_dot + 1); ++ memcpy(newpath, path, length); ++ if (append_dot) ++ newpath[length++] = '.'; ++ newpath[length] = 0; ++ return newpath; ++} ++#endif ++ + #ifdef WIN32 + #include <windows.h> + #include <conio.h> +diff --git a/tools/idevicebtlogger.c b/tools/idevicebtlogger.c +index 8de6b22..8fbf40d 100644 +--- a/tools/idevicebtlogger.c ++++ b/tools/idevicebtlogger.c +@@ -31,7 +31,9 @@ + #include <errno.h> + #include <signal.h> + #include <stdlib.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <getopt.h> + #include <assert.h> + #include <fcntl.h> +diff --git a/tools/idevicecrashreport.c b/tools/idevicecrashreport.c +index 09bd537..9f53b30 100644 +--- a/tools/idevicecrashreport.c ++++ b/tools/idevicecrashreport.c +@@ -29,7 +29,14 @@ + #include <stdio.h> + #include <stdlib.h> + #include <string.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#else ++#define S_IFIFO _S_IFIFO ++#define S_IFBLK 0x3000 ++#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) ++#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) ++#endif + #include <getopt.h> + #ifndef WIN32 + #include <signal.h> +diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c +index 36c594e..9c11781 100644 +--- a/tools/idevicedebug.c ++++ b/tools/idevicedebug.c +@@ -30,8 +30,12 @@ + #include <stdlib.h> + #include <string.h> + #include <time.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif ++#ifndef _MSC_VER + #include <libgen.h> ++#endif + #include <getopt.h> + + #ifdef WIN32 +diff --git a/tools/idevicedevmodectl.c b/tools/idevicedevmodectl.c +index ba9b935..8e28e4b 100644 +--- a/tools/idevicedevmodectl.c ++++ b/tools/idevicedevmodectl.c +@@ -30,7 +30,9 @@ + #include <string.h> + #include <getopt.h> + #include <sys/stat.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <errno.h> + #ifndef WIN32 + #include <signal.h> +diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c +index f551b6c..26bb80c 100644 +--- a/tools/ideviceimagemounter.c ++++ b/tools/ideviceimagemounter.c +@@ -32,9 +32,13 @@ + #include <string.h> + #include <getopt.h> + #include <errno.h> ++#ifndef _MSC_VER + #include <libgen.h> ++#endif + #include <time.h> ++#ifndef _MSC_VER + #include <sys/time.h> ++#endif + #include <inttypes.h> + #ifndef WIN32 + #include <signal.h> +diff --git a/tools/idevicename.c b/tools/idevicename.c +index 69b76f6..cb8c9a6 100644 +--- a/tools/idevicename.c ++++ b/tools/idevicename.c +@@ -27,7 +27,9 @@ + + #include <stdio.h> + #include <string.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <stdlib.h> + #include <getopt.h> + #ifndef WIN32 +diff --git a/tools/idevicepair.c b/tools/idevicepair.c +index 94d3f04..129c409 100644 +--- a/tools/idevicepair.c ++++ b/tools/idevicepair.c +@@ -31,7 +31,9 @@ + #include <stdlib.h> + #include <getopt.h> + #include <ctype.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #ifdef WIN32 + #include <windows.h> + #include <conio.h> +diff --git a/tools/ideviceprovision.c b/tools/ideviceprovision.c +index 4080a28..f64e2c4 100644 +--- a/tools/ideviceprovision.c ++++ b/tools/ideviceprovision.c +@@ -42,6 +42,14 @@ + #include <arpa/inet.h> + #endif + ++#ifdef _MSC_VER ++#include <Winsock2.h> ++#ifndef _S_ISTYPE ++#define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask)) ++#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR) ++#endif ++#endif ++ + #include <libimobiledevice/libimobiledevice.h> + #include <libimobiledevice/lockdown.h> + #include <libimobiledevice/misagent.h> +diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c +index 0e694c7..6f4b1c5 100644 +--- a/tools/idevicescreenshot.c ++++ b/tools/idevicescreenshot.c +@@ -31,7 +31,11 @@ + #include <getopt.h> + #include <errno.h> + #include <time.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#else ++#define F_OK 0 ++#endif + #ifndef WIN32 + #include <signal.h> + #endif +diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c +index 5600be2..69b7b03 100644 +--- a/tools/idevicesyslog.c ++++ b/tools/idevicesyslog.c +@@ -31,7 +31,9 @@ + #include <errno.h> + #include <signal.h> + #include <stdlib.h> ++#ifndef _MSC_VER + #include <unistd.h> ++#endif + #include <getopt.h> + + #ifdef WIN32 diff --git a/vcpkg/ports/libimobiledevice/CMakeLists.txt b/vcpkg/ports/libimobiledevice/CMakeLists.txt new file mode 100644 index 0000000..e8980cf --- /dev/null +++ b/vcpkg/ports/libimobiledevice/CMakeLists.txt @@ -0,0 +1,183 @@ +cmake_minimum_required(VERSION 3.15) +project(libimobiledevice C) + +option(BUILD_TOOLS "Build tools." OFF) + +include(GNUInstallDirs) + +file(GLOB_RECURSE LIBIMOBILEDEVICE_SOURCE src/*.c src/*.h) +file(GLOB_RECURSE LIBIMOBILEDEVICE_COMMON_SOURCE common/*.c common/*.h) + +set(DEFINITIONS) + +list(APPEND DEFINITIONS -DHAVE_OPENSSL) + +if(BUILD_SHARED_LIBS) + if(WIN32) + list(APPEND LIBIMOBILEDEVICE_SOURCE exports.def) + endif() +else() + list(APPEND DEFINITIONS -DLIBIMOBILEDEVICE_STATIC) +endif() + +if(UNIX) + list(APPEND DEFINITIONS -DHAVE_STPCPY) + list(APPEND DEFINITIONS -DHAVE_VASPRINTF) + list(APPEND DEFINITIONS -DHAVE_ASPRINTF) + list(APPEND DEFINITIONS -DHAVE_GETIFADDRS) +endif() + +if(WIN32) + list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS) + list(APPEND DEFINITIONS -DWIN32_LEAN_AND_MEAN) + list(APPEND DEFINITIONS -DWIN32) +endif() + +find_package(unofficial-libplist CONFIG REQUIRED) +find_package(unofficial-libimobiledevice-glue CONFIG REQUIRED) +find_package(unofficial-libusbmuxd CONFIG REQUIRED) +find_package(OpenSSL REQUIRED) + +add_library(libimobiledevice ${LIBIMOBILEDEVICE_SOURCE} ${LIBIMOBILEDEVICE_COMMON_SOURCE}) +target_include_directories(libimobiledevice PUBLIC + "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>" + "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>" + "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>" +) +target_compile_definitions(libimobiledevice PRIVATE ${DEFINITIONS}) +target_link_libraries(libimobiledevice + PRIVATE + unofficial::libimobiledevice-glue::libimobiledevice-glue + unofficial::libusbmuxd::libusbmuxd + OpenSSL::SSL + OpenSSL::Crypto + PUBLIC + unofficial::libplist::libplist +) +set_target_properties(libimobiledevice PROPERTIES OUTPUT_NAME imobiledevice-1.0) + +if(WIN32) + target_link_libraries(libimobiledevice PRIVATE Ws2_32) +endif() + +install(TARGETS libimobiledevice EXPORT unofficial-libimobiledevice) + +install( + EXPORT unofficial-libimobiledevice + FILE unofficial-libimobiledevice-config.cmake + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-libimobiledevice" + NAMESPACE unofficial::libimobiledevice:: +) + +install( + DIRECTORY "${CMAKE_SOURCE_DIR}/include/libimobiledevice" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) + +install( + FILES "${CMAKE_SOURCE_DIR}/include/endianness.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) + +set(LIBPLIST_VERSION 2.0) +set(LIMD_GLUE_VERSION 1.0) +set(LIBUSBMUXD_VERSION 2.0) +set(PACKAGE_NAME libimobiledevice) +set(PACKAGE_VERSION 1.0) +set(prefix "") +set(exec_prefix "\${prefix}") +set(libdir "\${prefix}/lib") +set(includedir "\${prefix}/include") + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/src/libimobiledevice-1.0.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/libimobiledevice-1.0.pc" + @ONLY +) +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/libimobiledevice-1.0.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" +) + +if(BUILD_TOOLS) + if(WIN32) + find_package(unofficial-getopt-win32 REQUIRED) + endif() + + function(add_tool name source) + add_executable("${name}" "${source}" ${LIBIMOBILEDEVICE_COMMON_SOURCE}) + target_compile_definitions("${name}" PRIVATE + -DPACKAGE_VERSION="2.0.2" + -DPACKAGE_URL="https://github.com/libimobiledevice/libusbmuxd" + -DPACKAGE_BUGREPORT="https://github.com/libimobiledevice/libusbmuxd/issues" + -DHAVE_OPENSSL + ) + target_link_libraries("${name}" PRIVATE + libimobiledevice + unofficial::libimobiledevice-glue::libimobiledevice-glue + unofficial::libusbmuxd::libusbmuxd + OpenSSL::SSL + OpenSSL::Crypto + ) + if(WIN32) + target_compile_definitions("${name}" PRIVATE + -D_CRT_SECURE_NO_WARNINGS + -DWIN32_LEAN_AND_MEAN + -DWIN32 + ) + target_link_libraries("${name}" PRIVATE unofficial::getopt-win32::getopt Ws2_32) + endif() + if(UNIX) + target_compile_definitions("${name}" PRIVATE + -DHAVE_VASPRINTF + -DHAVE_ASPRINTF + ) + endif() + endfunction(add_tool) + + add_tool(idevice_id "tools/idevice_id.c") + add_tool(idevicebackup "tools/idevicebackup.c") + add_tool(idevicebackup2 "tools/idevicebackup2.c") + add_tool(idevicebtlogger "tools/idevicebtlogger.c") + add_tool(idevicecrashreport "tools/idevicecrashreport.c") + add_tool(idevicedate "tools/idevicedate.c") + add_tool(idevicedebug "tools/idevicedebug.c") + add_tool(idevicedebugserverproxy "tools/idevicedebugserverproxy.c") + add_tool(idevicedevmodectl "tools/idevicedevmodectl.c") + add_tool(idevicediagnostics "tools/idevicediagnostics.c") + add_tool(ideviceenterrecovery "tools/ideviceenterrecovery.c") + add_tool(ideviceimagemounter "tools/ideviceimagemounter.c") + add_tool(ideviceinfo "tools/ideviceinfo.c") + add_tool(idevicename "tools/idevicename.c") + add_tool(idevicenotificationproxy "tools/idevicenotificationproxy.c") + add_tool(idevicepair "tools/idevicepair.c") + add_tool(ideviceprovision "tools/ideviceprovision.c") + add_tool(idevicescreenshot "tools/idevicescreenshot.c") + add_tool(idevicesetlocation "tools/idevicesetlocation.c") + add_tool(idevicesyslog "tools/idevicesyslog.c") + + install( + TARGETS + idevice_id + idevicebackup + idevicebackup2 + idevicebtlogger + idevicecrashreport + idevicedate + idevicedebug + idevicedebugserverproxy + idevicedevmodectl + idevicediagnostics + ideviceenterrecovery + ideviceimagemounter + ideviceinfo + idevicename + idevicenotificationproxy + idevicepair + ideviceprovision + idevicescreenshot + idevicesetlocation + idevicesyslog + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) +endif() diff --git a/vcpkg/ports/libimobiledevice/exports.def b/vcpkg/ports/libimobiledevice/exports.def new file mode 100644 index 0000000..a9f63d0 --- /dev/null +++ b/vcpkg/ports/libimobiledevice/exports.def @@ -0,0 +1,369 @@ +EXPORTS + + ; src/mobilebackup2.c + mobilebackup2_client_new + mobilebackup2_client_start_service + mobilebackup2_client_free + mobilebackup2_send_message + mobilebackup2_receive_message + mobilebackup2_send_raw + mobilebackup2_receive_raw + mobilebackup2_version_exchange + mobilebackup2_send_request + mobilebackup2_send_status_response + + ; src/misagent.c + misagent_client_new + misagent_client_start_service + misagent_client_free + misagent_install + misagent_copy + misagent_copy_all + misagent_remove + misagent_get_status_code + + ; src/mobileactivation.c + mobileactivation_client_new + mobileactivation_client_start_service + mobileactivation_client_free + mobileactivation_get_activation_state + mobileactivation_create_activation_session_info + mobileactivation_create_activation_info + mobileactivation_create_activation_info_with_session + mobileactivation_activate + mobileactivation_activate_with_session + mobileactivation_deactivate + + ; src/heartbeat.c + heartbeat_client_new + heartbeat_client_start_service + heartbeat_client_free + heartbeat_send + heartbeat_receive + heartbeat_receive_with_timeout + + ; src/lockdown-cu.c + lockdownd_cu_pairing_create + lockdownd_cu_send_request_and_get_reply + lockdownd_get_value_cu + lockdownd_pair_cu + + ; src/preboard.c + preboard_client_new + preboard_client_start_service + preboard_client_free + preboard_send + preboard_receive_with_timeout + preboard_receive + preboard_create_stashbag + preboard_commit_stashbag + + ; src/screenshotr.c + screenshotr_client_new + screenshotr_client_start_service + screenshotr_client_free + screenshotr_take_screenshot + + ; src/property_list_service.c + property_list_service_client_new + property_list_service_client_free + property_list_service_send_xml_plist + property_list_service_send_binary_plist + property_list_service_receive_plist_with_timeout + property_list_service_receive_plist + property_list_service_enable_ssl + property_list_service_disable_ssl + property_list_service_get_service_client + + ; src/file_relay.c + file_relay_client_new + file_relay_client_start_service + file_relay_client_free + file_relay_request_sources_timeout + file_relay_request_sources + + ; src/reverse_proxy.c + reverse_proxy_client_start_proxy + reverse_proxy_client_create_with_service + reverse_proxy_client_create_with_port + reverse_proxy_client_free + reverse_proxy_get_type + reverse_proxy_client_set_status_callback + reverse_proxy_client_set_log_callback + reverse_proxy_client_set_data_callback + + ; src/service.c + service_client_new + service_client_factory_start_service + service_client_free + service_send + service_receive_with_timeout + service_receive + service_enable_ssl + service_disable_ssl + service_disable_bypass_ssl + service_get_connection + + ; src/installation_proxy.c + instproxy_client_new + instproxy_client_start_service + instproxy_client_free + instproxy_browse_with_callback + instproxy_browse + instproxy_lookup + instproxy_install + instproxy_upgrade + instproxy_uninstall + instproxy_lookup_archives + instproxy_archive + instproxy_restore + instproxy_remove_archive + instproxy_check_capabilities_match + instproxy_status_get_error + instproxy_status_get_name + instproxy_status_get_percent_complete + instproxy_status_get_current_list + instproxy_command_get_name + instproxy_client_options_new + instproxy_client_options_add + instproxy_client_options_set_return_attributes + instproxy_client_options_free + instproxy_client_get_path_for_bundle_identifier + + ; src/companion_proxy.c + companion_proxy_client_new + companion_proxy_client_start_service + companion_proxy_client_free + companion_proxy_send + companion_proxy_receive + companion_proxy_get_device_registry + companion_proxy_start_listening_for_devices + companion_proxy_stop_listening_for_devices + companion_proxy_get_value_from_registry + companion_proxy_start_forwarding_service_port + companion_proxy_stop_forwarding_service_port + + ; src/restore.c + restored_client_free + restored_client_set_label + restored_receive + restored_send + restored_query_type + restored_query_value + restored_get_value + restored_client_new + restored_goodbye + restored_start_restore + restored_reboot + + ; src/notification_proxy.c + np_client_new + np_client_start_service + np_client_free + np_post_notification + np_observe_notification + np_observe_notifications + np_set_notify_callback + + ; src/house_arrest.c + house_arrest_client_new + house_arrest_client_start_service + house_arrest_client_free + house_arrest_send_request + house_arrest_send_command + house_arrest_get_result + afc_client_new_from_house_arrest_client + + ; src/mobilesync.c + mobilesync_client_new + mobilesync_client_start_service + mobilesync_client_free + mobilesync_receive + mobilesync_send + mobilesync_start + mobilesync_finish + mobilesync_get_all_records_from_device + mobilesync_get_changes_from_device + mobilesync_receive_changes + mobilesync_clear_all_records_on_device + mobilesync_acknowledge_changes_from_device + mobilesync_ready_to_send_changes_from_computer + mobilesync_send_changes + mobilesync_remap_identifiers + mobilesync_cancel + mobilesync_anchors_new + mobilesync_anchors_free + mobilesync_actions_new + mobilesync_actions_add + mobilesync_actions_free + + ; src/idevice.c + idevice_events_subscribe + idevice_events_unsubscribe + idevice_event_subscribe + idevice_event_unsubscribe + idevice_get_device_list_extended + idevice_device_list_extended_free + idevice_get_device_list + idevice_device_list_free + idevice_set_debug_level + idevice_new_with_options + idevice_new + idevice_free + idevice_connect + idevice_disconnect + idevice_connection_send + idevice_connection_receive_timeout + idevice_connection_receive + idevice_connection_get_fd + idevice_get_handle + idevice_get_udid + idevice_connection_enable_ssl + idevice_connection_disable_ssl + idevice_connection_disable_bypass_ssl + + ; src/mobilebackup.c + mobilebackup_client_new + mobilebackup_client_start_service + mobilebackup_client_free + mobilebackup_receive + mobilebackup_send + mobilebackup_request_backup + mobilebackup_send_backup_file_received + mobilebackup_request_restore + mobilebackup_receive_restore_file_received + mobilebackup_receive_restore_application_received + mobilebackup_send_restore_complete + mobilebackup_send_error + + ; src/diagnostics_relay.c + diagnostics_relay_client_new + diagnostics_relay_client_start_service + diagnostics_relay_client_free + diagnostics_relay_goodbye + diagnostics_relay_sleep + diagnostics_relay_restart + diagnostics_relay_shutdown + diagnostics_relay_request_diagnostics + diagnostics_relay_query_mobilegestalt + diagnostics_relay_query_ioregistry_entry + diagnostics_relay_query_ioregistry_plane + + ; src/webinspector.c + webinspector_client_new + webinspector_client_start_service + webinspector_client_free + webinspector_send + webinspector_receive + webinspector_receive_with_timeout + + ; src/afc.c + afc_client_new_with_service_client + afc_client_new + afc_client_start_service + afc_client_free + afc_read_directory + afc_get_device_info + afc_get_device_info_key + afc_remove_path + afc_rename_path + afc_make_directory + afc_get_file_info + afc_file_open + afc_file_read + afc_file_write + afc_file_close + afc_file_lock + afc_file_seek + afc_file_tell + afc_file_truncate + afc_truncate + afc_make_link + afc_set_file_time + afc_remove_path_and_contents + afc_dictionary_free + + ; src/debugserver.c + debugserver_client_new + debugserver_client_start_service + debugserver_client_free + debugserver_client_send + debugserver_client_receive_with_timeout + debugserver_client_receive + debugserver_command_new + debugserver_command_free + debugserver_encode_string + debugserver_decode_string + debugserver_client_set_ack_mode + debugserver_client_set_receive_params + debugserver_client_receive_response + debugserver_client_send_command + debugserver_client_set_environment_hex_encoded + debugserver_client_set_argv + + ; src/sbservices.c + sbservices_client_new + sbservices_client_start_service + sbservices_client_free + sbservices_get_icon_state + sbservices_set_icon_state + sbservices_get_icon_pngdata + sbservices_get_interface_orientation + sbservices_get_home_screen_wallpaper_pngdata + + ; src/bt_packet_logger.c + bt_packet_logger_client_new + bt_packet_logger_client_start_service + bt_packet_logger_client_free + bt_packet_logger_receive_with_timeout + bt_packet_logger_start_capture + bt_packet_logger_stop_capture + + ; src/mobile_image_mounter.c + mobile_image_mounter_new + mobile_image_mounter_start_service + mobile_image_mounter_free + mobile_image_mounter_lookup_image + mobile_image_mounter_upload_image + mobile_image_mounter_mount_image + mobile_image_mounter_hangup + + ; src/lockdown.c + lockdownd_stop_session + lockdownd_client_free + lockdownd_client_set_label + lockdownd_receive + lockdownd_send + lockdownd_query_type + lockdownd_get_value + lockdownd_set_value + lockdownd_remove_value + lockdownd_get_device_udid + lockdownd_get_device_name + lockdownd_client_new + lockdownd_client_new_with_handshake + lockdownd_pair + lockdownd_pair_with_options + lockdownd_validate_pair + lockdownd_unpair + lockdownd_enter_recovery + lockdownd_goodbye + lockdownd_start_session + lockdownd_start_service + lockdownd_start_service_with_escrow_bag + lockdownd_activate + lockdownd_deactivate + lockdownd_get_sync_data_classes + lockdownd_data_classes_free + lockdownd_service_descriptor_free + lockdownd_strerror + + ; src/syslog_relay.c + syslog_relay_client_new + syslog_relay_client_start_service + syslog_relay_client_free + syslog_relay_receive + syslog_relay_receive_with_timeout + syslog_relay_start_capture + syslog_relay_start_capture_raw + syslog_relay_stop_capture diff --git a/vcpkg/ports/libimobiledevice/portfile.cmake b/vcpkg/ports/libimobiledevice/portfile.cmake new file mode 100644 index 0000000..81a788f --- /dev/null +++ b/vcpkg/ports/libimobiledevice/portfile.cmake @@ -0,0 +1,71 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO libimobiledevice/libimobiledevice
+ REF 6fc41f57fc607df9b07446ca45bdf754225c9bd9 # commits on 2023-07-05
+ SHA512 0ceae43eb5c193c173536a20a6efde44b0ff4b5e6029342f59cb6b0dcad2fd629713db922f17b331b5f359a649b5402c18637e636bcdb5eb5c53bec12ff94903
+ HEAD_REF master
+ PATCHES
+ 001_fix_msvc.patch
+ 002_fix_static_build.patch
+ 003_fix_api.patch
+ 004_fix_tools_msvc.patch
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ tools BUILD_TOOLS
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
+vcpkg_fixup_pkgconfig()
+if("tools" IN_LIST FEATURES)
+ vcpkg_copy_tools(
+ TOOL_NAMES
+ idevice_id
+ idevicebackup
+ idevicebackup2
+ idevicebtlogger
+ idevicecrashreport
+ idevicedate
+ idevicedebug
+ idevicedebugserverproxy
+ idevicedevmodectl
+ idevicediagnostics
+ ideviceenterrecovery
+ ideviceimagemounter
+ ideviceinfo
+ idevicename
+ idevicenotificationproxy
+ idevicepair
+ ideviceprovision
+ idevicescreenshot
+ idevicesetlocation
+ idevicesyslog
+ AUTO_CLEAN
+ )
+endif()
+
+file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" cmake_config)
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake"
+"include(CMakeFindDependencyMacro)
+find_dependency(unofficial-libplist CONFIG)
+find_dependency(unofficial-libimobiledevice-glue CONFIG)
+find_dependency(unofficial-libusbmuxd CONFIG)
+find_dependency(OpenSSL)
+${cmake_config}
+")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
diff --git a/vcpkg/ports/libimobiledevice/usage b/vcpkg/ports/libimobiledevice/usage new file mode 100644 index 0000000..566ef2b --- /dev/null +++ b/vcpkg/ports/libimobiledevice/usage @@ -0,0 +1,4 @@ +libimobiledevice provides CMake targets: + + find_package(unofficial-libimobiledevice CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::libimobiledevice::libimobiledevice) diff --git a/vcpkg/ports/libimobiledevice/vcpkg.json b/vcpkg/ports/libimobiledevice/vcpkg.json new file mode 100644 index 0000000..a288fe6 --- /dev/null +++ b/vcpkg/ports/libimobiledevice/vcpkg.json @@ -0,0 +1,33 @@ +{ + "name": "libimobiledevice", + "version-date": "2023-07-05", + "port-version": 1, + "description": "A cross-platform protocol library to communicate with iOS devices", + "homepage": "http://www.libimobiledevice.org", + "license": "LGPL-2.1-or-later", + "supports": "!uwp", + "dependencies": [ + "dirent", + "libimobiledevice-glue", + "libplist", + "libusbmuxd", + "openssl", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "tools": { + "description": "build command line tool", + "supports": "!android & !ios & !xbox", + "dependencies": [ + "getopt" + ] + } + } +} |