[libideviceactivation/libimobiledevice]Upgrade version, modify build process.

This commit is contained in:
JackBoosY 2019-10-31 21:35:56 -07:00
parent 38570e216e
commit 69c0cc89d6
7 changed files with 122 additions and 51 deletions

View File

@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 3.0)
project(libideviceactivation C)
# find dependencies
find_library(libplist plist REQUIRED)
find_path(libimobiledevice_INCLUDES endianness.h)
find_library(libimobiledevice libimobiledevice REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(CURL REQUIRED)
# ready to create library
file(GLOB_RECURSE IDVCACTV_TOOLS_SRC common/*.c)
file(GLOB_RECURSE IDVCACTV_PUBLIC_HDR include/*.h)
file(GLOB_RECURSE IDVCACTV_SRC src/*.c)
add_library(libideviceactivation ${IDVCACTV_TOOLS_SRC} ${IDVCACTV_SRC} ${IDVCACTV_PUBLIC_HDR})
target_include_directories(libideviceactivation PRIVATE ${libimobiledevice_INCLUDES} ${LIBXML2_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} include)
target_compile_definitions(libideviceactivation PRIVATE -DHAVE_OPENSSL)
target_link_libraries(libideviceactivation PRIVATE ${libplist} ${libimobiledevice} ${CURL_LIBRARIES} ${LIBXML2_LIBRARIES})
# install
install(
TARGETS libideviceactivation
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/libideviceactivation-1.0.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libideviceactivation-1.0.pc
@ONLY
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libideviceactivation-1.0.pc
DESTINATION lib/libideviceactivation
)
install(FILES ${IDVCACTV_PUBLIC_HDR} DESTINATION include)

View File

@ -1,4 +1,4 @@
Source: libideviceactivation
Version: 1.2.68-1
Version: 1.2.137
Description: A library to handle the activation process of iOS devices
Build-Depends: libimobiledevice, libxml2, curl
Build-Depends: libimobiledevice, libxml2, curl, libplist

View File

@ -1,22 +0,0 @@
diff --git a/libideviceactivation.vcxproj b/libideviceactivation.vcxproj
index ba473f7a..47a20d15 100644
--- a/libideviceactivation.vcxproj
+++ b/libideviceactivation.vcxproj
@@ -76,7 +76,7 @@
<ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
- <AdditionalDependencies>libcurl.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>libcurl-d.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -89,7 +89,7 @@
<ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
- <AdditionalDependencies>libcurl.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>libcurl-d.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

View File

@ -1,23 +1,22 @@
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/libideviceactivation
REF v1.2.68
SHA512 c2742bba2d90c21e853255c9ef1b9a63560c3e65541a0a3daaace9b0c48d236b7947008dbcd6e42622251015b686758ebc6b564e379d831cb4f52af812430140
REF de6008a6bd66a96bb11468b8b137704f0fef2c54 # v1.2.137
SHA512 cdf72702c465cb3e405db067fa96e2979b8c32e7798bcdb9e7286c4bc9392639cb0d31622c321453f635ef5212e645d300f3b420a847fb16fa05425c4882be95
HEAD_REF msvc-master
PATCHES libcurl_d.patch
)
vcpkg_install_msbuild(
configure_file(${CURRENT_PORT_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH libideviceactivation.sln
INCLUDES_SUBPATH include
LICENSE_SUBPATH COPYING
USE_VCPKG_INTEGRATION
ALLOW_ROOT_INCLUDES
PREFER_NINJA
)
file(REMOVE ${CURRENT_PACKAGES_DIR}/include/Makefile.am)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

View File

@ -0,0 +1,53 @@
cmake_minimum_required(VERSION 3.0)
project(libimobiledevice C)
# find dependencies
find_library(libplist plist REQUIRED)
find_library(libusbmuxd usbmuxd REQUIRED)
find_package(OpenSSL REQUIRED)
find_path(dirent_INCLUDE_DIR dirent.h)
if (WIN32)
find_library(getopt getopt REQUIRED)
endif()
#prepare config files
configure_file(config.h.in config.h @ONLY)
# ready to create library
file(GLOB_RECURSE IMOBDEV_COMMON_HDR common/*.h)
file(GLOB_RECURSE IMOBDEV_COMMON_SRC common/*.c)
file(GLOB IMOBDEV_PUBLIC_HDR include/*.h)
file(GLOB IMOBDEV_PUBLIC_SUB_HDR include/libimobiledevice/*.h)
list(APPEND IMOBDEV_PUBLIC_HDR ${CMAKE_CURRENT_BINARY_DIR}/config.h)
file(GLOB_RECURSE IMOBDEV_PRIVATE_HDR src/*.h)
file(GLOB_RECURSE IMOBDEV_SRC src/*.c)
add_library(libimobiledevice ${IMOBDEV_SRC} ${IMOBDEV_PUBLIC_HDR} ${IMOBDEV_PUBLIC_SUB_HDR} ${IMOBDEV_PRIVATE_HDR} ${IMOBDEV_COMMON_HDR} ${IMOBDEV_COMMON_SRC})
target_include_directories(libimobiledevice PRIVATE ${dirent_INCLUDE_DIR} include .)
target_compile_definitions(libimobiledevice PRIVATE -DHAVE_OPENSSL)
target_link_libraries(libimobiledevice PRIVATE ${libplist} ${libusbmuxd} ${getopt} OpenSSL::SSL OpenSSL::Crypto)
if (WIN32)
target_link_libraries(libimobiledevice PRIVATE Ws2_32)
else()
endif()
# install
install(
TARGETS libimobiledevice
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
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 lib/libimobiledevice
)
install(FILES ${IMOBDEV_PUBLIC_HDR} DESTINATION include)
install(FILES ${IMOBDEV_PUBLIC_SUB_HDR} DESTINATION include/libimobiledevice)

View File

@ -1,4 +1,4 @@
Source: libimobiledevice
Version: 1.2.76
Version: 1.2.137
Description: A cross-platform protocol library to communicate with iOS devices
Build-Depends: libplist, libusbmuxd, openssl, dirent, getopt

View File

@ -1,20 +1,22 @@
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/libimobiledevice
REF d6b24aae971b990d2777a88ec3a1e31b40d6152f
SHA512 75e45162fecd80464846ff51c9b3e722017f738de8f6b55e9f41f5eadcd93730b12512087d427badbc0c2b54a76a66359a472ab5bc5be5fa02826db1171565d0
REF 7cf5cb4b9675ddcaed5ea3d7ee2c8848da18d691 # v1.2.137
SHA512 cfc32d3414af333d3410c292660b526f2339d210bc2cc3ddf1de87c951bff526c731c4d61609441b3c1ce8e2d1398e6d4c35fdae3e7434bfd5050e5975047a11
HEAD_REF msvc-master
)
vcpkg_install_msbuild(
configure_file(${CURRENT_PORT_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH libimobiledevice.sln
INCLUDES_SUBPATH include
LICENSE_SUBPATH COPYING
REMOVE_ROOT_INCLUDES
USE_VCPKG_INTEGRATION
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)