0.7.2, ready qt5 support (not enabled yet)

This commit is contained in:
Rex Dieter 2014-09-30 08:55:11 -05:00
parent a73162ac5f
commit c198239de1
5 changed files with 39 additions and 266 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
/AppStream-0.6.2.tar.gz
/AppStream-0.7.1.tar.xz
/AppStream-0.7.2.tar.xz

View File

@ -1,82 +0,0 @@
From ac4ae2cd07034dff58ec69ff35b1b3b546da8a64 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Thu, 11 Sep 2014 17:49:39 +0200
Subject: [PATCH 5/7] Ensure that we do not convert NULL to a C++ string
---
src/as-component.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/as-component.c b/src/as-component.c
index 712afa4..22bc2d8 100644
--- a/src/as-component.c
+++ b/src/as-component.c
@@ -1061,6 +1061,10 @@ as_component_set_name (AsComponent *cpt, const gchar* value)
{
g_return_if_fail (cpt != NULL);
+ /* safety measure, so we can always convert this to a C++ string */
+ if (value == NULL)
+ value = "";
+
g_free (cpt->priv->name);
cpt->priv->name = g_strdup (value);
g_object_notify ((GObject *) cpt, "name");
@@ -1078,6 +1082,10 @@ as_component_set_name_original (AsComponent *cpt, const gchar* value)
{
g_return_if_fail (cpt != NULL);
+ /* safety measure, so we can always convert this to a C++ string */
+ if (value == NULL)
+ value = "";
+
g_free (cpt->priv->name_original);
cpt->priv->name_original = g_strdup (value);
g_object_notify ((GObject *) cpt, "name-original");
@@ -1096,6 +1104,10 @@ as_component_set_summary (AsComponent *cpt, const gchar* value)
{
g_return_if_fail (cpt != NULL);
+ /* safety measure, so we can always convert this to a C++ string */
+ if (value == NULL)
+ value = "";
+
g_free (cpt->priv->summary);
cpt->priv->summary = g_strdup (value);
g_object_notify ((GObject *) cpt, "summary");
@@ -1117,6 +1129,10 @@ as_component_set_description (AsComponent *cpt, const gchar* value)
{
g_return_if_fail (cpt != NULL);
+ /* safety measure, so we can always convert this to a C++ string */
+ if (value == NULL)
+ value = "";
+
g_free (cpt->priv->description);
cpt->priv->description = g_strdup (value);
g_object_notify ((GObject *) cpt, "description");
@@ -1174,6 +1190,10 @@ as_component_set_icon (AsComponent *cpt, const gchar* value)
{
g_return_if_fail (cpt != NULL);
+ /* safety measure, so we can always convert this to a C++ string */
+ if (value == NULL)
+ value = "";
+
g_free (cpt->priv->icon);
cpt->priv->icon = g_strdup (value);
g_object_notify ((GObject *) cpt, "icon");
@@ -1208,6 +1228,10 @@ as_component_set_icon_url (AsComponent *cpt, const gchar* value)
{
g_return_if_fail (cpt != NULL);
+ /* safety measure, so we can always convert this to a C++ string */
+ if (value == NULL)
+ value = "";
+
g_free (cpt->priv->icon_url);
cpt->priv->icon_url = g_strdup (value);
g_object_notify ((GObject *) cpt, "icon-url");
--
1.9.3

View File

@ -1,176 +0,0 @@
From e149e933232febcccf8baae5af8efa9a4d5cc490 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Fri, 12 Sep 2014 13:48:17 +0200
Subject: [PATCH 6/7] Remove the PackageKit plugin
Tools which modify the AppStream data will now have to call
$ appstream-index refresh
in order to get the cache updated (or use the equivalent libas API
calls)
---
src/CMakeLists.txt | 8 +---
src/pk-plugin/CMakeLists.txt | 30 ------------
src/pk-plugin/pk-plugin-appstream.c | 91 -------------------------------------
3 files changed, 1 insertion(+), 128 deletions(-)
delete mode 100644 src/pk-plugin/CMakeLists.txt
delete mode 100644 src/pk-plugin/pk-plugin-appstream.c
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2359144..366833f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -96,10 +96,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/xapian
${YAML_INCLUDE_DIR}
)
-add_definitions("-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE"
- "-DI_KNOW_THE_PACKAGEKIT_PLUGIN_API_IS_SUBJECT_TO_CHANGE"
- "-DAS_COMPILATION"
-)
+add_definitions("-DAS_COMPILATION")
# ensure that the GI compiler has been found (apparently, the automatic tests fail on some machines)
if (INTROSPECTION_COMPILER STREQUAL "")
@@ -145,6 +142,3 @@ gir_add_introspections(INTROSPECTION_GIRS)
install(TARGETS appstream DESTINATION ${INSTALL_DIR_LIB})
install(FILES ${LIBAPPSTREAM_PUBLIC_HEADERS} DESTINATION include/Appstream)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/appstream.pc DESTINATION ${INSTALL_DIR_LIB}/pkgconfig/)
-
-# include the PackageKit plugin
-add_subdirectory(pk-plugin)
diff --git a/src/pk-plugin/CMakeLists.txt b/src/pk-plugin/CMakeLists.txt
deleted file mode 100644
index f719dcc..0000000
--- a/src/pk-plugin/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# CMakeLists for AppStream PackageKit PlugIn
-
-find_package(GLIB2 REQUIRED)
-pkg_check_modules(GIO2 REQUIRED gio-2.0)
-pkg_check_modules(PACKAGEKIT REQUIRED packagekit-glib2)
-pkg_check_modules(PACKAGEKIT_PLUGIN REQUIRED packagekit-plugin)
-
-set(PK_APPSTREAM_SOURCES pk-plugin-appstream.c
-)
-
-add_library(pk_plugin_appstream MODULE ${PK_APPSTREAM_SOURCES})
-
-target_link_libraries(pk_plugin_appstream
- ${M_LIB}
- ${GIO2_LIBRARIES}
- ${PACKAGEKIT_LIBRARIES}
- ${PACKAGEKIT_PLUGIN_LIBRARIES}
- appstream
-)
-
-include_directories(${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}/src
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${GLIB2_INCLUDE_DIR}
- ${GIO2_INCLUDE_DIR}
- ${PACKAGEKIT_INCLUDE_DIRS}
- ${PACKAGEKIT_PLUGIN_INCLUDE_DIRS}
-)
-
-install(TARGETS pk_plugin_appstream DESTINATION ${INSTALL_DIR_LIB}/packagekit-plugins-2)
diff --git a/src/pk-plugin/pk-plugin-appstream.c b/src/pk-plugin/pk-plugin-appstream.c
deleted file mode 100644
index 2247fd5..0000000
--- a/src/pk-plugin/pk-plugin-appstream.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2012-2013 Matthias Klumpp <matthias@tenstral.net>
- *
- * Licensed under the GNU Lesser General Public License Version 2.1
- *
- * This library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 2.1 of the license, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <packagekit-glib2/packagekit.h>
-#include <plugin/packagekit-plugin.h>
-
-#include "../as-cache-builder.h"
-
-struct PkPluginPrivate {
- guint dummy;
-};
-
-/**
- * pk_plugin_get_description:
- */
-const gchar *
-pk_plugin_get_description (void)
-{
- return "Refreshes the Appstream database of available applications";
-}
-
-/**
- * pk_plugin_initialize:
- */
-void
-pk_plugin_initialize (PkPlugin *plugin)
-{
- /* create private area */
- plugin->priv = PK_TRANSACTION_PLUGIN_GET_PRIVATE (PkPluginPrivate);
-}
-
-/**
- * pk_plugin_transaction_finished_end:
- */
-void
-pk_plugin_transaction_finished_end (PkPlugin *plugin,
- PkTransaction *transaction)
-{
- AsBuilder *builder = NULL;
- PkRoleEnum role;
-
- /* skip simulate actions */
- if (pk_bitfield_contain (pk_transaction_get_transaction_flags (transaction),
- PK_TRANSACTION_FLAG_ENUM_SIMULATE)) {
- goto out;
- }
-
- /* skip only-download */
- if (pk_bitfield_contain (pk_transaction_get_transaction_flags (transaction),
- PK_TRANSACTION_FLAG_ENUM_ONLY_DOWNLOAD)) {
- goto out;
- }
-
- /* check the role */
- role = pk_transaction_get_role (transaction);
- if (role != PK_ROLE_ENUM_REFRESH_CACHE)
- goto out;
-
- /* use a local backend instance */
- pk_backend_reset_job (plugin->backend, plugin->job);
- pk_backend_job_set_status (plugin->job,
- PK_STATUS_ENUM_SCAN_APPLICATIONS);
-
- /* refresh the AppStream cache using the database builder */
- builder = as_builder_new ();
- as_builder_initialize (builder);
- as_builder_refresh_cache (builder, FALSE, NULL);
-
- pk_backend_job_set_percentage (plugin->job, 100);
- pk_backend_job_set_status (plugin->job, PK_STATUS_ENUM_FINISHED);
-out:
- if (builder != NULL)
- g_object_unref (builder);
-}
--
1.9.3

View File

@ -1,7 +1,7 @@
Summary: Utilities to generate, maintain and access the AppStream Xapian database
Name: appstream
Version: 0.7.1
Version: 0.7.2
Release: 1%{?dist}
# lib LGPLv2+, tools GPLv2+
@ -10,8 +10,6 @@ URL: http://www.freedesktop.org/wiki/Distributions/AppStream/Software
Source0: http://www.freedesktop.org/software/appstream/releases/AppStream-%{version}.tar.xz
## upstream patches
Patch5: 0005-Ensure-that-we-do-not-convert-NULL-to-a-C-string.patch
Patch6: 0006-Remove-the-PackageKit-plugin.patch
## upstreamable patches
@ -22,6 +20,9 @@ BuildRequires: pkgconfig(gio-2.0) pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(packagekit-glib2)
BuildRequires: pkgconfig(QtCore)
%if 0%{?qt5}
BuildRequires: pkgconfig(Qt5Core)
%endif
BuildRequires: pkgconfig(yaml-0.1)
BuildRequires: xapian-core-devel
BuildRequires: xmlto
@ -47,11 +48,23 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%package qt-devel
Summary: Development files for %{name}-qt bindings
Requires: %{name}-qt%{?_isa} = %{version}-%{release}
# until when/if this grows pkgconfig support and the dep is handled automatically
Requires: pkgconfig(QtCore)
%description qt-devel
%{summary}.
%package qt5
Summary: Qt bindings for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description qt5
%{summary}.
%package qt5-devel
Summary: Development files for %{name}-qt5 bindings
Requires: %{name}-qt5%{?_isa} = %{version}-%{release}
Requires: pkgconfig(Qt5Core)
%description qt5-devel
%{summary}.
%package vala
Summary: Vala bindings for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -69,7 +82,7 @@ Requires: vala
mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake} \
-DQT:BOOL=ON \
-DQT:BOOL=ON -DAPPSTREAM_QT_VERSION:STRING="4"\
-DTESTS:BOOL=ON \
-DVAPI:BOOL=ON \
..
@ -78,8 +91,24 @@ popd
# parallel build currently fails
make -j1 -C %{_target_platform}
%if 0%{?qt5}
mkdir -p %{_target_platform}-qt5
pushd %{_target_platform}-qt5
%{cmake} \
-DQT:BOOL=ON -DAPPSTREAM_QT_VERSION:STRING="5"\
-DTESTS:BOOL=ON \
-DVAPI: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}
mkdir -p %{buildroot}%{_datadir}/app-info/{icons,xmls}
@ -149,6 +178,9 @@ make test -C %{_target_platform} ARGS="--output-on-failure --timeout 300" ||:
%changelog
* Tue Sep 30 2014 Rex Dieter <rdieter@fedoraproject.org> 0.7.2-1
- 0.7.2, ready qt5 support (not enabled yet)
* Fri Sep 12 2014 Rex Dieter <rdieter@fedoraproject.org> 0.7.1-1
- 0.7.1

View File

@ -1 +1 @@
66a7f3d6d85d17a465ce9633a28380d0 AppStream-0.7.1.tar.xz
538a86023f05f28642fd9445b1d1e3e8 AppStream-0.7.2.tar.xz