From ce82be3b6d52c2b4f4717f1f8229fe77edfd2676 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 29 Sep 2016 08:34:50 -0500 Subject: [PATCH] libaccounts-qt-1.15, drop qt4 support (FTBFS) --- .gitignore | 1 + 0002-Fix-memory-leaks-found-by-valgrind.patch | 60 ----------------- 0005-Use-gboolean-instead-of-bool.patch | 34 ---------- libaccounts-qt.spec | 65 ++++--------------- sources | 2 +- 5 files changed, 13 insertions(+), 149 deletions(-) delete mode 100644 0002-Fix-memory-leaks-found-by-valgrind.patch delete mode 100644 0005-Use-gboolean-instead-of-bool.patch diff --git a/.gitignore b/.gitignore index bc201bd..70750ee 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ accounts-qt-0.31.tar.gz /accounts-qt-1.6.tar.bz2 /accounts-qt-1.11.tar.bz2 /libaccounts-qt-1.13-2a9cc22ff7b0b62b60541423763cb3dd992c0f40.tar.gz +/libaccounts-qt-1.15.tar.gz diff --git a/0002-Fix-memory-leaks-found-by-valgrind.patch b/0002-Fix-memory-leaks-found-by-valgrind.patch deleted file mode 100644 index fa2936c..0000000 --- a/0002-Fix-memory-leaks-found-by-valgrind.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 533aa917f2de9030a05e745a0e49a53a7fb4b36e Mon Sep 17 00:00:00 2001 -From: Vyacheslav Monich -Date: Fri, 5 Sep 2014 16:23:44 +0300 -Subject: [PATCH 2/6] Fix memory leaks found by valgrind - -Fixes: https://code.google.com/p/accounts-sso/issues/detail?id=239 ---- - Accounts/account-service.cpp | 4 +++- - Accounts/auth-data.cpp | 1 + - Accounts/utils.cpp | 4 +++- - 3 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/Accounts/account-service.cpp b/Accounts/account-service.cpp -index 9da8f8c..6661685 100644 ---- a/Accounts/account-service.cpp -+++ b/Accounts/account-service.cpp -@@ -504,5 +504,7 @@ AuthData AccountService::authData() const - - AgAuthData *agAuthData = - ag_account_service_get_auth_data(d->m_accountService); -- return AuthData(agAuthData); -+ AuthData authData(agAuthData); -+ ag_auth_data_unref(agAuthData); -+ return authData; - } -diff --git a/Accounts/auth-data.cpp b/Accounts/auth-data.cpp -index ef4b8d9..ed30396 100644 ---- a/Accounts/auth-data.cpp -+++ b/Accounts/auth-data.cpp -@@ -109,6 +109,7 @@ QVariantMap AuthData::parameters() const - if (glibParameters == 0) return QVariantMap(); - - QVariant variant = gVariantToQVariant(glibParameters); -+ g_variant_unref(glibParameters); - if (!variant.isValid()) return QVariantMap(); - - return variant.toMap(); -diff --git a/Accounts/utils.cpp b/Accounts/utils.cpp -index 71e24b6..dd0c7e1 100644 ---- a/Accounts/utils.cpp -+++ b/Accounts/utils.cpp -@@ -32,12 +32,14 @@ static QVariantMap gVariantToQVariantMap(GVariant *variant) - { - QVariantMap ret; - GVariantIter iter; -- const gchar *key; -+ gchar *key; - GVariant *value; - - g_variant_iter_init (&iter, variant); - while (g_variant_iter_next (&iter, "{sv}", &key, &value)) { - ret.insert(UTF8(key), gVariantToQVariant(value)); -+ g_variant_unref(value); -+ g_free(key); - } - - return ret; --- -2.5.0 - diff --git a/0005-Use-gboolean-instead-of-bool.patch b/0005-Use-gboolean-instead-of-bool.patch deleted file mode 100644 index 2d52b19..0000000 --- a/0005-Use-gboolean-instead-of-bool.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 207139e65e6707100d2e92d96b1a4c3bfaa88a5f Mon Sep 17 00:00:00 2001 -From: Mikko Harju -Date: Thu, 13 Aug 2015 03:09:07 -0400 -Subject: [PATCH 5/6] Use gboolean instead of bool - -The "use-dbus" is a boolean g_object property, with actual type of -gboolean, and gboolean is typedef int. g_object_get is a variadic -function (no static type checking), and stores the queried value -through pointer-to-int. If sizeof(bool) happens to be less than -sizeof(int) and the stack variable useDBus is packed tightly, -this can lead to stack corruption. - -Compiling the lib with -fstack-protector immediately pointed out -the problem. ---- - Accounts/manager.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Accounts/manager.cpp b/Accounts/manager.cpp -index 2eb077f..1ac78d0 100644 ---- a/Accounts/manager.cpp -+++ b/Accounts/manager.cpp -@@ -530,7 +530,7 @@ bool Manager::abortOnTimeout() const - */ - Manager::Options Manager::options() const - { -- bool useDBus = true; -+ gboolean useDBus = true; - g_object_get(d->m_manager, - "use-dbus", &useDBus, - NULL); --- -2.5.0 - diff --git a/libaccounts-qt.spec b/libaccounts-qt.spec index c21237a..67353a8 100644 --- a/libaccounts-qt.spec +++ b/libaccounts-qt.spec @@ -1,22 +1,18 @@ -%global commit0 2a9cc22ff7b0b62b60541423763cb3dd992c0f40 +%global commit0 5b272ae218ccdf1f67f4eed92e2cdbe21c56ceb8 +%global tag0 VERSION_%{version} Name: libaccounts-qt Summary: Accounts framework Qt bindings -Version: 1.13 -Release: 13%{?dist} +Version: 1.15 +Release: 1%{?dist} License: LGPLv2 URL: https://gitlab.com/accounts-sso/libaccounts-qt -Source0: https://gitlab.com/accounts-sso/libaccounts-qt/repository/archive.tar.gz?ref=%{version}#/libaccounts-qt-%{version}-%{commit0}.tar.gz +Source0: https://gitlab.com/accounts-sso/libaccounts-qt/repository/archive.tar.gz?ref=%{tag0}#/libaccounts-qt-%{version}.tar.gz -## upstream patches -Patch102: 0002-Fix-memory-leaks-found-by-valgrind.patch -patch105: 0005-Use-gboolean-instead-of-bool.patch - -BuildRequires: pkgconfig(QtGui) -BuildRequires: pkgconfig(libaccounts-glib) +BuildRequires: pkgconfig(libaccounts-glib) >= 1.23 BuildRequires: doxygen BuildRequires: graphviz @@ -53,36 +49,13 @@ BuildArch: noarch %prep -%setup -q -n libaccounts-qt-%{version}-%{commit0} - -# See https://community.kde.org/KTp/Setting_up_KAccounts#libaccounts-qt -# "Note that at this very day libaccounts-qt qmake does **NOT** support compiling the library outside the source directory" - -%patch102 -p1 -b .0002 -%patch105 -p1 -b .0005 +%setup -q -n libaccounts-qt-%{tag0}-%{commit0} # See https://community.kde.org/KTp/Setting_up_KAccounts#libaccounts-qt # "Note that at this very day libaccounts-qt qmake does **NOT** support compiling the library outside the source directory" -## HACK ## -mkdir orig -mv * orig/ ||: -cp -a orig/ %{_target_platform}-qt4/ -cp -a orig/ %{_target_platform}-qt5/ -mv orig/* . %build -pushd %{_target_platform}-qt4 -%{qmake_qt4} \ - QMF_INSTALL_ROOT=%{_prefix} \ - CONFIG+=release \ - LIBDIR=%{_libdir} \ - accounts-qt.pro - -make %{?_smp_mflags} -popd - -pushd %{_target_platform}-qt5 %{qmake_qt5} \ QMF_INSTALL_ROOT=%{_prefix} \ CONFIG+=release \ @@ -90,12 +63,10 @@ pushd %{_target_platform}-qt5 accounts-qt.pro make %{?_smp_mflags} -popd %install -make install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-qt4 -make install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-qt5 +make install INSTALL_ROOT=%{buildroot} # create/own dirs mkdir -p %{buildroot}%{_datadir}/accounts/{providers,services} @@ -108,22 +79,6 @@ rm -rfv %{buildroot}%{_datadir}/libaccounts-qt-tests rm -fv %{buildroot}%{_bindir}/accountstest -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig - -%files -%license COPYING -%{_libdir}/libaccounts-qt.so.* -%dir %{_datadir}/accounts/ -%dir %{_datadir}/accounts/providers/ -%dir %{_datadir}/accounts/services/ - -%files devel -%{_libdir}/libaccounts-qt.so -%{_includedir}/accounts-qt/ -%{_libdir}/pkgconfig/accounts-qt.pc -%{_libdir}/cmake/AccountsQt/ - %post -n libaccounts-qt5 -p /sbin/ldconfig %postun -n libaccounts-qt5 -p /sbin/ldconfig @@ -134,7 +89,6 @@ rm -fv %{buildroot}%{_bindir}/accountstest %dir %{_datadir}/accounts/providers/ %dir %{_datadir}/accounts/services/ - %files -n libaccounts-qt5-devel %{_libdir}/libaccounts-qt5.so %{_includedir}/accounts-qt5/ @@ -146,6 +100,9 @@ rm -fv %{buildroot}%{_bindir}/accountstest %changelog +* Thu Sep 29 2016 Rex Dieter - 1.15-1 +- libaccounts-qt-1.15, drop qt4 support (FTBFS) + * Fri Aug 12 2016 Rex Dieter - 1.13-13 - more robust libdir handling (#1366692) diff --git a/sources b/sources index f7ea83e..707ff4e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -308ca7df89c05c71978b62910315867f libaccounts-qt-1.13-2a9cc22ff7b0b62b60541423763cb3dd992c0f40.tar.gz +092a2445bb1ef0173210c77c37af28d9 libaccounts-qt-1.15.tar.gz