aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2020-04-15 04:09:06 +0000
committerAriadne Conill <ariadne@dereferenced.org>2020-04-15 04:10:33 +0000
commitd5877e5944a4ba6ae4ff097a7c7888174fda929a (patch)
treea8568322b9e705636fdc5ef482cb5c4686fd092f
parent9f31a59630b6523e6cd8219332ca6c34daaa26b5 (diff)
downloadaports-d5877e5944a4ba6ae4ff097a7c7888174fda929a.tar.gz
aports-d5877e5944a4ba6ae4ff097a7c7888174fda929a.tar.bz2
aports-d5877e5944a4ba6ae4ff097a7c7888174fda929a.tar.xz
community/quassel: fix build, re-enable, take maintainership due to inactivity
-rw-r--r--community/quassel/APKBUILD10
-rw-r--r--community/quassel/qt-5.14-fix.patch118
2 files changed, 124 insertions, 4 deletions
diff --git a/community/quassel/APKBUILD b/community/quassel/APKBUILD
index ba8b77d4dd..08b84d68d2 100644
--- a/community/quassel/APKBUILD
+++ b/community/quassel/APKBUILD
@@ -1,11 +1,11 @@
-# Maintainer: Yves Schumann <yves@eisfair.org>
-
+# Contributor: Yves Schumann <yves@eisfair.org>
+# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=quassel
pkgver=0.13.1
pkgrel=5
url="https://www.quassel-irc.org/"
pkgdesc="Distributed IRC client - metapackage"
-arch="" # Fails with new qt
+arch="all"
license="GPL-2.0-or-later"
options="!check"
install="$pkgname-core.pre-install"
@@ -23,6 +23,7 @@ makedepends="cmake paxmark dbus-dev icu-dev openldap-dev openssl-dev
source="https://www.quassel-irc.org/pub/$pkgname-$pkgver.tar.bz2
quasselcore.confd
quasselcore.initd
+ qt-5.14-fix.patch
"
subpackages="$pkgname-common::noarch
$pkgname-core:server $pkgname-core-openrc:server_openrc
@@ -127,4 +128,5 @@ mono() {
sha512sums="4ed55e81b1638c8851ddae5d9c9d23a1c2cea92f307e19f426873c2600d8e183898d3ed7c290f2ea5d1b8c5e1be7f9ffcc3e8c3c0193d080fc879b10cc3a962c quassel-0.13.1.tar.bz2
56d4b05fcb2702c103a611a170e444e237bd7c8626219063e5853c3efa5d91e21fa9b726b056393070e35b7d7efe0a145ac3ab61413bc8033642d7acb622b638 quasselcore.confd
-7a0dd5a04b28c3099b4c9e98a25e6dc2b72bdb1e450e7299f9556487f6b34748ae881a4ccb955396e2ac0eab5d3fce4dbea426d7fa498d069f5d185057efa4cf quasselcore.initd"
+7a0dd5a04b28c3099b4c9e98a25e6dc2b72bdb1e450e7299f9556487f6b34748ae881a4ccb955396e2ac0eab5d3fce4dbea426d7fa498d069f5d185057efa4cf quasselcore.initd
+4be9792b0398a229102d5cef2b3931e1e9d9851ea99e647f0896c0cf9683db95ea559d7f5fb075388baea0af68cb4a30090ff95732469ecb64c439d7b8cabea0 qt-5.14-fix.patch"
diff --git a/community/quassel/qt-5.14-fix.patch b/community/quassel/qt-5.14-fix.patch
new file mode 100644
index 0000000000..f0305ea53c
--- /dev/null
+++ b/community/quassel/qt-5.14-fix.patch
@@ -0,0 +1,118 @@
+commit c90702bdbc43fc542d7df6d5ec4b321912ca0035
+Author: Manuel Nickschas <sputnick@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@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"