diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/ideviceinstaller | |
Diffstat (limited to 'vcpkg/ports/ideviceinstaller')
| -rw-r--r-- | vcpkg/ports/ideviceinstaller/001_fix_windows.patch | 47 | ||||
| -rw-r--r-- | vcpkg/ports/ideviceinstaller/CMakeLists.txt | 46 | ||||
| -rw-r--r-- | vcpkg/ports/ideviceinstaller/portfile.cmake | 24 | ||||
| -rw-r--r-- | vcpkg/ports/ideviceinstaller/vcpkg.json | 18 |
4 files changed, 135 insertions, 0 deletions
diff --git a/vcpkg/ports/ideviceinstaller/001_fix_windows.patch b/vcpkg/ports/ideviceinstaller/001_fix_windows.patch new file mode 100644 index 0000000..16f1149 --- /dev/null +++ b/vcpkg/ports/ideviceinstaller/001_fix_windows.patch @@ -0,0 +1,47 @@ +diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c +index c50bacf..e4a8c3d 100644 +--- a/src/ideviceinstaller.c ++++ b/src/ideviceinstaller.c +@@ -32,7 +32,9 @@ + #include <getopt.h> + #include <errno.h> + #include <time.h> ++#ifndef _MSC_VER + #include <libgen.h> ++#endif + #include <inttypes.h> + #include <limits.h> + #include <sys/stat.h> +@@ -87,6 +89,32 @@ static int asprintf(char **PTR, const char *TEMPLATE, ...) + } + #endif + ++#ifdef _MSC_VER ++#ifndef ISSLASH ++#define ISSLASH(C) ((C) == '/' || (C) == '\\') ++#endif ++char *basename(char const *name) { ++ char const *base = 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; ++} ++#endif ++ + #define ITUNES_METADATA_PLIST_FILENAME "iTunesMetadata.plist" + + const char PKG_PATH[] = "PublicStaging"; diff --git a/vcpkg/ports/ideviceinstaller/CMakeLists.txt b/vcpkg/ports/ideviceinstaller/CMakeLists.txt new file mode 100644 index 0000000..e192349 --- /dev/null +++ b/vcpkg/ports/ideviceinstaller/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.15) +project(ideviceinstaller C) + +include(GNUInstallDirs) + +file(GLOB_RECURSE IDEVICEINSTALLER_SOURCE src/*.c src/*.h) + +set(DEFINITIONS) + +list(APPEND DEFINITIONS -DPACKAGE_NAME="ideviceinstaller") +list(APPEND DEFINITIONS -DPACKAGE_VERSION="1.1.1") +list(APPEND DEFINITIONS -DPACKAGE_URL="https://github.com/libimobiledevice/ideviceinstaller") +list(APPEND DEFINITIONS -DPACKAGE_BUGREPORT="https://github.com/libimobiledevice/ideviceinstaller/issues") + +if(UNIX) + list(APPEND DEFINITIONS -DHAVE_VASPRINTF) + list(APPEND DEFINITIONS -DHAVE_ASPRINTF) + list(APPEND DEFINITIONS -DHAVE_UNISTD_H) +endif() + +if(WIN32) + list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS) + list(APPEND DEFINITIONS -DWIN32) +endif() + +find_package(unofficial-libimobiledevice CONFIG REQUIRED) +find_package(libzip CONFIG REQUIRED) +find_path(DIRENT_INCLUDE_DIR dirent.h REQUIRED) + +add_executable(ideviceinstaller ${IDEVICEINSTALLER_SOURCE}) +target_include_directories(ideviceinstaller PRIVATE + ${DIRENT_INCLUDE_DIR} +) +target_compile_definitions(ideviceinstaller PRIVATE ${DEFINITIONS}) +target_link_libraries(ideviceinstaller PRIVATE + unofficial::libimobiledevice::libimobiledevice + libzip::zip +) + +if(WIN32) + find_package(unofficial-getopt-win32 REQUIRED) + target_link_libraries(ideviceinstaller PRIVATE unofficial::getopt-win32::getopt) +endif() + +install(TARGETS ideviceinstaller + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") diff --git a/vcpkg/ports/ideviceinstaller/portfile.cmake b/vcpkg/ports/ideviceinstaller/portfile.cmake new file mode 100644 index 0000000..6f96b2e --- /dev/null +++ b/vcpkg/ports/ideviceinstaller/portfile.cmake @@ -0,0 +1,24 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO libimobiledevice/ideviceinstaller
+ REF b9cfe0b264f66eab9ad88e11eb6b0523cb1de911 # commits on 2023-07-21
+ SHA512 a78418001109593f2d704d91aff8df009e15c504c2139ca606c9719b70868466ef73778d52670468a4b7bf758ec65435c1b981c27809a2e22737f7587ad51c7d
+ HEAD_REF master
+ PATCHES
+ 001_fix_windows.patch
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_tools(TOOL_NAMES ideviceinstaller AUTO_CLEAN)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
+
+set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
diff --git a/vcpkg/ports/ideviceinstaller/vcpkg.json b/vcpkg/ports/ideviceinstaller/vcpkg.json new file mode 100644 index 0000000..0f4071a --- /dev/null +++ b/vcpkg/ports/ideviceinstaller/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "ideviceinstaller", + "version-date": "2023-07-21", + "description": "Manage apps of iOS devices", + "homepage": "https://libimobiledevice.org/", + "license": "LGPL-2.0-or-later", + "supports": "!uwp & !android & !ios & !xbox", + "dependencies": [ + "dirent", + "getopt", + "libimobiledevice", + "libzip", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |