Skip to content

Commit 78ba971

Browse files
authored
[kf5solid] Add imobile feature (microsoft#33888)
* [kf5solid] Add imobile feature * Update version database * Fix imobilde version * Update version database * Remove imobile from platform-default-features * Update version database
1 parent 7d5ed6b commit 78ba971

File tree

6 files changed

+97
-4
lines changed

6 files changed

+97
-4
lines changed

ports/kf5solid/002_fix_imobile.patch

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 60172b0d..1dfe6e8a 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -55,18 +55,33 @@ set_package_properties(BISON PROPERTIES
6+
PURPOSE "Required for the Predicate parser"
7+
)
8+
9+
-find_package(IMobileDevice)
10+
-set_package_properties(IMobileDevice PROPERTIES
11+
+find_package(unofficial-libimobiledevice CONFIG)
12+
+set_package_properties(unofficial-libimobiledevice PROPERTIES
13+
TYPE OPTIONAL
14+
PURPOSE "Needed to build the iOS device support backend"
15+
)
16+
17+
-find_package(PList)
18+
-set_package_properties(PList PROPERTIES
19+
+find_package(unofficial-libplist CONFIG)
20+
+set_package_properties(unofficial-libplist PROPERTIES
21+
TYPE OPTIONAL
22+
PURPOSE "Needed to build the iOS device support backend"
23+
)
24+
25+
+set(HAVE_IMOBILE OFF)
26+
+if(TARGET unofficial::libimobiledevice::libimobiledevice AND TARGET unofficial::libplist::libplist)
27+
+ set(HAVE_IMOBILE ON)
28+
+ set(IMobileDevice_VERSION "1.3.0")
29+
+ set(_imobile_version "0x00000")
30+
+ if (IMobileDevice_VERSION VERSION_GREATER_EQUAL 1.3.0)
31+
+ set(_imobile_version "0x10300")
32+
+ elseif(IMobileDevice_VERSION VERSION_GREATER_EQUAL 1.2.0)
33+
+ set(_imobile_version "0x10200")
34+
+ endif()
35+
+ set_target_properties(unofficial::libimobiledevice::libimobiledevice PROPERTIES
36+
+ INTERFACE_COMPILE_DEFINITIONS "IMOBILEDEVICE_API=${_imobile_version}"
37+
+ )
38+
+endif()
39+
+
40+
# Used by the UDisks backend on Linux
41+
find_package(LibMount)
42+
set_package_properties(LibMount PROPERTIES
43+
@@ -138,7 +153,7 @@ elseif (NOT ANDROID)
44+
endif()
45+
endif()
46+
47+
-if(IMobileDevice_FOUND AND PList_FOUND)
48+
+if(HAVE_IMOBILE)
49+
add_device_backend(imobile)
50+
endif()
51+
52+
diff --git a/KF5SolidConfig.cmake.in b/KF5SolidConfig.cmake.in
53+
index 6fc15eeb..a6250ce6 100644
54+
--- a/KF5SolidConfig.cmake.in
55+
+++ b/KF5SolidConfig.cmake.in
56+
@@ -27,6 +27,11 @@ if (NOT @BUILD_SHARED_LIBS@)
57+
find_dependency(LibMount)
58+
endif()
59+
60+
+ if (@HAVE_IMOBILE@)
61+
+ find_dependency(unofficial-libimobiledevice)
62+
+ find_dependency(unofficial-libplist)
63+
+ endif()
64+
+
65+
if ("@Qt5DBus_FOUND@" OR "@Qt6DBus_FOUND@")
66+
find_dependency(Qt@QT_MAJOR_VERSION@DBus @REQUIRED_QT_VERSION@)
67+
endif()
68+
diff --git a/src/solid/devices/backends/imobile/CMakeLists.txt b/src/solid/devices/backends/imobile/CMakeLists.txt
69+
index e1666447..3f8b982e 100644
70+
--- a/src/solid/devices/backends/imobile/CMakeLists.txt
71+
+++ b/src/solid/devices/backends/imobile/CMakeLists.txt
72+
@@ -5,7 +5,7 @@ set(backend_sources
73+
imobiledeviceinterface.cpp
74+
imobileportablemediaplayer.cpp
75+
)
76+
-set(backend_libs IMobileDevice::IMobileDevice PList::PList)
77+
+set(backend_libs unofficial::libimobiledevice::libimobiledevice unofficial::libplist::libplist)
78+
79+
ecm_qt_declare_logging_category(backend_sources
80+
HEADER imobile_debug.h

ports/kf5solid/portfile.cmake

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ vcpkg_from_github(
55
SHA512 9f0aed7f8ea29a6132ca9c99c4c744ca5580bb3f7be1712e27d1fc3ae47b2edac26a5ce20abddef4d9998612f2386e1cc6915504c02897f2b3ebcec01cd26208
66
HEAD_REF master
77
PATCHES
8-
fix-libmount.patch
8+
001_fix_libmount.patch
9+
002_fix_imobile.patch
910
)
1011

1112
if(VCPKG_TARGET_IS_OSX)
@@ -39,12 +40,12 @@ file(WRITE "${SOURCE_PATH}/.clang-format" "DisableFormat: true\nSortIncludes: fa
3940
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
4041
INVERTED_FEATURES
4142
"libmount" CMAKE_DISABLE_FIND_PACKAGE_LibMount
43+
"imobile" CMAKE_DISABLE_FIND_PACKAGE_unofficial-libimobiledevice
4244
)
4345

4446
vcpkg_cmake_configure(
4547
SOURCE_PATH "${SOURCE_PATH}"
4648
OPTIONS
47-
-DBUILD_DEVICE_BACKEND_imobile=OFF
4849
-DBUILD_TESTING=OFF
4950
-DKDE_INSTALL_QMLDIR=qml
5051
)

ports/kf5solid/vcpkg.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "kf5solid",
33
"version": "5.98.0",
4-
"port-version": 1,
4+
"port-version": 2,
55
"description": "Desktop hardware abstraction",
66
"homepage": "https://api.kde.org/frameworks/solid/html/index.html",
77
"dependencies": [
@@ -21,6 +21,13 @@
2121
"platform-default-features"
2222
],
2323
"features": {
24+
"imobile": {
25+
"description": "Used by the imobile backend",
26+
"dependencies": [
27+
"libimobiledevice",
28+
"libplist"
29+
]
30+
},
2431
"libmount": {
2532
"description": "Used by the UDisks backend on Linux",
2633
"supports": "linux",

versions/baseline.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3766,7 +3766,7 @@
37663766
},
37673767
"kf5solid": {
37683768
"baseline": "5.98.0",
3769-
"port-version": 1
3769+
"port-version": 2
37703770
},
37713771
"kf5sonnet": {
37723772
"baseline": "5.98.0",

versions/k-/kf5solid.json

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "3a95b547baf6f1c849928b20dfc319a2374f975f",
5+
"version": "5.98.0",
6+
"port-version": 2
7+
},
38
{
49
"git-tree": "7b532dd98f6da51797e2f14681dfc859fb02d8de",
510
"version": "5.98.0",

0 commit comments

Comments
 (0)