Skip to content

Commit

Permalink
feat: update kf6-solid to 6.8.0
Browse files Browse the repository at this point in the history
Qt library to query and control hardware

Issue: deepin-community/sig-deepin-sysdev-team#558
Log: update repo
  • Loading branch information
xzl01 committed Jan 3, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent dafcf24 commit 1106488
Showing 397 changed files with 141,029 additions and 33 deletions.
5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# clang-format
006e013d18c20cf2c98cf1776d768476978a1a63

# astyle
81ed03badcacf22c525b382a39072323c70b5bc4
11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: 2020 Volker Krause <[email protected]>
# SPDX-License-Identifier: CC0-1.0

include:
- project: sysadmin/ci-utilities
file:
- /gitlab-templates/linux-qt6.yml
- /gitlab-templates/android-qt6.yml
- /gitlab-templates/freebsd-qt6.yml
- /gitlab-templates/windows-qt6.yml
- /gitlab-templates/alpine-qt6.yml
8 changes: 8 additions & 0 deletions .kde-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dependencies:
- 'on': ['@all']
'require':
'frameworks/extra-cmake-modules': '@same'

Options:
test-before-installing: True
require-passing-tests-on: [ 'Linux', 'FreeBSD', 'Windows' ]
185 changes: 185 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
cmake_minimum_required(VERSION 3.16)

set(KF_VERSION "6.8.0") # handled by release scripts
project(Solid VERSION ${KF_VERSION})

include(FeatureSummary)
find_package(ECM 6.8.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)


set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

include(KDEInstallDirs)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)

include(KDEGitCommitHooks)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)

set(REQUIRED_QT_VERSION 6.5.0)
find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Xml Gui)


# shall we use DBus?
# enabled per default on Linux & BSD systems
# Android has no DBus, and Windows & Mac have backends that don't use DBus
set(USE_DBUS_DEFAULT OFF)
if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT HAIKU)
set(USE_DBUS_DEFAULT ON)
endif()
option(USE_DBUS "Build components using DBus" ${USE_DBUS_DEFAULT})
if(USE_DBUS)
find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus)
set(HAVE_DBUS TRUE)
add_definitions(-DHAVE_DBUS)
endif()

if(WIN32)
find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Network)
endif()

include(ECMGenerateExportHeader)
include(CMakePackageConfigHelpers)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMMarkNonGuiExecutable)
include(ECMAddQch)

find_package(FLEX REQUIRED)
set_package_properties(FLEX PROPERTIES
URL "http://flex.sourceforge.net"
DESCRIPTION "Fast Lexical Analyzer"
TYPE REQUIRED
PURPOSE "Required for the Predicate parser"
)

find_package(BISON 3.0 REQUIRED)
set_package_properties(BISON PROPERTIES
URL "http://www.gnu.org/software/bison"
DESCRIPTION "general-purpose parser generator"
TYPE REQUIRED
PURPOSE "Required for the Predicate parser"
)

find_package(IMobileDevice)
set_package_properties(IMobileDevice PROPERTIES
TYPE OPTIONAL
PURPOSE "Needed to build the iOS device support backend"
)

find_package(PList)
set_package_properties(PList PROPERTIES
TYPE OPTIONAL
PURPOSE "Needed to build the iOS device support backend"
)

if (CMAKE_SYSTEM_NAME MATCHES Linux)
# Used by the UDisks backend on Linux
find_package(LibMount)
set_package_properties(LibMount PROPERTIES
TYPE REQUIRED)
endif()

include(ECMPoQmTools)

set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")

option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")

