[neon/backports-jammy/packagekit-qt/Neon/unstable] debian/patches: Add patch to make the QPK API match the PK API
Matthias Klumpp
null at kde.org
Wed Mar 15 04:29:32 GMT 2023
Git commit f1b5ba051fe6a77c751177cbedc2bbe0b57756a5 by Matthias Klumpp.
Committed on 08/09/2014 at 19:52.
Pushed by carlosdem into branch 'Neon/unstable'.
Add patch to make the QPK API match the PK API
A +215 -0 debian/patches/01_fix-api.patch
A +1 -0 debian/patches/series
https://invent.kde.org/neon/backports-jammy/packagekit-qt/commit/f1b5ba051fe6a77c751177cbedc2bbe0b57756a5
diff --git a/debian/patches/01_fix-api.patch b/debian/patches/01_fix-api.patch
new file mode 100644
index 0000000..ba77e8b
--- /dev/null
+++ b/debian/patches/01_fix-api.patch
@@ -0,0 +1,215 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fa8978a..b1e1e97 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -41,6 +41,7 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ #
+ # Configure files
+ #
++set (CMAKE_INSTALL_LIBDIR "lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Output directory for libraries")
+ set (PREFIXDIR "${CMAKE_INSTALL_PREFIX}")
+ set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
+ set (PKGDATADIR "${DATA_INSTALL_DIR}")
+@@ -51,11 +52,11 @@ set (LOCALE_DIR "${DATADIR}/locale")
+ set (VERSION "${QPACKAGEKIT_VERSION}")
+ set (BUILDDIR "${CMAKE_BINARY_DIR}")
+ set (LOCALSTATEDIR "/var")
++set (CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${LIBNAME}/")
+
+ add_definitions("-DLOCALSTATEDIR=\"${LOCALSTATEDIR}\"")
+ add_definitions("-std=gnu++11")
+
+-set(CMAKE_INSTALL_LIBDIR "lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Output directory for libraries")
+ if (IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
+ set (PKQT_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
+ else (IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
+@@ -75,3 +76,9 @@ endif (DISABLE_MAINTAINER_CFLAGS)
+ add_definitions(${MAINTAINER_CFLAGS})
+
+ add_subdirectory(src)
++
++install(EXPORT PackageKitQtTargets
++ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
++ FILE PackageKitQtTargets.cmake
++ NAMESPACE PK::
++ COMPONENT Devel)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 8ef7906..d1176ec 100755
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -55,13 +55,14 @@ set(packagekitqt_SRC
+ details.cpp
+ )
+
+-find_file(PK_INTERFACE_XML org.freedesktop.PackageKit.xml
+- PATHS ${CMAKE_INSTALL_PREFIX}/share/dbus-1/interfaces/
++find_path(PK_INTERFACES_DIR org.freedesktop.PackageKit.xml
++ HINTS ${CMAKE_INSTALL_PREFIX} /usr
++ PATH_SUFFIXES share/dbus-1/interfaces/
+ )
+-find_file(PK_TRANSACTION_INTERFACE_XML org.freedesktop.PackageKit.Transaction.xml
+- PATHS ${CMAKE_INSTALL_PREFIX}/share/dbus-1/interfaces/
+-)
+-if (PK_INTERFACE_XML STREQUAL "PK_INTERFACE_XML-NOTFOUND" OR PK_TRANSACTION_INTERFACE_XML STREQUAL "PK_TRANSACTION_INTERFACE_XML-NOTFOUND")
++set(PK_INTERFACE_XML "${PK_INTERFACES_DIR}/org.freedesktop.PackageKit.xml")
++set(PK_TRANSACTION_INTERFACE_XML "${PK_INTERFACES_DIR}/org.freedesktop.PackageKit.Transaction.xml")
++
++if (NOT PK_INTERFACE_XML OR NOT PK_TRANSACTION_INTERFACE_XML)
+ message (FATAL_ERROR "Unable to find PackageKit DBus specifications! Please install PackageKit to continue!")
+ endif ()
+
+@@ -87,7 +88,8 @@ set_target_properties(${LIBNAME} PROPERTIES VERSION ${QPACKAGEKIT_VERSION} SOVER
+ if (Qt5_FOUND)
+ add_dependencies(${LIBNAME} mocs)
+ target_link_libraries(${LIBNAME}
+- ${Qt5DBus_LIBRARIES} ${Qt5Sql_LIBRARIES}
++ LINK_PUBLIC Qt5::DBus
++ LINK_PRIVATE Qt5::Sql
+ )
+ elseif (Qt4_FOUND)
+ target_link_libraries(${LIBNAME}
+@@ -99,8 +101,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc
+ @ONLY
+ )
+-
+-install(TARGETS ${LIBNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
++target_include_directories(${LIBNAME} INTERFACE "$<INSTALL_INTERFACE:include/PackageKit/>")
++install(TARGETS ${LIBNAME} EXPORT PackageKitQtTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+ )
+diff --git a/src/bitfield.cpp b/src/bitfield.cpp
+index c986905..68ef80c 100644
+--- a/src/bitfield.cpp
++++ b/src/bitfield.cpp
+@@ -2,7 +2,7 @@
+
+ using namespace PackageKit;
+
+-Bitfield::Bitfield () : m_val (0)
++Bitfield::Bitfield ()
+ {
+ }
+
+@@ -61,10 +61,15 @@ Bitfield Bitfield::operator|= (Bitfield mask)
+
+ Bitfield& Bitfield::operator= (const Bitfield& other)
+ {
+- if (this == &other)
+- return *this;
++ if (this == &other)
++ return *this;
+
+- m_val = other.m_val;
++ m_val = other.m_val;
+
+- return *this;
++ return *this;
++}
++
++bool Bitfield::operator==(const Bitfield &other)
++{
++ return m_val == other.m_val;
+ }
+diff --git a/src/bitfield.h b/src/bitfield.h
+index d7dd481..8535e46 100644
+--- a/src/bitfield.h
++++ b/src/bitfield.h
+@@ -2,6 +2,7 @@
+ #define PACKAGEKIT_BITFIELD_H
+
+ #include <QtGlobal>
++#include <QMetaType>
+
+ namespace PackageKit {
+
+@@ -23,11 +24,14 @@ public:
+ Bitfield operator|= (Bitfield mask);
+
+ Bitfield& operator= (const Bitfield& other);
++ bool operator==(const Bitfield &other);
+
+ private:
+- qulonglong m_val;
++ qulonglong m_val = 0;
+ };
+
+ } // End namespace PackageKit
+
++Q_DECLARE_METATYPE(PackageKit::Bitfield)
++
+ #endif
+diff --git a/src/daemon.cpp b/src/daemon.cpp
+index 621fb89..fdea8a7 100755
+--- a/src/daemon.cpp
++++ b/src/daemon.cpp
+@@ -66,25 +66,6 @@ Daemon::Daemon(QObject *parent) :
+ if (!db.open()) {
+ qDebug() << "Failed to initialize the desktop files database";
+ }
+-
+- qRegisterMetaType<PackageKit::Daemon::Network>("PackageKit::Daemon::Network");
+- qRegisterMetaType<PackageKit::Daemon::Authorize>("PackageKit::Daemon::Authorize");
+- qRegisterMetaType<PackageKit::Transaction::InternalError>("PackageKit::Transaction::InternalError");
+- qRegisterMetaType<PackageKit::Transaction::Role>("PackageKit::Transaction::Role");
+- qRegisterMetaType<PackageKit::Transaction::Error>("PackageKit::Transaction::Error");
+- qRegisterMetaType<PackageKit::Transaction::Exit>("PackageKit::Transaction::Exit");
+- qRegisterMetaType<PackageKit::Transaction::Filter>("PackageKit::Transaction::Filter");
+- qRegisterMetaType<PackageKit::Transaction::Message>("PackageKit::Transaction::Message");
+- qRegisterMetaType<PackageKit::Transaction::Status>("PackageKit::Transaction::Status");
+- qRegisterMetaType<PackageKit::Transaction::MediaType>("PackageKit::Transaction::MediaType");
+- qRegisterMetaType<PackageKit::Transaction::DistroUpgrade>("PackageKit::Transaction::DistroUpgrade");
+- qRegisterMetaType<PackageKit::Transaction::TransactionFlag>("PackageKit::Transaction::TransactionFlag");
+- qRegisterMetaType<PackageKit::Transaction::TransactionFlags>("PackageKit::Transaction::TransactionFlags");
+- qRegisterMetaType<PackageKit::Transaction::Restart>("PackageKit::Transaction::Restart");
+- qRegisterMetaType<PackageKit::Transaction::UpdateState>("PackageKit::Transaction::UpdateState");
+- qRegisterMetaType<PackageKit::Transaction::Group>("PackageKit::Transaction::Group");
+- qRegisterMetaType<PackageKit::Transaction::Info>("PackageKit::Transaction::Info");
+- qRegisterMetaType<PackageKit::Transaction::SigType>("PackageKit::Transaction::SigType");
+ }
+
+ void DaemonPrivate::setupSignal(const QString &signal, bool connect)
+@@ -94,10 +75,7 @@ void DaemonPrivate::setupSignal(const QString &signal, bool connect)
+ const char *signalToConnect = 0;
+ const char *memberToConnect = 0;
+
+- if (signal == SIGNAL(changed())) {
+- signalToConnect = SIGNAL(Changed());
+- memberToConnect = SIGNAL(changed());
+- } else if (signal == SIGNAL(repoListChanged())) {
++ if (signal == SIGNAL(repoListChanged())) {
+ signalToConnect = SIGNAL(RepoListChanged());
+ memberToConnect = SIGNAL(repoListChanged());
+ } else if (signal == SIGNAL(restartScheduled())) {
+diff --git a/src/modules/packagekit-qt-config.cmake.in b/src/modules/packagekit-qt-config.cmake.in
+index f9f4436..3dcf3f3 100644
+--- a/src/modules/packagekit-qt-config.cmake.in
++++ b/src/modules/packagekit-qt-config.cmake.in
+@@ -1,11 +1,10 @@
+ # - Config information for PackageKit-Qt at QT_VERSION@
+ # This file defines:
+ #
+-# PackageKitQt at QT_VERSION@_INCLUDE_DIR - the PackageKitQt at QT_VERSION@ include directory
+ # PackageKitQt at QT_VERSION@_LIBRARIES - Link these to use PackageKitQt at QT_VERSION@
+
+ SET(prefix "@CMAKE_INSTALL_PREFIX@")
+ SET(exec_prefix "@CMAKE_INSTALL_PREFIX@")
+-SET(PackageKitQt at QT_VERSION@_LIBRARIES "@PKQT_INSTALL_LIBDIR@/lib at LIBNAME@.so" CACHE FILEPATH "Libraries for PackageKitQt at QT_VERSION@")
+-SET(PackageKitQt at QT_VERSION@_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PackageKit/@LIBNAME@" CACHE PATH "Include path for PackageKitQt at QT_VERSION@")
+-SET(PackageKitQt at QT_VERSION@_FOUND "TRUE")
++SET(PackageKitQt at QT_VERSION@_LIBRARIES "PK::@LIBNAME@")
++
++include("${CMAKE_CURRENT_LIST_DIR}/PackageKitQtTargets.cmake")
+diff --git a/src/transaction.h b/src/transaction.h
+index 2b03f41..7b17fc5 100644
+--- a/src/transaction.h
++++ b/src/transaction.h
+@@ -140,7 +140,6 @@ public:
+ RoleGetDistroUpgrades,
+ RoleGetCategories,
+ RoleGetOldTransactions,
+- RoleUpgradeSystem, // Since 0.6.11
+ RoleRepairSystem, // Since 0.7.2
+ RoleGetDetailsLocal, // Since 0.8.17
+ RoleGetFilesLocal, // Since 0.9.1
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b662402
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+01_fix-api.patch
More information about the Neon-commits
mailing list