summaryrefslogtreecommitdiff
path: root/dev-qt/qtsvg
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-24 23:59:54 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-24 23:59:54 +0000
commit401101f9c8077911929d3f2b60a37098460a5d89 (patch)
treec2bef4719f6787550f0916aeaa8f4f403a9296af /dev-qt/qtsvg
parent4cbcc855382a06088e2f016f62cafdbcb7e40665 (diff)
gentoo resync : 25.03.2022
Diffstat (limited to 'dev-qt/qtsvg')
-rw-r--r--dev-qt/qtsvg/Manifest5
-rw-r--r--dev-qt/qtsvg/files/qtsvg-5.15.3-QTBUG-90744-minus-binarypatch.patch142
-rw-r--r--dev-qt/qtsvg/qtsvg-5.15.3.ebuild34
3 files changed, 181 insertions, 0 deletions
diff --git a/dev-qt/qtsvg/Manifest b/dev-qt/qtsvg/Manifest
index 205aea56b91c..5bd1ed002390 100644
--- a/dev-qt/qtsvg/Manifest
+++ b/dev-qt/qtsvg/Manifest
@@ -1,3 +1,8 @@
+AUX qtsvg-5.15.3-QTBUG-90744-minus-binarypatch.patch 4929 BLAKE2B 0df696c3422105308a1f8f36150c2fbdf0ca900839380808f27455cd36f443b9f45aed818ee93130c9d687d26079588a20cf3cc90dd8da9aeadc5e8902d60cca SHA512 5a2ee79c21dd32ccce18a784d57d7d6b17dff2c109a548a1482152fe96f524e87cd5d09a504e15d6b1435059c431606335a92f03f70c9f28a63e5786cb78412c
DIST qtsvg-5.15.2-728012f7.tar.gz 2779740 BLAKE2B 6db82739d576dbb2d5958e48ee917dce9ce10fdf7af8b561f0c71ef3a90b97935e89f443ed1a95c827d85d87ffbb53595c27057f75bdac11939ba2bc9ef47f36 SHA512 ccf16606ff0abc9dce1279d58bd85489d0b1205da953842e12e8a9dad895c53a4420e4bd1aeafca1291f6721e2cc5c1a1178ad1d329832d21cc165646e8448d5
+DIST qtsvg-5.15.3-QTBUG-90744.tar.xz 632 BLAKE2B e7f2f52dc546f9520ac2311b417b86d697ab20f8d02318fce76d46b35efcaf3dccdab5377d65c01af3a193df478083733c466e3a778325e73184f84830080686 SHA512 1681a2e0395d97b30b49b981e342b7e647108ba19b1472f34239136e1b946da67afaac3454533139a55a0f5f0a5fd167596a2ca7b26e4c018fa41a91dd94cd7b
+DIST qtsvg-5.15.3-gentoo-kde-1.tar.xz 7384 BLAKE2B 25d0b5216ab6c0fc8758a55138000b641d2ca57a64095c1117c1d5da59cca3dda890fe2b0b8589d5be0ac19e73f3a329af5710dfa163a25609f068d673f830b5 SHA512 4b512bb8ea1ee6e38b28ad52a34a1f2b6a6a7ac72c341b8faacb599f6cd770924ae7a473052c59783653a734e8061d0167633954a6d3d9ae2ed33e0a65adeb44
+DIST qtsvg-everywhere-opensource-src-5.15.3.tar.xz 1886104 BLAKE2B feced6caaa2e2be089ffed77f32d3b0de899b8a97632234ca8aa9d1f34fc0ee94ecd44227bb7c40ec49f0a76b305dc29ad23498bff3c62f45054854ed632b1d1 SHA512 288ce98bb6dd746564c7ffbd0d8221d0816c62b7e33424cd21d945b40308292ec9a0b1e2b9cca6ce91d606c06813f05068cad590d827810383175bebfa8ab527
EBUILD qtsvg-5.15.2-r13.ebuild 535 BLAKE2B 4f36841bf587020481ca66e7489f9c99d0cdec5c00ad60b2eda3029b72de956469046c8fe4d0195bff9a1399f6e690fd1ef6c6e8d5b6af3854ef5c1b8e8da01d SHA512 7b07d9c8a06b3ede0f15b403f27532129f9bb6a8d8a49c6a8720222b63dab05bc0094ae4f8c364afb67fd1a6a381e954e0bbf56e452173247cbb52362f1581b2
+EBUILD qtsvg-5.15.3.ebuild 846 BLAKE2B 5c49b72b52c52ff966ebf8dbe522e3d8ac8bb322a0e1db31326a5f3641397169706c2e55001da2717e0c8dc500d5bd22c93c2ea6a189dc52009f5802d4e2edb5 SHA512 261ff38e35856981b3738358d2f5dd927fb5cbf9748bbce21bcfec87119bd39375268a959ef0a30ee383defc6cb6a019824a180434d726a5358d2f5a1bd2084f
MISC metadata.xml 482 BLAKE2B 651a49dc4a07f5e5a9c21990868e666d98acdea7d7b0b2c0e4c98eafc3da72c803d380e4abda30f33250f7bbd7654df713833ccdddcb975cbad6f92e488f643b SHA512 192c670abd7da29645513bf1d9297d942efdc49f5cf170861e7689fda47f51daa47f10c7c81c3b045366e0259179c6839ff7747197c9d792e8d0fd1a5818973e
diff --git a/dev-qt/qtsvg/files/qtsvg-5.15.3-QTBUG-90744-minus-binarypatch.patch b/dev-qt/qtsvg/files/qtsvg-5.15.3-QTBUG-90744-minus-binarypatch.patch
new file mode 100644
index 000000000000..1cdd5fd5ffcc
--- /dev/null
+++ b/dev-qt/qtsvg/files/qtsvg-5.15.3-QTBUG-90744-minus-binarypatch.patch
@@ -0,0 +1,142 @@
+From cfc616978b52a396b2ef6900546f7fc086d7cab3 Mon Sep 17 00:00:00 2001
+From: Eirik Aavitsland <eirik.aavitsland@qt.io>
+Date: Thu, 8 Apr 2021 13:19:52 +0200
+Subject: [PATCH 3/9] Make image handler accept UTF-16/UTF-32 encoded SVGs
+
+The canRead() header checks assumed 8 bit encoding.
+
+Pick-to: 6.1 6.0 5.15
+Fixes: QTBUG-90744
+Change-Id: Ibe934fe9ed31b89ee0fbfc4562aa66ab1b359225
+Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
+(cherry picked from commit 45fb1f07eaa984af40fca9f12b8f3d27f7b0e9ac)
+---
+ .../imageformats/svg/qsvgiohandler.cpp | 37 +++++++++++-------
+ tests/auto/qsvgplugin/simple_Utf16BE.svg | Bin 0 -> 228 bytes
+ tests/auto/qsvgplugin/simple_Utf16LE.svg | Bin 0 -> 228 bytes
+ tests/auto/qsvgplugin/simple_Utf32BE.svg | Bin 0 -> 456 bytes
+ tests/auto/qsvgplugin/simple_Utf32LE.svg | Bin 0 -> 456 bytes
+ tests/auto/qsvgplugin/simple_Utf8.svg | 3 ++
+ tests/auto/qsvgplugin/tst_qsvgplugin.cpp | 32 +++++++++++++++
+ 7 files changed, 57 insertions(+), 15 deletions(-)
+ create mode 100644 tests/auto/qsvgplugin/simple_Utf16BE.svg
+ create mode 100644 tests/auto/qsvgplugin/simple_Utf16LE.svg
+ create mode 100644 tests/auto/qsvgplugin/simple_Utf32BE.svg
+ create mode 100644 tests/auto/qsvgplugin/simple_Utf32LE.svg
+ create mode 100644 tests/auto/qsvgplugin/simple_Utf8.svg
+
+diff --git a/src/plugins/imageformats/svg/qsvgiohandler.cpp b/src/plugins/imageformats/svg/qsvgiohandler.cpp
+index bd39b2a..4136aaf 100644
+--- a/src/plugins/imageformats/svg/qsvgiohandler.cpp
++++ b/src/plugins/imageformats/svg/qsvgiohandler.cpp
+@@ -118,6 +118,24 @@ QSvgIOHandler::~QSvgIOHandler()
+ delete d;
+ }
+
++static bool isPossiblySvg(QIODevice *device, bool *isCompressed = nullptr)
++{
++ constexpr int bufSize = 64;
++ char buf[bufSize];
++ const qint64 readLen = device->peek(buf, bufSize);
++ if (readLen < 8)
++ return false;
++# ifndef QT_NO_COMPRESS
++ if (quint8(buf[0]) == 0x1f && quint8(buf[1]) == 0x8b) {
++ if (isCompressed)
++ *isCompressed = true;
++ return true;
++ }
++# endif
++ QTextStream str(QByteArray::fromRawData(buf, readLen));
++ QByteArray ba = str.read(16).trimmed().toLatin1();
++ return ba.startsWith("<?xml") || ba.startsWith("<svg") || ba.startsWith("<!--") || ba.startsWith("<!DOCTYPE svg");
++}
+
+ bool QSvgIOHandler::canRead() const
+ {
+@@ -126,15 +144,9 @@ bool QSvgIOHandler::canRead() const
+ if (d->loaded && !d->readDone)
+ return true; // Will happen if we have been asked for the size
+
+- QByteArray buf = device()->peek(16);
+-#ifndef QT_NO_COMPRESS
+- if (buf.startsWith("\x1f\x8b")) {
+- setFormat("svgz");
+- return true;
+- } else
+-#endif
+- if (buf.contains("<?xml") || buf.contains("<svg") || buf.contains("<!--") || buf.contains("<!DOCTYPE svg")) {
+- setFormat("svg");
++ bool isCompressed = false;
++ if (isPossiblySvg(device(), &isCompressed)) {
++ setFormat(isCompressed ? "svgz" : "svg");
+ return true;
+ }
+ return false;
+@@ -260,12 +272,7 @@ bool QSvgIOHandler::supportsOption(ImageOption option) const
+
+ bool QSvgIOHandler::canRead(QIODevice *device)
+ {
+- QByteArray buf = device->peek(16);
+- return
+-#ifndef QT_NO_COMPRESS
+- buf.startsWith("\x1f\x8b") ||
+-#endif
+- buf.contains("<?xml") || buf.contains("<svg") || buf.contains("<!--") || buf.contains("<!DOCTYPE svg");
++ return isPossiblySvg(device);
+ }
+
+ QT_END_NAMESPACE
+diff --git a/tests/auto/qsvgplugin/tst_qsvgplugin.cpp b/tests/auto/qsvgplugin/tst_qsvgplugin.cpp
+index e1f84f3..73bbe8b 100644
+--- a/tests/auto/qsvgplugin/tst_qsvgplugin.cpp
++++ b/tests/auto/qsvgplugin/tst_qsvgplugin.cpp
+@@ -61,6 +61,8 @@ private slots:
+ void checkSize_data();
+ void checkSize();
+ void checkImageInclude();
++ void encodings_data();
++ void encodings();
+ };
+
+
+@@ -145,6 +147,36 @@ void tst_QSvgPlugin::checkImageInclude()
+ logMessages.clear();
+ }
+
++void tst_QSvgPlugin::encodings_data()
++{
++ QTest::addColumn<QString>("filename");
++
++ QTest::newRow("utf-8") << QFINDTESTDATA("simple_Utf8.svg");
++ QTest::newRow("utf-16LE") << QFINDTESTDATA("simple_Utf16LE.svg");
++ QTest::newRow("utf-16BE") << QFINDTESTDATA("simple_Utf16BE.svg");
++ QTest::newRow("utf-32LE") << QFINDTESTDATA("simple_Utf32LE.svg");
++ QTest::newRow("utf-32BE") << QFINDTESTDATA("simple_Utf32BE.svg");
++}
++
++void tst_QSvgPlugin::encodings()
++{
++ QFETCH(QString, filename);
++
++ {
++ QFile file(filename);
++ file.open(QIODevice::ReadOnly);
++ QVERIFY(QSvgIOHandler::canRead(&file));
++ }
++
++ QFile file(filename);
++ file.open(QIODevice::ReadOnly);
++ QSvgIOHandler plugin;
++ plugin.setDevice(&file);
++ QVERIFY(plugin.canRead());
++ QImage img;
++ QVERIFY(plugin.read(&img));
++ QCOMPARE(img.size(), QSize(50, 50));
++}
+
+ QTEST_MAIN(tst_QSvgPlugin)
+ #include "tst_qsvgplugin.moc"
+--
+2.35.1
+
diff --git a/dev-qt/qtsvg/qtsvg-5.15.3.ebuild b/dev-qt/qtsvg/qtsvg-5.15.3.ebuild
new file mode 100644
index 000000000000..b73a9e22a0dc
--- /dev/null
+++ b/dev-qt/qtsvg/qtsvg-5.15.3.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QT5_KDEPATCHSET_REV=1
+inherit qt5-build
+
+DESCRIPTION="SVG rendering library for the Qt5 framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
+ SRC_URI+=" https://dev.gentoo.org/~asturm/distfiles/${P}-QTBUG-90744.tar.xz"
+fi
+
+IUSE=""
+
+RDEPEND="
+ =dev-qt/qtcore-${QT5_PV}*
+ =dev-qt/qtgui-${QT5_PV}*
+ =dev-qt/qtwidgets-${QT5_PV}*
+ sys-libs/zlib:=
+"
+DEPEND="${RDEPEND}
+ test? ( =dev-qt/qtxml-${QT5_PV}* )
+"
+
+PATCHES=( "${FILESDIR}"/${P}-QTBUG-90744-minus-binarypatch.patch )
+
+src_unpack() {
+ default
+ # contains binary patch, so it is applied manually instead
+ rm "${WORKDIR}"/${P}-gentoo-kde-1/0003-Make-image-handler-accept-UTF-16-UTF-32-encoded-SVGs.patch || die
+}