Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kf5solid] Add imobile feature #33888

Merged
merged 6 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions ports/kf5solid/002_fix_imobile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 60172b0d..1dfe6e8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,18 +55,33 @@ set_package_properties(BISON PROPERTIES
PURPOSE "Required for the Predicate parser"
)

-find_package(IMobileDevice)
-set_package_properties(IMobileDevice PROPERTIES
+find_package(unofficial-libimobiledevice CONFIG)
+set_package_properties(unofficial-libimobiledevice PROPERTIES
TYPE OPTIONAL
PURPOSE "Needed to build the iOS device support backend"
)

-find_package(PList)
-set_package_properties(PList PROPERTIES
+find_package(unofficial-libplist CONFIG)
+set_package_properties(unofficial-libplist PROPERTIES
TYPE OPTIONAL
PURPOSE "Needed to build the iOS device support backend"
)

+set(HAVE_IMOBILE OFF)
+if(TARGET unofficial::libimobiledevice::libimobiledevice AND TARGET unofficial::libplist::libplist)
+ set(HAVE_IMOBILE ON)
+ set(IMobileDevice_VERSION "1.3.0")
+ set(_imobile_version "0x00000")
+ if (IMobileDevice_VERSION VERSION_GREATER_EQUAL 1.3.0)
+ set(_imobile_version "0x10300")
+ elseif(IMobileDevice_VERSION VERSION_GREATER_EQUAL 1.2.0)
+ set(_imobile_version "0x10200")
+ endif()
+ set_target_properties(unofficial::libimobiledevice::libimobiledevice PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "IMOBILEDEVICE_API=${_imobile_version}"
+ )
+endif()
+
# Used by the UDisks backend on Linux
find_package(LibMount)
set_package_properties(LibMount PROPERTIES
@@ -138,7 +153,7 @@ elseif (NOT ANDROID)
endif()
endif()

-if(IMobileDevice_FOUND AND PList_FOUND)
+if(HAVE_IMOBILE)
add_device_backend(imobile)
endif()

diff --git a/KF5SolidConfig.cmake.in b/KF5SolidConfig.cmake.in
index 6fc15eeb..a6250ce6 100644
--- a/KF5SolidConfig.cmake.in
+++ b/KF5SolidConfig.cmake.in
@@ -27,6 +27,11 @@ if (NOT @BUILD_SHARED_LIBS@)
find_dependency(LibMount)
endif()

+ if (@HAVE_IMOBILE@)
+ find_dependency(unofficial-libimobiledevice)
+ find_dependency(unofficial-libplist)
+ endif()
+
if ("@Qt5DBus_FOUND@" OR "@Qt6DBus_FOUND@")
find_dependency(Qt@QT_MAJOR_VERSION@DBus @REQUIRED_QT_VERSION@)
endif()
diff --git a/src/solid/devices/backends/imobile/CMakeLists.txt b/src/solid/devices/backends/imobile/CMakeLists.txt
index e1666447..3f8b982e 100644
--- a/src/solid/devices/backends/imobile/CMakeLists.txt
+++ b/src/solid/devices/backends/imobile/CMakeLists.txt
@@ -5,7 +5,7 @@ set(backend_sources
imobiledeviceinterface.cpp
imobileportablemediaplayer.cpp
)
-set(backend_libs IMobileDevice::IMobileDevice PList::PList)
+set(backend_libs unofficial::libimobiledevice::libimobiledevice unofficial::libplist::libplist)

ecm_qt_declare_logging_category(backend_sources
HEADER imobile_debug.h
5 changes: 3 additions & 2 deletions ports/kf5solid/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ vcpkg_from_github(
SHA512 9f0aed7f8ea29a6132ca9c99c4c744ca5580bb3f7be1712e27d1fc3ae47b2edac26a5ce20abddef4d9998612f2386e1cc6915504c02897f2b3ebcec01cd26208
HEAD_REF master
PATCHES
fix-libmount.patch
001_fix_libmount.patch
002_fix_imobile.patch
)

if(VCPKG_TARGET_IS_OSX)
Expand Down Expand Up @@ -39,12 +40,12 @@ file(WRITE "${SOURCE_PATH}/.clang-format" "DisableFormat: true\nSortIncludes: fa
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
INVERTED_FEATURES
"libmount" CMAKE_DISABLE_FIND_PACKAGE_LibMount
"imobile" CMAKE_DISABLE_FIND_PACKAGE_unofficial-libimobiledevice
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_DEVICE_BACKEND_imobile=OFF
-DBUILD_TESTING=OFF
-DKDE_INSTALL_QMLDIR=qml
)
Expand Down
9 changes: 8 additions & 1 deletion ports/kf5solid/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kf5solid",
"version": "5.98.0",
"port-version": 1,
"port-version": 2,
"description": "Desktop hardware abstraction",
"homepage": "https://api.kde.org/frameworks/solid/html/index.html",
"dependencies": [
Expand All @@ -21,6 +21,13 @@
"platform-default-features"
],
"features": {
"imobile": {
"description": "Used by the imobile backend",
"dependencies": [
"libimobiledevice",
"libplist"
]
},
"libmount": {
"description": "Used by the UDisks backend on Linux",
"supports": "linux",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3742,7 +3742,7 @@
},
"kf5solid": {
"baseline": "5.98.0",
"port-version": 1
"port-version": 2
},
"kf5sonnet": {
"baseline": "5.98.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/k-/kf5solid.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3a95b547baf6f1c849928b20dfc319a2374f975f",
"version": "5.98.0",
"port-version": 2
},
{
"git-tree": "7b532dd98f6da51797e2f14681dfc859fb02d8de",
"version": "5.98.0",
Expand Down
Loading