diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-01-31 01:58:32 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-01-31 01:58:32 -0600 |
commit | acc601bde0d1f241e5683d8fd1e365bf60d9d52f (patch) | |
tree | e3ce74fbc5bbcd6094b8f907f53142b0211056b3 | |
parent | 90dc8905f7dbd3d0290232b378539d29e96ee49b (diff) | |
download | packages-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
-rw-r--r-- | user/grantlee/APKBUILD | 4 | ||||
-rw-r--r-- | user/grantlee/enum-comparators.patch | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/user/grantlee/APKBUILD b/user/grantlee/APKBUILD index df8bad208..6a2412025 100644 --- a/user/grantlee/APKBUILD +++ b/user/grantlee/APKBUILD @@ -14,6 +14,7 @@ makedepends="cmake $depends_dev qt5-qtscript-dev doxygen graphviz subpackages="$pkgname-dev $pkgname-doc" source="https://github.com/steveire/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz x87fpu.patch + enum-comparators.patch " build() { @@ -42,4 +43,5 @@ package() { } sha512sums="dc7192fe0553954fffc3e2c584e4fdd80fc1f22d25846cacc5f2dcd1db2673ca62464c8492a4ed3bfc9dfc3e62ef13322809dd29bd56fa4a3a153a8d373ddde5 grantlee-5.3.1.tar.gz -b515403727416ef91037e5774a78e4b477e4e99da0c58e53f3099a6f8558c25244416acabd2bde529aafa509c4a61c54761d39fdaceb756bc4b638ccc3285607 x87fpu.patch" +b515403727416ef91037e5774a78e4b477e4e99da0c58e53f3099a6f8558c25244416acabd2bde529aafa509c4a61c54761d39fdaceb756bc4b638ccc3285607 x87fpu.patch +b5c57a73786978a61c1a1164aefa171a23fbb033a9fc980cceb9ab6cc48f90cc86be15a367cbc39e6234c261a3113d72189a02e16affac428ec4a8de67377fc9 enum-comparators.patch" 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() |