[arch-commits] Commit in quassel/trunk (PKGBUILD quassel-0.13.1-qt5.14.patch)
Balló György
bgyorgy at archlinux.org
Thu Jun 4 10:11:23 UTC 2020
Date: Thursday, June 4, 2020 @ 10:11:22
Author: bgyorgy
Revision: 638882
upgpkg: quassel 0.13.1-3: Fix build (FS#65085), add AppStream metadata
Added:
quassel/trunk/quassel-0.13.1-qt5.14.patch
Modified:
quassel/trunk/PKGBUILD
-----------------------------+
PKGBUILD | 10 +++
quassel-0.13.1-qt5.14.patch | 118 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 127 insertions(+), 1 deletion(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-06-04 10:03:31 UTC (rev 638881)
+++ PKGBUILD 2020-06-04 10:11:22 UTC (rev 638882)
@@ -7,7 +7,7 @@
'quassel-client-small'
'quassel-monolithic')
pkgver=0.13.1
-pkgrel=2
+pkgrel=3
pkgdesc="Next-generation distributed IRC client"
arch=('x86_64')
url="https://quassel-irc.org/"
@@ -17,6 +17,7 @@
'extra-cmake-modules' 'python' 'hicolor-icon-theme')
source=(https://quassel-irc.org/pub/$pkgbase-$pkgver.tar.bz2
0001-qtui-Set-desktop-file-name.patch
+ quassel-0.13.1-qt5.14.patch
$pkgbase.service
$pkgbase.sysusers
$pkgbase.tmpfiles
@@ -23,6 +24,7 @@
$pkgbase.conf)
sha256sums=('48efee9778743b1db9f44efb91d1c913104db01190c57f2ff57483c39a97e855'
'695ff3b605ea62ccfdf9ec4b9e6ffa74f3e2c0ac81402d51a74d263c47886c92'
+ '3d43f498df04db59a5199e0a81b8fd7ac37ef46fffb0c69ab5a17bcafb6d8c65'
'5dbe20290f3361b9b7a74a52905137e76b656976febf2d31082a2276f9dcde7f'
'3c72441a99e2668c6a8a751fa07beeb44f937576c8a1b5f615e4a55f841d93d9'
'2afd4340c7713f6533e5d175a86b28fd118ecd907776c2b10925d1a4fb31cdca'
@@ -31,6 +33,7 @@
prepare() {
cd $pkgbase-$pkgver
patch -Np1 -i ../0001-qtui-Set-desktop-file-name.patch
+ patch -Np1 -i ../quassel-0.13.1-qt5.14.patch
}
_build() (
@@ -102,6 +105,7 @@
conflicts=('quassel-monolithic' 'quassel-client-small')
_install client
+ install -Dm644 $pkgbase-$pkgver/data/quasselclient.appdata.xml "$pkgdir/usr/share/metainfo/quasselclient.appdata.xml"
}
package_quassel-client-small() {
@@ -111,6 +115,9 @@
replaces=('quassel-remote')
_install client-small
+
+ # Ignore package by AppStream to avoid duplicated IDs
+ echo 'X-AppStream-Ignore=true' >> "$pkgdir/usr/share/applications/quasselclient.desktop"
}
package_quassel-monolithic() {
@@ -121,4 +128,5 @@
conflicts=('quassel-client' 'quassel-client-small')
_install monolithic
+ install -Dm644 $pkgbase-$pkgver/data/quassel.appdata.xml "$pkgdir/usr/share/metainfo/quassel.appdata.xml"
}
Added: quassel-0.13.1-qt5.14.patch
===================================================================
--- quassel-0.13.1-qt5.14.patch (rev 0)
+++ quassel-0.13.1-qt5.14.patch 2020-06-04 10:11:22 UTC (rev 638882)
@@ -0,0 +1,118 @@
+commit c90702bdbc43fc542d7df6d5ec4b321912ca0035
+Author: Manuel Nickschas <sputnick at quassel-irc.org>
+Date: Tue Jan 7 18:34:54 2020 +0100
+
+ common: Disable enum type stream operators for Qt >= 5.14
+
+ Starting from version 5.14, Qt provides stream operators for enum
+ types, which collide with the ones we ship in types.h. Disable
+ Quassel's stream operators when compiling against Qt 5.14 or later.
+
+ Add a unit test that ensures that enum serialization honors the width
+ of the underlying type.
+
+diff --git a/src/common/types.h b/src/common/types.h
+index 467d9fb2..c4b9f364 100644
+--- a/src/common/types.h
++++ b/src/common/types.h
+@@ -140,6 +140,7 @@ Q_DECLARE_METATYPE(QHostAddress)
+ typedef QList<MsgId> MsgIdList;
+ typedef QList<BufferId> BufferIdList;
+
++#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ /**
+ * Catch-all stream serialization operator for enum types.
+ *
+@@ -169,6 +170,7 @@ QDataStream &operator>>(QDataStream &in, T &value) {
+ value = static_cast<T>(v);
+ return in;
+ }
++#endif
+
+ // Exceptions
+
+diff --git a/src/common/typestest.cpp b/src/common/typestest.cpp
+new file mode 100644
+index 00000000..04031c29
+--- /dev/null
++++ b/src/common/typestest.cpp
+@@ -0,0 +1,79 @@
++/***************************************************************************
++ * Copyright (C) 2005-2020 by the Quassel Project *
++ * devel at quassel-irc.org *
++ * *
++ * This program is free software; you can redistribute it and/or modify *
++ * it under the terms of the GNU General Public License as published by *
++ * the Free Software Foundation; either version 2 of the License, or *
++ * (at your option) version 3. *
++ * *
++ * This program 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 General Public License for more details. *
++ * *
++ * You should have received a copy of the GNU General Public License *
++ * along with this program; if not, write to the *
++ * Free Software Foundation, Inc., *
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
++ ***************************************************************************/
++
++#include <cstdint>
++
++#include <QByteArray>
++#include <QDataStream>
++#include <QObject>
++
++#include "testglobal.h"
++#include "types.h"
++
++using namespace ::testing;
++
++class EnumHolder
++{
++ Q_GADGET
++
++public:
++ enum class Enum16 : uint16_t {};
++ enum class Enum32 : uint32_t {};
++
++ enum class EnumQt16 : uint16_t {};
++ Q_ENUM(EnumQt16)
++ enum class EnumQt32 : uint32_t {};
++ Q_ENUM(EnumQt32)
++};
++
++// Verify that enums are (de)serialized as their underlying type
++TEST(TypesTest, enumSerialization)
++{
++ QByteArray data;
++ QDataStream out(&data, QIODevice::WriteOnly);
++
++ // Serialize
++ out << EnumHolder::Enum16(0xabcd);
++ ASSERT_THAT(data.size(), Eq(2));
++ out << EnumHolder::Enum32(0x123456);
++ ASSERT_THAT(data.size(), Eq(6));
++ out << EnumHolder::EnumQt16(0x4321);
++ ASSERT_THAT(data.size(), Eq(8));
++ out << EnumHolder::Enum32(0xfedcba);
++ ASSERT_THAT(data.size(), Eq(12));
++ ASSERT_THAT(out.status(), Eq(QDataStream::Status::Ok));
++
++ // Deserialize
++ QDataStream in(data);
++ EnumHolder::Enum16 enum16;
++ EnumHolder::Enum32 enum32;
++ EnumHolder::EnumQt16 enumQt16;
++ EnumHolder::EnumQt32 enumQt32;
++ in >> enum16 >> enum32 >> enumQt16 >> enumQt32;
++ ASSERT_THAT(in.status(), Eq(QDataStream::Status::Ok));
++ EXPECT_TRUE(in.atEnd());
++
++ EXPECT_THAT((int)enum16, Eq(0xabcd));
++ EXPECT_THAT((int)enum32, Eq(0x123456));
++ EXPECT_THAT((int)enumQt16, Eq(0x4321));
++ EXPECT_THAT((int)enumQt32, Eq(0xfedcba));
++}
++
++#include "typestest.moc"
More information about the arch-commits
mailing list