diff options
author | Martchus | 2023-12-21 19:00:35 +0100 |
---|---|---|
committer | Martchus | 2023-12-21 19:00:35 +0100 |
commit | fa4086ee79d6818e14161def3608e2d461926168 (patch) | |
tree | d2748c4b773ae74e32890393e4e1d338be7969c7 | |
parent | f3d9a60238850268b5fbd08a6c2e90f30b38329b (diff) | |
download | aur-fa4086ee79d6818e14161def3608e2d461926168.tar.gz |
Add patches for Qt 6.7
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 0001-Fix-compilation-with-Qt-6.7.0beta1.patch | 33 | ||||
-rw-r--r-- | 0002-Fix-rendering-issues-with-Syncthing-icon-with-Qt-6.7.patch | 60 | ||||
-rw-r--r-- | PKGBUILD | 15 |
4 files changed, 110 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = syncthingtray-qt6 pkgdesc = Tray application for Syncthing (using Qt 6) pkgver = 1.4.11 - pkgrel = 1 + pkgrel = 2 url = https://github.com/Martchus/syncthingtray arch = i686 arch = x86_64 @@ -29,6 +29,10 @@ pkgbase = syncthingtray-qt6 depends = qt6-webengine depends = qt6-declarative source = syncthingtray-1.4.11.tar.gz::https://github.com/Martchus/syncthingtray/archive/v1.4.11.tar.gz + source = 0001-Fix-compilation-with-Qt-6.7.0beta1.patch + source = 0002-Fix-rendering-issues-with-Syncthing-icon-with-Qt-6.7.patch sha256sums = 0c48da193eb29338590bb297052a1274284d9c596a5078541c4d7cdf6b6eba6f + sha256sums = SKIP + sha256sums = SKIP pkgname = syncthingtray-qt6 diff --git a/0001-Fix-compilation-with-Qt-6.7.0beta1.patch b/0001-Fix-compilation-with-Qt-6.7.0beta1.patch new file mode 100644 index 000000000000..ee7220381861 --- /dev/null +++ b/0001-Fix-compilation-with-Qt-6.7.0beta1.patch @@ -0,0 +1,33 @@ +From 51e266fbacff04708b7a8ff401ea78fe74a6d87d Mon Sep 17 00:00:00 2001 +From: Martchus <martchus@gmx.net> +Date: Thu, 21 Dec 2023 18:24:50 +0100 +Subject: [PATCH 1/2] Fix compilation with Qt 6.7.0beta1 + +Fix the wrong placement of the `-->`; not sure why this was not detected as +invalid XML before. +--- + syncthingconnector/org.freedesktop.systemd1.Unit.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/syncthingconnector/org.freedesktop.systemd1.Unit.xml b/syncthingconnector/org.freedesktop.systemd1.Unit.xml +index 035118e..a070755 100644 +--- a/syncthingconnector/org.freedesktop.systemd1.Unit.xml ++++ b/syncthingconnector/org.freedesktop.systemd1.Unit.xml +@@ -206,12 +206,12 @@ + <!--<property name="Conditions" type="a(sbbsi)" access="read"> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false" /> + </property> +- <property name="Asserts" type="a(sbbsi)" access="read">--> ++ <property name="Asserts" type="a(sbbsi)" access="read"> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false" /> + </property> + <property name="LoadError" type="(ss)" access="read"> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const" /> +- </property> ++ </property>--> + <property name="Transient" type="b" access="read"> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const" /> + </property> +-- +2.43.0 + diff --git a/0002-Fix-rendering-issues-with-Syncthing-icon-with-Qt-6.7.patch b/0002-Fix-rendering-issues-with-Syncthing-icon-with-Qt-6.7.patch new file mode 100644 index 000000000000..488ed59d9b4c --- /dev/null +++ b/0002-Fix-rendering-issues-with-Syncthing-icon-with-Qt-6.7.patch @@ -0,0 +1,60 @@ +From e2c1f4ebe4a1f520cdbe24844d2fef750b85b8ec Mon Sep 17 00:00:00 2001 +From: Martchus <martchus@gmx.net> +Date: Thu, 21 Dec 2023 18:50:30 +0100 +Subject: [PATCH 2/2] Fix rendering issues with Syncthing icon with Qt + 6.7.0beta1 + +It looks like Qt Svg supports masking as of 6.7 which revealed a bug in the +code for making Syncthing icons. The mask for the emblem area was also +accidentally applied in case no emblem is shown. This change adds the mask +only when an emblem is shown. +--- + syncthingmodel/syncthingicons.cpp | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +diff --git a/syncthingmodel/syncthingicons.cpp b/syncthingmodel/syncthingicons.cpp +index 3f27cde..b2aab59 100644 +--- a/syncthingmodel/syncthingicons.cpp ++++ b/syncthingmodel/syncthingicons.cpp +@@ -93,9 +93,20 @@ QByteArray makeSyncthingIcon(const StatusIconColorSet &colors, StatusEmblem stat + "</g>" + ), + }; ++ static const auto emblemAreaMaskAttribute = QStringLiteral(" mask=\"url(#bitemask)\""); ++ static const auto emblemAreaMask = QStringLiteral( ++ "<mask id=\"bitemask\" maskUnits=\"userSpaceOnUse\">" ++ "<g>" ++ "<rect id=\"mask-bg\" x=\"0\" y=\"0\" width=\"16\" height=\"16\" style=\"fill:#ffffff\"/>" ++ "<circle id=\"mask-subtract\" cx=\"11.5\" cy=\"11.5\" r=\"5.5\" style=\"fill:#000000\"/>" ++ "</g>" ++ "</mask>" ++ ); + static const auto normalStrokeWidth = QStringLiteral("0.81771719"), thickStrokeWidth = QStringLiteral("1.22"); + static const auto normalCircleRadius = QStringLiteral("1.22"), largeCircleRadius = QStringLiteral("1.5"); + const auto &emblemData = emblems[static_cast<int>(statusEmblem)]; ++ const auto &emblemAreaMaskAttributeData = statusEmblem != StatusEmblem::None ? emblemAreaMaskAttribute : emblems[0]; ++ const auto &emblemAreaMaskData = statusEmblem != StatusEmblem::None ? emblemAreaMask : emblems[0]; + const auto &strokeWidthF = strokeWidth == StatusIconStrokeWidth::Normal ? normalStrokeWidth : thickStrokeWidth; + const auto &circleRadius = strokeWidth == StatusIconStrokeWidth::Normal ? normalCircleRadius : largeCircleRadius; + return (QStringLiteral( +@@ -105,15 +116,9 @@ QByteArray makeSyncthingIcon(const StatusIconColorSet &colors, StatusEmblem stat + "<linearGradient id=\"grad\" gradientUnits=\"userSpaceOnUse\" x1=\"8\" y1=\"0\" x2=\"8\" y2=\"16\">" + "<stop offset=\"0\" style=\"stop-color:") % gradientStartColor % QStringLiteral("\"/>" + "<stop offset=\"1\" style=\"stop-color:") % gradientEndColor % QStringLiteral("\"/>" +- "</linearGradient>" +- "<mask id=\"bitemask\" maskUnits=\"userSpaceOnUse\">" +- "<g>" +- "<rect id=\"mask-bg\" x=\"0\" y=\"0\" width=\"16\" height=\"16\" style=\"fill:#ffffff\"/>" +- "<circle id=\"mask-subtract\" cx=\"11.5\" cy=\"11.5\" r=\"5.5\" style=\"fill:#000000\"/>" +- "</g>" +- "</mask>" ++ "</linearGradient>") % emblemAreaMaskData % QStringLiteral( + "</defs>" +- "<g id=\"syncthing-logo\" mask=\"url(#bitemask)\">" ++ "<g id=\"syncthing-logo\"") % emblemAreaMaskAttributeData % QStringLiteral(">" + "<circle id=\"outer\" cx=\"8\" cy=\"8\" r=\"8\" style=\"fill:url(#grad)\"/>" + "<circle id=\"inner\" cx=\"8\" cy=\"7.9727402\" r=\"5.9557071\" style=\"fill:none;stroke:") % strokeColor % QStringLiteral(";stroke-width:") % strokeWidthF % QStringLiteral("\"/>" + "<line id=\"arm-l\" x1=\"9.1993189\" y1=\"8.776825\" x2=\"2.262351\" y2=\"9.4173737\" style=\"stroke:") % strokeColor % QStringLiteral(";stroke-width:") % strokeWidthF % QStringLiteral("\"/>" +-- +2.43.0 + @@ -27,7 +27,7 @@ _cfg=qt6 pkgname=syncthingtray-$_cfg _name=${pkgname%-$_cfg} pkgver=1.4.11 -pkgrel=1 +pkgrel=2 arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64') pkgdesc='Tray application for Syncthing (using Qt 6)' license=('GPL') @@ -45,13 +45,22 @@ checkdepends=('cppunit' 'syncthing' 'iproute2') [[ $_enable_kio_plugin ]] && makedepends+=('kio') [[ $_enable_plasmoid ]] && makedepends+=('libplasma' 'extra-cmake-modules') url="https://github.com/Martchus/${_reponame}" -source=("${_name}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/archive/v${pkgver}.tar.gz") -sha256sums=('0c48da193eb29338590bb297052a1274284d9c596a5078541c4d7cdf6b6eba6f') +source=("${_name}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/archive/v${pkgver}.tar.gz" + 0001-Fix-compilation-with-Qt-6.7.0beta1.patch + 0002-Fix-rendering-issues-with-Syncthing-icon-with-Qt-6.7.patch) +sha256sums=('0c48da193eb29338590bb297052a1274284d9c596a5078541c4d7cdf6b6eba6f' + SKIP SKIP) ephemeral_port() { comm -23 <(seq 49152 65535) <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort | uniq) | shuf | head -n 1 } +prepare() { + cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}" + patch -p1 -i ../0001-Fix-compilation-with-Qt-6.7.0beta1.patch + patch -p1 -i ../0002-Fix-rendering-issues-with-Syncthing-icon-with-Qt-6.7.patch +} + build() { cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}" |