diff --git a/0002-Remove-daemon-proxy-conection-to-changed.patch b/0002-Remove-daemon-proxy-conection-to-changed.patch index 49a6905..19cccc2 100644 --- a/0002-Remove-daemon-proxy-conection-to-changed.patch +++ b/0002-Remove-daemon-proxy-conection-to-changed.patch @@ -1,7 +1,7 @@ From ec677018df575ef295b5a57b66436b24ded63850 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Tue, 6 May 2014 12:42:28 -0300 -Subject: [PATCH 2/6] Remove daemon proxy conection to changed() +Subject: [PATCH 02/16] Remove daemon proxy conection to changed() --- src/daemon.cpp | 5 +---- @@ -24,5 +24,5 @@ index 621fb89..06907f4 100755 memberToConnect = SIGNAL(repoListChanged()); } else if (signal == SIGNAL(restartScheduled())) { -- -1.9.3 +2.1.0 diff --git a/0003-Add-operator-to-bitfield.patch b/0003-Add-operator-to-bitfield.patch index f9689f2..b573275 100644 --- a/0003-Add-operator-to-bitfield.patch +++ b/0003-Add-operator-to-bitfield.patch @@ -1,7 +1,7 @@ From c7b3c1dde34409fba8fd80355338d7f3fc1feffe Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Tue, 6 May 2014 12:43:26 -0300 -Subject: [PATCH 3/6] Add operator== to bitfield +Subject: [PATCH 03/16] Add operator== to bitfield --- src/bitfield.cpp | 15 ++++++++++----- @@ -70,5 +70,5 @@ index d7dd481..8535e46 100644 + #endif -- -1.9.3 +2.1.0 diff --git a/0004-Remove-the-metatype-registration-for-Transaction-typ.patch b/0004-Remove-the-metatype-registration-for-Transaction-typ.patch index 0a164ed..9220e13 100644 --- a/0004-Remove-the-metatype-registration-for-Transaction-typ.patch +++ b/0004-Remove-the-metatype-registration-for-Transaction-typ.patch @@ -1,9 +1,9 @@ From 9e3a611a3c1177878df2f09b6c4e0bee13239ba3 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Tue, 6 May 2014 12:44:51 -0300 -Subject: [PATCH 4/6] Remove the metatype registration for Transaction types as - is't a bit useless since it depends on the namespace being used better leave - this to the client to register +Subject: [PATCH 04/16] Remove the metatype registration for Transaction types + as is't a bit useless since it depends on the namespace being used better + leave this to the client to register --- src/daemon.cpp | 19 ------------------- @@ -40,5 +40,5 @@ index 06907f4..fdea8a7 100755 void DaemonPrivate::setupSignal(const QString &signal, bool connect) -- -1.9.3 +2.1.0 diff --git a/0005-Remove-RoleUpgradeSystem-as-it-s-not-supported-in-0..patch b/0005-Remove-RoleUpgradeSystem-as-it-s-not-supported-in-0..patch index 5e5b9bc..77b5e05 100644 --- a/0005-Remove-RoleUpgradeSystem-as-it-s-not-supported-in-0..patch +++ b/0005-Remove-RoleUpgradeSystem-as-it-s-not-supported-in-0..patch @@ -1,7 +1,7 @@ From d53989d7c8051ae0be95a91725646bd4f5fe38b9 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Wed, 7 May 2014 16:16:25 -0300 -Subject: [PATCH 5/6] Remove RoleUpgradeSystem as it's not supported in 0.9.x +Subject: [PATCH 05/16] Remove RoleUpgradeSystem as it's not supported in 0.9.x anymore --- @@ -21,5 +21,5 @@ index 2b03f41..7b17fc5 100644 RoleGetDetailsLocal, // Since 0.8.17 RoleGetFilesLocal, // Since 0.9.1 -- -1.9.3 +2.1.0 diff --git a/0006-Properly-export-cmake-targets.patch b/0006-Properly-export-cmake-targets.patch index 484444e..20266fc 100644 --- a/0006-Properly-export-cmake-targets.patch +++ b/0006-Properly-export-cmake-targets.patch @@ -1,7 +1,7 @@ From 8547dc427bd0d09faef7b26078adf39c2fe74e01 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 19 Aug 2014 18:54:46 +0200 -Subject: [PATCH 6/6] Properly export cmake targets +Subject: [PATCH 06/16] Properly export cmake targets --- CMakeLists.txt | 7 +++++++ @@ -97,5 +97,5 @@ index f9f4436..a91b095 100644 + +include("${CMAKE_CURRENT_LIST_DIR}/PackageKitQtTargets.cmake") -- -1.9.3 +2.1.0 diff --git a/0007-Don-t-assume-the-target-is-packagekitqt5.patch b/0007-Don-t-assume-the-target-is-packagekitqt5.patch new file mode 100644 index 0000000..a77e305 --- /dev/null +++ b/0007-Don-t-assume-the-target-is-packagekitqt5.patch @@ -0,0 +1,25 @@ +From 0d929b4afe1a761c53df5f1c719334712f05fa6b Mon Sep 17 00:00:00 2001 +From: Aleix Pol +Date: Wed, 27 Aug 2014 16:08:59 +0200 +Subject: [PATCH 07/16] Don't assume the target is packagekitqt5 + +It can also be packagekitqt4 +--- + src/modules/packagekit-qt-config.cmake.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/modules/packagekit-qt-config.cmake.in b/src/modules/packagekit-qt-config.cmake.in +index a91b095..3dcf3f3 100644 +--- a/src/modules/packagekit-qt-config.cmake.in ++++ b/src/modules/packagekit-qt-config.cmake.in +@@ -5,6 +5,6 @@ + + SET(prefix "@CMAKE_INSTALL_PREFIX@") + SET(exec_prefix "@CMAKE_INSTALL_PREFIX@") +-SET(PackageKitQt@QT_VERSION@_LIBRARIES "PK::packagekitqt5") ++SET(PackageKitQt@QT_VERSION@_LIBRARIES "PK::@LIBNAME@") + + include("${CMAKE_CURRENT_LIST_DIR}/PackageKitQtTargets.cmake") +-- +2.1.0 + diff --git a/0008-Fix-compilation-due-to-not-set-cmake-variable.patch b/0008-Fix-compilation-due-to-not-set-cmake-variable.patch new file mode 100644 index 0000000..96038f9 --- /dev/null +++ b/0008-Fix-compilation-due-to-not-set-cmake-variable.patch @@ -0,0 +1,32 @@ +From ede40b16ce6b48a02ffda6c4dc56f1aac8590357 Mon Sep 17 00:00:00 2001 +From: Matthias Klumpp +Date: Mon, 8 Sep 2014 21:52:04 +0200 +Subject: [PATCH 08/16] Fix compilation due to not-set cmake variable + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5df701d..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}") +@@ -56,7 +57,6 @@ 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}) +-- +2.1.0 + diff --git a/0009-Fix-QPK-include-dir-in-cmake-module.patch b/0009-Fix-QPK-include-dir-in-cmake-module.patch new file mode 100644 index 0000000..8dc0277 --- /dev/null +++ b/0009-Fix-QPK-include-dir-in-cmake-module.patch @@ -0,0 +1,25 @@ +From ad25d71c5725131db3991fb80594e0f9a74fa2ed Mon Sep 17 00:00:00 2001 +From: Matthias Klumpp +Date: Mon, 8 Sep 2014 23:46:51 +0200 +Subject: [PATCH 09/16] Fix QPK include dir in cmake module + +--- + src/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d1176ec..5037fb2 100755 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -101,7 +101,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc + @ONLY + ) +-target_include_directories(${LIBNAME} INTERFACE "$") ++target_include_directories(${LIBNAME} INTERFACE "$") + install(TARGETS ${LIBNAME} EXPORT PackageKitQtTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +-- +2.1.0 + diff --git a/0010-Disable-namespacing-and-classes-names-on-the-interfa.patch b/0010-Disable-namespacing-and-classes-names-on-the-interfa.patch new file mode 100644 index 0000000..ab0759e --- /dev/null +++ b/0010-Disable-namespacing-and-classes-names-on-the-interfa.patch @@ -0,0 +1,138 @@ +From 3693ea5ed68b53fdb9e2d9c034dcda7b68798c89 Mon Sep 17 00:00:00 2001 +From: Daniel Nicoletti +Date: Tue, 16 Sep 2014 08:56:19 -0300 +Subject: [PATCH 10/16] Disable namespacing and classes names on the interfaces + generated by qdbusxml2cpp so the org.fdo.PackageKit.Offiline interface + doesn't clash the PackageKit typedef of org.fdo.PackageKit + +--- + src/CMakeLists.txt | 4 ++-- + src/daemon.cpp | 8 ++++---- + src/daemonprivate.cpp | 2 +- + src/daemonprivate.h | 4 ++-- + src/transactionprivate.cpp | 10 +++++----- + src/transactionprivate.h | 4 ++-- + 6 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5037fb2..9d5210f 100755 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -66,8 +66,8 @@ 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 () + +-set_source_files_properties(${PK_INTERFACE_XML} PROPERTIES CLASSNAME DaemonProxy) +-set_source_files_properties(${PK_TRANSACTION_INTERFACE_XML} PROPERTIES CLASSNAME TransactionProxy) ++set_source_files_properties(${PK_INTERFACE_XML} PROPERTIES NO_NAMESPACE true) ++set_source_files_properties(${PK_TRANSACTION_INTERFACE_XML} PROPERTIES NO_NAMESPACE true) + + if (Qt5_FOUND) + qt5_add_dbus_interface(packagekitqt_SRC ${PK_INTERFACE_XML} daemonproxy) +diff --git a/src/daemon.cpp b/src/daemon.cpp +index fdea8a7..442ef55 100755 +--- a/src/daemon.cpp ++++ b/src/daemon.cpp +@@ -47,10 +47,10 @@ Daemon::Daemon(QObject *parent) : + d_ptr(new DaemonPrivate(this)) + { + Q_D(Daemon); +- d->daemon = new ::DaemonProxy(QLatin1String(PK_NAME), +- QLatin1String(PK_PATH), +- QDBusConnection::systemBus(), +- this); ++ d->daemon = new ::OrgFreedesktopPackageKitInterface(QLatin1String(PK_NAME), ++ QLatin1String(PK_PATH), ++ QDBusConnection::systemBus(), ++ this); + + QDBusConnection::systemBus().connect(QLatin1String(PK_NAME), + QLatin1String(PK_PATH), +diff --git a/src/daemonprivate.cpp b/src/daemonprivate.cpp +index 6a52f14..25ba55b 100644 +--- a/src/daemonprivate.cpp ++++ b/src/daemonprivate.cpp +@@ -124,7 +124,7 @@ void DaemonPrivate::updateProperties(const QVariantMap &properties) + } else if (property == QLatin1String("DistroId")) { + distroId = value.toString(); + } else if (property == QLatin1String("Filters")) { +- filters = static_cast(value.toULongLong()); ++ filters = static_cast(value.toUInt()); + } else if (property == QLatin1String("Groups")) { + groups = static_cast(value.toULongLong()); + } else if (property == QLatin1String("Locked")) { +diff --git a/src/daemonprivate.h b/src/daemonprivate.h +index abc03a7..b8c2b6c 100644 +--- a/src/daemonprivate.h ++++ b/src/daemonprivate.h +@@ -27,7 +27,7 @@ + + #include "daemon.h" + +-class DaemonProxy; ++class OrgFreedesktopPackageKitInterface; + + namespace PackageKit { + +@@ -39,7 +39,7 @@ protected: + virtual ~DaemonPrivate() {} + + Daemon *q_ptr; +- ::DaemonProxy *daemon; ++ ::OrgFreedesktopPackageKitInterface *daemon; + QStringList hints; + QStringList connectedSignals; + +diff --git a/src/transactionprivate.cpp b/src/transactionprivate.cpp +index 7a87aec..2c73899 100644 +--- a/src/transactionprivate.cpp ++++ b/src/transactionprivate.cpp +@@ -46,10 +46,10 @@ void TransactionPrivate::setup(const QDBusObjectPath &transactionId) + Q_Q(Transaction); + + tid = transactionId; +- p = new TransactionProxy(QLatin1String(PK_NAME), +- tid.path(), +- QDBusConnection::systemBus(), +- q); ++ p = new OrgFreedesktopPackageKitTransactionInterface(QLatin1String(PK_NAME), ++ tid.path(), ++ QDBusConnection::systemBus(), ++ q); + if (!Daemon::global()->hints().isEmpty()) { + q->setHints(Daemon::global()->hints()); + } +@@ -329,7 +329,7 @@ void TransactionPrivate::updateProperties(const QVariantMap &properties) + status = static_cast(value.toUInt()); + QMetaObject::invokeMethod(q, "statusChanged", Qt::QueuedConnection); + } else if (property == QLatin1String("TransactionFlags")) { +- transactionFlags = static_cast(value.toULongLong()); ++ transactionFlags = static_cast(value.toUInt()); + QMetaObject::invokeMethod(q, "transactionFlagsChanged", Qt::QueuedConnection); + } else if (property == QLatin1String("Uid")) { + uid = value.toUInt(); +diff --git a/src/transactionprivate.h b/src/transactionprivate.h +index 895cfac..72860d8 100644 +--- a/src/transactionprivate.h ++++ b/src/transactionprivate.h +@@ -29,7 +29,7 @@ + + #include "transaction.h" + +-class TransactionProxy; ++class OrgFreedesktopPackageKitTransactionInterface; + + namespace PackageKit { + +@@ -45,7 +45,7 @@ protected: + void runQueuedTransaction(); + + QDBusObjectPath tid; +- ::TransactionProxy* p = 0; ++ ::OrgFreedesktopPackageKitTransactionInterface* p = 0; + Transaction *q_ptr; + QStringList connectedSignals; + +-- +2.1.0 + diff --git a/0011-Use-PackageKit-as-the-include-namespace-rather-than-.patch b/0011-Use-PackageKit-as-the-include-namespace-rather-than-.patch new file mode 100644 index 0000000..0d6bf11 --- /dev/null +++ b/0011-Use-PackageKit-as-the-include-namespace-rather-than-.patch @@ -0,0 +1,37 @@ +From 7248b030c08859866d966fe7cfd3e788e4f8f7d1 Mon Sep 17 00:00:00 2001 +From: Aleix Pol +Date: Tue, 16 Sep 2014 15:13:05 +0200 +Subject: [PATCH 11/16] Use "PackageKit" as the include namespace rather than + the library name + +This way the project doesn't need to hard-code the qt version on the +source code. + +Reviewed by Daniel Nicoletti +--- + src/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9d5210f..c52e1b1 100755 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -101,13 +101,13 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc + @ONLY + ) +-target_include_directories(${LIBNAME} INTERFACE "$") ++target_include_directories(${LIBNAME} INTERFACE "$") + install(TARGETS ${LIBNAME} EXPORT PackageKitQtTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) + install(FILES ${packagekitqt_HEADERS} +- DESTINATION include/PackageKit/${LIBNAME} ++ DESTINATION include/${LIBNAME}/PackageKit/ + ) + + add_subdirectory(modules) +-- +2.1.0 + diff --git a/0012-Use-GNUInstallDirs-to-determine-most-of-used-variabl.patch b/0012-Use-GNUInstallDirs-to-determine-most-of-used-variabl.patch new file mode 100644 index 0000000..7ba241a --- /dev/null +++ b/0012-Use-GNUInstallDirs-to-determine-most-of-used-variabl.patch @@ -0,0 +1,126 @@ +From 97306279fa6b5eed72187125895b313b0b51a386 Mon Sep 17 00:00:00 2001 +From: Hrvoje Senjan +Date: Fri, 19 Sep 2014 00:17:36 +0200 +Subject: [PATCH 12/16] Use GNUInstallDirs to determine most of used variables + +Also removed unused vars +--- + CMakeLists.txt | 17 +++-------------- + config.h.in | 7 ------- + src/CMakeLists.txt | 4 ++-- + src/packagekitqt4.pc.in | 4 ++-- + src/packagekitqt5.pc.in | 4 ++-- + 5 files changed, 9 insertions(+), 27 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b1e1e97..1c77b82 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,9 @@ find_package(PkgConfig REQUIRED) + + set(CMAKE_BUILD_TYPE "Debug") + ++# Used to set installation paths ++include(GNUInstallDirs) ++ + set(QPACKAGEKIT_VERSION_MAJOR "0") + set(QPACKAGEKIT_VERSION_MINOR "9") + set(QPACKAGEKIT_VERSION_PATCH "3") +@@ -41,28 +44,14 @@ 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}") +-set (LIBDIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}") +-set (PKGLIBDIR "${LIBDIR}/packagekit") + set (GETTEXT_PACKAGE "packagekit") +-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") + +-if (IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) +- set (PKQT_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}) +-else (IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) +- set (PKQT_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +-endif (IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) +- + configure_file(config.h.in ${CMAKE_BINARY_DIR}/config.h) + + # +diff --git a/config.h.in b/config.h.in +index 782abcb..7985f30 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -8,13 +8,6 @@ + #define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@" + + /* Paths */ +-#define LOCALEDIR "@LOCALE_DIR@" +-#define PKGDATADIR "@PKGDATADIR@" +-#define PKGLIBDIR "@PKGLIBDIR@" +-#define PREFIXDIR "@PREFIXDIR@" +-#define DATADIR "@DATADIR@" +-#define LIBDIR "@LIBDIR@" +-#define BUILDDIR "@BUILDDIR@" + + /* Name of package */ + #define PACKAGE_NAME "packagekit-qt" +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index c52e1b1..c6e16bd 100755 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -101,13 +101,13 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc + @ONLY + ) +-target_include_directories(${LIBNAME} INTERFACE "$") ++target_include_directories(${LIBNAME} INTERFACE "$") + install(TARGETS ${LIBNAME} EXPORT PackageKitQtTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) + install(FILES ${packagekitqt_HEADERS} +- DESTINATION include/${LIBNAME}/PackageKit/ ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${LIBNAME}/PackageKit/ + ) + + add_subdirectory(modules) +diff --git a/src/packagekitqt4.pc.in b/src/packagekitqt4.pc.in +index 449bbe2..013e5a0 100755 +--- a/src/packagekitqt4.pc.in ++++ b/src/packagekitqt4.pc.in +@@ -1,7 +1,7 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=${prefix} +-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +-includedir=${prefix}/include ++libdir=@CMAKE_INSTALL_FULL_LIBDIR@ ++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + + Name: @LIBNAME@ + Description: PackageKit is a system daemon for installing stuff. +diff --git a/src/packagekitqt5.pc.in b/src/packagekitqt5.pc.in +index 0b2f476..da6c2a9 100644 +--- a/src/packagekitqt5.pc.in ++++ b/src/packagekitqt5.pc.in +@@ -1,7 +1,7 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=${prefix} +-libdir=@PKQT_INSTALL_LIBDIR@ +-includedir=${prefix}/include ++libdir=@CMAKE_INSTALL_FULL_LIBDIR@ ++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + + Name: @LIBNAME@ + Description: PackageKit is a system daemon for installing stuff. +-- +2.1.0 + diff --git a/0016-Deprecate-packageIcon-methods.patch b/0016-Deprecate-packageIcon-methods.patch new file mode 100644 index 0000000..c319408 --- /dev/null +++ b/0016-Deprecate-packageIcon-methods.patch @@ -0,0 +1,198 @@ +From 60787cfccd76b15e0f5813d7ab5567292f7efce7 Mon Sep 17 00:00:00 2001 +From: Aleix Pol +Date: Thu, 2 Oct 2014 18:51:55 +0200 +Subject: [PATCH 16/16] Deprecate ::packageIcon methods + +It's suggested to use Appstream instead. +Also removes the QtSql dependency, which is nice. + +Reviewed by Daniel Nicoletti +--- + src/CMakeLists.txt | 5 ----- + src/common.h | 2 -- + src/daemon.cpp | 11 ----------- + src/daemon.h | 4 +++- + src/packagekitqt4.pc.in | 2 +- + src/packagekitqt5.pc.in | 2 +- + src/transaction.cpp | 33 +-------------------------------- + src/transaction.h | 4 +++- + 8 files changed, 9 insertions(+), 54 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index c6e16bd..0e18022 100755 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -11,16 +11,12 @@ endif () + # Set up Qt + if (Qt5_FOUND) + find_package(Qt5DBus REQUIRED) +- find_package(Qt5Sql REQUIRED) + include_directories(${Qt5Core_INCLUDE_DIRS} + ${Qt5DBus_INCLUDE_DIRS} +- ${Qt5Sql_INCLUDE_DIRS} + ) + add_definitions(${Qt5DBus_DEFINITIONS}) +- add_definitions(${Qt5Sql_DEFINITIONS}) + elseif (Qt4_FOUND) + set(QT_USE_QTDBUS TRUE) +- set(QT_USE_QTSQL TRUE) + set(QT_DONT_USE_QTGUI TRUE) + include(${QT_USE_FILE}) + endif () +@@ -89,7 +85,6 @@ if (Qt5_FOUND) + add_dependencies(${LIBNAME} mocs) + target_link_libraries(${LIBNAME} + LINK_PUBLIC Qt5::DBus +- LINK_PRIVATE Qt5::Sql + ) + elseif (Qt4_FOUND) + target_link_libraries(${LIBNAME} +diff --git a/src/common.h b/src/common.h +index d7497d4..05a3df4 100644 +--- a/src/common.h ++++ b/src/common.h +@@ -34,5 +34,3 @@ + #define AUTH_SYSTEM_SOURCES_REFRESH "org.freedesktop.packagekit.system-sources-refresh" + #define AUTH_SYSTEM_NETWORK_PROXY_CONFIGURE "org.freedesktop.packagekit.system-network-proxy-configure" + #define AUTH_CANCEL_FOREIGN "org.freedesktop.packagekit.cancel-foreign" +- +-#define PK_DESKTOP_DEFAULT_DATABASE LOCALSTATEDIR "/lib/PackageKit/desktop-files.db" +diff --git a/src/daemon.cpp b/src/daemon.cpp +index 442ef55..647756a 100755 +--- a/src/daemon.cpp ++++ b/src/daemon.cpp +@@ -19,9 +19,6 @@ + * Boston, MA 02110-1301, USA. + */ + +-#include +-#include +- + #include "daemon.h" + #include "daemonprivate.h" + #include "transactionprivate.h" +@@ -58,14 +55,6 @@ Daemon::Daemon(QObject *parent) : + QLatin1String("PropertiesChanged"), + this, + SLOT(propertiesChanged(QString,QVariantMap,QStringList))); +- +- // Set up database for desktop files +- QSqlDatabase db; +- db = QSqlDatabase::addDatabase("QSQLITE", PK_DESKTOP_DEFAULT_DATABASE); +- db.setDatabaseName(PK_DESKTOP_DEFAULT_DATABASE); +- if (!db.open()) { +- qDebug() << "Failed to initialize the desktop files database"; +- } + } + + void DaemonPrivate::setupSignal(const QString &signal, bool connect) +diff --git a/src/daemon.h b/src/daemon.h +index 6ad2779..05d74f4 100644 +--- a/src/daemon.h ++++ b/src/daemon.h +@@ -277,8 +277,10 @@ public: + + /** + * Returns the package icon from the \p packageID ++ * ++ * @deprecated use Appstream to fetch icons + */ +- Q_INVOKABLE static QString packageIcon(const QString &packageID); ++ Q_INVOKABLE QT_DEPRECATED static QString packageIcon(const QString &packageID); + + /** + * Returns the string representing the enum +diff --git a/src/packagekitqt4.pc.in b/src/packagekitqt4.pc.in +index 013e5a0..2030ff2 100755 +--- a/src/packagekitqt4.pc.in ++++ b/src/packagekitqt4.pc.in +@@ -6,6 +6,6 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + Name: @LIBNAME@ + Description: PackageKit is a system daemon for installing stuff. + Version: @VERSION@ +-Requires: QtCore, QtDBus, QtSql, QtXml ++Requires: QtCore, QtDBus, QtXml + Libs: -L${libdir} -l@LIBNAME@ + Cflags: -I${includedir}/PackageKit/@LIBNAME@ +diff --git a/src/packagekitqt5.pc.in b/src/packagekitqt5.pc.in +index da6c2a9..99ace5b 100644 +--- a/src/packagekitqt5.pc.in ++++ b/src/packagekitqt5.pc.in +@@ -6,6 +6,6 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + Name: @LIBNAME@ + Description: PackageKit is a system daemon for installing stuff. + Version: @VERSION@ +-Requires: Qt5Core, Qt5DBus, Qt5Sql, Qt5Xml ++Requires: Qt5Core, Qt5DBus, Qt5Xml + Libs: -L${libdir} -l@LIBNAME@ + Cflags: -I${includedir}/PackageKit/@LIBNAME@ +diff --git a/src/transaction.cpp b/src/transaction.cpp +index 0ed97e1..7cfa302 100755 +--- a/src/transaction.cpp ++++ b/src/transaction.cpp +@@ -26,7 +26,6 @@ + #include "daemon.h" + #include "common.h" + +-#include + #include + + using namespace PackageKit; +@@ -215,37 +214,7 @@ QString Transaction::packageData(const QString &packageID) + + QString Transaction::packageIcon(const QString &packageID) + { +- QString path; +- QSqlDatabase db = QSqlDatabase::database(PK_DESKTOP_DEFAULT_DATABASE); +- if (!db.isOpen()) { +- qDebug() << "Desktop files database is not open"; +- return path; +- } +- +- QSqlQuery q(db); +- q.prepare("SELECT filename FROM cache WHERE package = :name"); +- q.bindValue(":name", Transaction::packageName(packageID)); +- if (q.exec()) { +- if (q.next()) { +- QFile desktopFile(q.value(0).toString()); +- if (desktopFile.open(QIODevice::ReadOnly | QIODevice::Text)) { +- while (!desktopFile.atEnd()) { +- QByteArray line = desktopFile.readLine().trimmed(); +- if (line.startsWith("Icon=")) { +- path = line.mid(5); +- break; +- } +- } +- desktopFile.close(); +- } else { +- qDebug() << "Cannot open desktop file " << q.value(0).toString(); +- } +- } +- } else { +- qDebug() << "Error while running query " << q.executedQuery(); +- } +- +- return path; ++ return QString(); + } + + QString Transaction::lastPackage() const +diff --git a/src/transaction.h b/src/transaction.h +index f9d4802..51ac1d0 100644 +--- a/src/transaction.h ++++ b/src/transaction.h +@@ -675,8 +675,10 @@ public: + + /** + * Returns the package icon from the \p packageID ++ * ++ * @deprecated use Appstream to fetch icons + */ +- static QString packageIcon(const QString &packageID); ++ static QT_DEPRECATED QString packageIcon(const QString &packageID); + + Q_SIGNALS: + void allowCancelChanged(); +-- +2.1.0 + diff --git a/PackageKit-Qt.spec b/PackageKit-Qt.spec index 9ab9f75..0520de5 100644 --- a/PackageKit-Qt.spec +++ b/PackageKit-Qt.spec @@ -1,10 +1,12 @@ #global gitTag 396cb8e4ed03ef9352e0e0e8ff941355df877405 #global gitshort 396cb8e4 +%global qt5 1 + Summary: Qt support library for PackageKit Name: PackageKit-Qt Version: 0.9.2 -Release: 6%{?dist} +Release: 7%{?dist} License: LGPLv2+ URL: http://www.packagekit.org/ @@ -22,7 +24,14 @@ Patch2: 0002-Remove-daemon-proxy-conection-to-changed.patch Patch3: 0003-Add-operator-to-bitfield.patch Patch4: 0004-Remove-the-metatype-registration-for-Transaction-typ.patch Patch5: 0005-Remove-RoleUpgradeSystem-as-it-s-not-supported-in-0..patch -#Patch6: 0006-Properly-export-cmake-targets.patch +Patch6: 0006-Properly-export-cmake-targets.patch +Patch7: 0007-Don-t-assume-the-target-is-packagekitqt5.patch +Patch8: 0008-Fix-compilation-due-to-not-set-cmake-variable.patch +Patch9: 0009-Fix-QPK-include-dir-in-cmake-module.patch +Patch10: 0010-Disable-namespacing-and-classes-names-on-the-interfa.patch +Patch11: 0011-Use-PackageKit-as-the-include-namespace-rather-than-.patch +Patch12: 0012-Use-GNUInstallDirs-to-determine-most-of-used-variabl.patch +Patch16: 0016-Deprecate-packageIcon-methods.patch BuildRequires: cmake BuildRequires: pkgconfig(QtDBus) pkgconfig(QtSql) @@ -38,17 +47,30 @@ Requires: PackageKit BuildRequires: PackageKit >= 0.9.1 %description -PackageKit-qt is a Qt support library for PackageKit +PackageKit-Qt is a Qt support library for PackageKit %package devel -Summary: Development headers for PackageKit-Qt +Summary: Development files for PackageKit-Qt Requires: %{name}%{?_isa} = %{version}-%{release} - Obsoletes: PackageKit-qt-devel < 0.8.6 Provides: PackageKit-qt-devel = %{version}-%{release} - %description devel -Development headers and libraries for PackageKit-Qt. +%{summary}. + +%if 0%{?qt5} +%package -n PackageKit-Qt5 +Summary: Qt5 support library for PackageKit +BuildRequires: pkgconfig(Qt5DBus) pkgconfig(Qt5Sql) +Requires: PackageKit +%description -n PackageKit-Qt5 +%{summary}. + +%package -n PackageKit-Qt5-devel +Summary: Development files for PackageKit-Qt5 +Requires: PackageKit-Qt5%{?_isa} = %{version}-%{release} +%description -n PackageKit-Qt5-devel +%{summary}. +%endif %prep @@ -60,13 +82,28 @@ mkdir -p %{_target_platform} pushd %{_target_platform} %{cmake} \ -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \ + -DUSE_QT5:BOOL=OFF \ .. popd make %{?_smp_mflags} -C %{_target_platform} +%if 0%{?qt5} +mkdir -p %{_target_platform}-qt5 +pushd %{_target_platform}-qt5 +%{cmake} \ + -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \ + -DUSE_QT5:BOOL=ON \ + .. +popd + +make %{?_smp_mflags} -C %{_target_platform}-qt5 +%endif %install +%if 0%{?qt5} +make install/fast DESTDIR=%{buildroot} -C %{_target_platform}-qt5 +%endif make install/fast DESTDIR=%{buildroot} -C %{_target_platform} @@ -81,13 +118,29 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %files devel %{_libdir}/libpackagekitqt4.so %{_libdir}/pkgconfig/packagekitqt4.pc -%dir %{_includedir}/PackageKit -%{_includedir}/PackageKit/packagekitqt4/ +%{_includedir}/packagekitqt4/ %dir %{_libdir}/cmake %{_libdir}/cmake/packagekitqt4/ +%if 0%{?qt5} +%files -n PackageKit-Qt5 +%doc AUTHORS NEWS COPYING +%{_libdir}/libpackagekitqt5.so.%{version} +%{_libdir}/libpackagekitqt5.so.0 + +%files -n PackageKit-Qt5-devel +%{_libdir}/libpackagekitqt5.so +%{_libdir}/pkgconfig/packagekitqt5.pc +%{_includedir}/packagekitqt5/ +%dir %{_libdir}/cmake +%{_libdir}/cmake/packagekitqt5/ +%endif + %changelog +* Fri Oct 03 2014 Rex Dieter 0.9.2-7 +- cleanup, pull in latest upstream fixes, -Qt5 support + * Thu Sep 04 2014 Adam Williamson - 0.9.2-6 - require PackageKit (#1003122)