set(solid_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/solid/solid_version.h")
ecm_setup_version(PROJECT VARIABLE_PREFIX SOLID
VERSION_HEADER "${solid_version_header}"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6SolidConfigVersion.cmake"
SOVERSION 6)

ecm_set_disabled_deprecation_versions(
QT 6.5
)

ecm_install_po_files_as_qm(poqm)

include(SolidBackendsMacros)

add_device_backends_begin()
add_device_backend(fakehw)
if (CMAKE_SYSTEM_NAME MATCHES Linux)
option(UDEV_DISABLED "Allows disabling UDev usage on Linux builds" OFF)
if (NOT UDEV_DISABLED)
find_package(UDev REQUIRED)
set_package_properties(UDev PROPERTIES
TYPE REQUIRED
PURPOSE "Allows Solid to use UDev to provide information about devices on Linux"
)
endif()
if (UDev_FOUND)
set(UDEV_FOUND TRUE) # for config-solid.h
add_device_backend(udev)
endif()
set(HAVE_LIBMOUNT ${LibMount_FOUND})
add_device_backend(udisks2)
add_device_backend(fstab)
add_device_backend(upower)
elseif (APPLE)
find_package(IOKit REQUIRED)
add_device_backend(iokit)
elseif (WIN32)
add_device_backend(win)
elseif (NOT ANDROID)
add_device_backend(upower)
add_device_backend(fstab)

if (CMAKE_SYSTEM_NAME MATCHES FreeBSD OR CMAKE_SYSTEM_NAME MATCHES OpenBSD)
add_device_backend(udisks2)
endif()
endif()

if(IMobileDevice_FOUND AND PList_FOUND)
add_device_backend(imobile)
endif()

add_device_backends_cmake()

add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(autotests)
endif()

# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6Solid")

if (BUILD_QCH)
ecm_install_qch_export(
TARGETS KF6Solid_QCH
FILE KF6SolidQchTargets.cmake
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6SolidQchTargets.cmake\")")
endif()

configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF6SolidConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF6SolidConfig.cmake"
PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF6SolidConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF6SolidConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel )

install(EXPORT KF6SolidTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF6SolidTargets.cmake NAMESPACE KF6:: )

install(FILES ${solid_version_header}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/Solid COMPONENT Devel
)

include(ECMFeatureSummary)
ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
46 changes: 46 additions & 0 deletions KF6SolidConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SolidConfig.cmake provides information about the installed Solid library.
# It can be used directly from CMake via find_package(Solid NO_MODULE)
#
# The following CMake variables are provided:
# Solid_VERSION_MAJOR - the major version number of Solid
# Solid_VERSION_MINOR - the minor version number of Solid
# Solid_VERSION_PATCH - the patch version number of Solid
# Solid_INCLUDE_DIRS - the include directories to use
# Solid_HAVE_UDev - TRUE if device discovery via udev is supported
#
# Additionally, the following imported library targets are created, which may be used directly
# with target_link_libraries():
# KF6::Solid - the Solid library

@PACKAGE_INIT@

set(SOLID_DBUS_INTERFACES_DIR "@PACKAGE_KDE_INSTALL_DBUSINTERFACEDIR@")

include(CMakeFindDependencyMacro)
find_dependency(Qt6Core @REQUIRED_QT_VERSION@)

if (NOT @BUILD_SHARED_LIBS@)
find_dependency(Qt6Xml @REQUIRED_QT_VERSION@)
find_dependency(Qt6Gui @REQUIRED_QT_VERSION@)

if (@HAVE_DBUS@)
find_dependency(Qt6DBus @REQUIRED_QT_VERSION@)
endif()

if (@HAVE_LIBMOUNT@)
find_dependency(LibMount)
endif()

if (@UDev_FOUND@)
find_dependency(UDev)
endif()
endif()

include("${CMAKE_CURRENT_LIST_DIR}/KF6SolidTargets.cmake")
@PACKAGE_INCLUDE_QCHTARGETS@

# "public" variables:


set(Solid_HAVE_UDev @UDev_FOUND@ )

26 changes: 26 additions & 0 deletions LICENSES/BSD-3-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) <year> <owner>. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit 1106488

Please sign in to comment.