summaryrefslogtreecommitdiff
path: root/user/grantlee/enum-comparators.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2023-01-31 01:58:32 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2023-01-31 01:58:32 -0600
commitacc601bde0d1f241e5683d8fd1e365bf60d9d52f (patch)
treee3ce74fbc5bbcd6094b8f907f53142b0211056b3 /user/grantlee/enum-comparators.patch
parent90dc8905f7dbd3d0290232b378539d29e96ee49b (diff)
downloadpackages-acc601bde0d1f241e5683d8fd1e365bf60d9d52f.tar.gz
packages-acc601bde0d1f241e5683d8fd1e365bf60d9d52f.tar.bz2
packages-acc601bde0d1f241e5683d8fd1e365bf60d9d52f.tar.xz
packages-acc601bde0d1f241e5683d8fd1e365bf60d9d52f.zip
user/grantlee: Explicitly register enum comparator
This is necessary to make the tests pass on 64-bit PowerPC. This is caused because the MetaEnumVariable class does not register its comparators, which is required in Qt 5. Qt 6 will use introspection to automatically do this. The proper fix is likely to use a constructor function somewhere in the Grantlee library to ensure it is called on library initialisation, but it isn't immediately obvious to me where to put such a ctor. This only seems to affect 64-bit PowerPC, as other platforms do pass this test; maybe Qt is doing some sort of introspection that doesn't work on ppc64. It is also affected by GCC optimisation flags, so it may be a miscompilation. At any rate, this patch *does* fix the tests. Prior to 5.3.0, enums did not compare correctly anyway, so this does not have a very high impact. Fixes: #955
Diffstat (limited to 'user/grantlee/enum-comparators.patch')
-rw-r--r--user/grantlee/enum-comparators.patch14
1 files changed, 14 insertions, 0 deletions
diff --git a/user/grantlee/enum-comparators.patch b/user/grantlee/enum-comparators.patch
new file mode 100644
index 000000000..94ee57e66
--- /dev/null
+++ b/user/grantlee/enum-comparators.patch
@@ -0,0 +1,14 @@
+Upstream-URL: https://github.com/steveire/grantlee/issues/89
+
+diff --git a/templates/tests/testbuiltins.cpp b/templates/tests/testbuiltins.cpp
+index fe7e4ed..82a065d 100644
+--- a/templates/tests/testbuiltins.cpp
++++ b/templates/tests/testbuiltins.cpp
+@@ -298,6 +298,7 @@ void TestBuiltinSyntax::testObjects()
+ Q_UNUSED(s3);
+
+ QMetaType{qMetaTypeId<MetaEnumVariable>()}.create(nullptr);
++ QMetaType::registerComparators<MetaEnumVariable>();
+ }
+
+ void TestBuiltinSyntax::testTruthiness_data()