aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/kf5solid
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/kf5solid')
-rw-r--r--vcpkg/ports/kf5solid/001_fix_libmount.patch15
-rw-r--r--vcpkg/ports/kf5solid/002_fix_imobile.patch61
-rw-r--r--vcpkg/ports/kf5solid/portfile.cmake75
-rw-r--r--vcpkg/ports/kf5solid/vcpkg.json42
4 files changed, 193 insertions, 0 deletions
diff --git a/vcpkg/ports/kf5solid/001_fix_libmount.patch b/vcpkg/ports/kf5solid/001_fix_libmount.patch
new file mode 100644
index 0000000..b5360c3
--- /dev/null
+++ b/vcpkg/ports/kf5solid/001_fix_libmount.patch
@@ -0,0 +1,15 @@
+diff --git a/KF5SolidConfig.cmake.in b/KF5SolidConfig.cmake.in
+index 0a23f44..7020804 100644
+--- a/KF5SolidConfig.cmake.in
++++ b/KF5SolidConfig.cmake.in
+@@ -23,6 +23,10 @@ if (NOT @BUILD_SHARED_LIBS@)
+ find_dependency(Qt@QT_MAJOR_VERSION@Xml @REQUIRED_QT_VERSION@)
+ find_dependency(Qt@QT_MAJOR_VERSION@Gui @REQUIRED_QT_VERSION@)
+
++ if (@HAVE_LIBMOUNT@)
++ find_dependency(LibMount)
++ endif()
++
+ if ("@Qt5DBus_FOUND@" OR "@Qt6DBus_FOUND@")
+ find_dependency(Qt@QT_MAJOR_VERSION@DBus @REQUIRED_QT_VERSION@)
+ endif()
diff --git a/vcpkg/ports/kf5solid/002_fix_imobile.patch b/vcpkg/ports/kf5solid/002_fix_imobile.patch
new file mode 100644
index 0000000..4089fd3
--- /dev/null
+++ b/vcpkg/ports/kf5solid/002_fix_imobile.patch
@@ -0,0 +1,61 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 60172b0d..1dfe6e8a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -55,13 +55,25 @@ set_package_properties(BISON PROPERTIES
+ PURPOSE "Required for the Predicate parser"
+ )
+
+-find_package(IMobileDevice)
++find_package(IMobileDevice NAMES unofficial-libimobiledevice)
+ set_package_properties(IMobileDevice PROPERTIES
+ TYPE OPTIONAL
+ PURPOSE "Needed to build the iOS device support backend"
+ )
++if(TARGET unofficial::libimobiledevice::libimobiledevice)
++ 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()
+
+-find_package(PList)
++find_package(PList NAMES unofficial-libplist CONFIG)
+ set_package_properties(PList PROPERTIES
+ TYPE OPTIONAL
+ PURPOSE "Needed to build the iOS device support backend"
+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 ("@IMobileDevice_FOUND@" AND "@PList_FOUND@")
++ 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
diff --git a/vcpkg/ports/kf5solid/portfile.cmake b/vcpkg/ports/kf5solid/portfile.cmake
new file mode 100644
index 0000000..d58a920
--- /dev/null
+++ b/vcpkg/ports/kf5solid/portfile.cmake
@@ -0,0 +1,75 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO KDE/solid
+ REF v5.98.0
+ SHA512 9f0aed7f8ea29a6132ca9c99c4c744ca5580bb3f7be1712e27d1fc3ae47b2edac26a5ce20abddef4d9998612f2386e1cc6915504c02897f2b3ebcec01cd26208
+ HEAD_REF master
+ PATCHES
+ 001_fix_libmount.patch
+ 002_fix_imobile.patch
+)
+# Prevent KDEClangFormat from writing to source effectively blocking parallel configure
+file(WRITE "${SOURCE_PATH}/.clang-format" "DisableFormat: true\nSortIncludes: false\n")
+
+if(VCPKG_TARGET_IS_OSX)
+ # On Darwin platform, the bundled version of 'bison' may be too old (< 3.0).
+ vcpkg_find_acquire_program(BISON)
+ execute_process(
+ COMMAND "${BISON}" --version
+ OUTPUT_VARIABLE BISON_OUTPUT
+ )
+ string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" BISON_VERSION "${BISON_OUTPUT}")
+ set(BISON_MAJOR ${CMAKE_MATCH_1})
+ set(BISON_MINOR ${CMAKE_MATCH_2})
+ message(STATUS "Using bison: ${BISON_MAJOR}.${BISON_MINOR}.${CMAKE_MATCH_3}")
+ if(NOT (BISON_MAJOR GREATER_EQUAL 3 AND BISON_MINOR GREATER_EQUAL 0))
+ message(WARNING "${PORT} requires bison version greater than one provided by macOS, please use \`brew install bison\` to install a newer bison.")
+ endif()
+endif()
+
+vcpkg_find_acquire_program(BISON)
+vcpkg_find_acquire_program(FLEX)
+
+get_filename_component(FLEX_DIR "${FLEX}" DIRECTORY)
+get_filename_component(BISON_DIR "${BISON}" DIRECTORY)
+
+vcpkg_add_to_path(PREPEND "${FLEX_DIR}")
+vcpkg_add_to_path(PREPEND "${BISON_DIR}")
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ libmount CMAKE_REQUIRE_FIND_PACKAGE_LibMount
+ imobile CMAKE_REQUIRE_FIND_PACKAGE_IMobileDevice
+ imobile CMAKE_REQUIRE_FIND_PACKAGE_PList
+ INVERTED_FEATURES
+ libmount CMAKE_DISABLE_FIND_PACKAGE_LibMount
+ imobile CMAKE_DISABLE_FIND_PACKAGE_IMobileDevice
+ imobile CMAKE_DISABLE_FIND_PACKAGE_PList
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DBUILD_TESTING=OFF
+ -DKDE_INSTALL_QMLDIR=qml
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/KF5Solid)
+vcpkg_copy_pdbs()
+
+vcpkg_copy_tools(
+ TOOL_NAMES solid-hardware5
+ AUTO_CLEAN
+)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ # Until https://github.com/microsoft/vcpkg/pull/34091
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+file(GLOB LICENSE_FILES "${SOURCE_PATH}/LICENSES/*")
+vcpkg_install_copyright(FILE_LIST ${LICENSE_FILES})
diff --git a/vcpkg/ports/kf5solid/vcpkg.json b/vcpkg/ports/kf5solid/vcpkg.json
new file mode 100644
index 0000000..51a5e45
--- /dev/null
+++ b/vcpkg/ports/kf5solid/vcpkg.json
@@ -0,0 +1,42 @@
+{
+ "name": "kf5solid",
+ "version": "5.98.0",
+ "port-version": 3,
+ "description": "Desktop hardware abstraction",
+ "homepage": "https://api.kde.org/frameworks/solid/html/index.html",
+ "dependencies": [
+ "ecm",
+ "qt5-base",
+ "qt5-tools",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ {
+ "name": "libmount",
+ "platform": "linux"
+ }
+ ],
+ "features": {
+ "imobile": {
+ "description": "Used by the imobile backend",
+ "dependencies": [
+ "libimobiledevice",
+ "libplist"
+ ]
+ },
+ "libmount": {
+ "description": "Used by the UDisks backend on Linux",
+ "supports": "linux",
+ "dependencies": [
+ "libmount"
+ ]
+ }
+ }
+}