summaryrefslogtreecommitdiff
path: root/user/grantlee
diff options
context:
space:
mode:
Diffstat (limited to 'user/grantlee')
-rw-r--r--user/grantlee/APKBUILD23
-rw-r--r--user/grantlee/enum-comparators.patch14
-rw-r--r--user/grantlee/x87fpu.patch42
3 files changed, 69 insertions, 10 deletions
diff --git a/user/grantlee/APKBUILD b/user/grantlee/APKBUILD
index ddf639728..6a2412025 100644
--- a/user/grantlee/APKBUILD
+++ b/user/grantlee/APKBUILD
@@ -1,20 +1,23 @@
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=grantlee
-pkgver=5.1.0
-pkgrel=1
-pkgdesc="Libraries for text templating with Qt"
+pkgver=5.3.1
+pkgrel=0
+pkgdesc="Qt string template engine based on the Django template system"
url="https://github.com/steveire/grantlee/"
arch="all"
license="LGPL-2.1+"
depends=""
depends_dev="qt5-qtbase-dev"
-makedepends="cmake $depends_dev qt5-qtscript-dev doxygen graphviz"
+makedepends="cmake $depends_dev qt5-qtscript-dev doxygen graphviz
+ qt5-qtdeclarative-dev"
subpackages="$pkgname-dev $pkgname-doc"
-source="grantlee-$pkgver.tar.gz::https://github.com/steveire/grantlee/archive/v$pkgver.tar.gz"
+source="https://github.com/steveire/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz
+ x87fpu.patch
+ enum-comparators.patch
+ "
build() {
- cd "$builddir"
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
@@ -24,21 +27,21 @@ build() {
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_C_FLAGS="$CFLAGS" \
- ${CMAKE_CROSSOPTS}
+ ${CMAKE_CROSSOPTS} .
make all docs
}
check() {
- cd "$builddir"
CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E buildertest
}
package() {
- cd "$builddir"
make DESTDIR="$pkgdir" install
mkdir -p "$pkgdir"/usr/share/doc/grantlee
mv "$builddir"/apidox "$pkgdir"/usr/share/doc/grantlee/
}
-sha512sums="8a4906979f160abf21481d364f0318789c8b5340c62bff06cc62e6714dbf2c52cbfe577a24490052ac25d94f4cc59e11764204236bc7532bd7f1fd5188baa41a grantlee-5.1.0.tar.gz"
+sha512sums="dc7192fe0553954fffc3e2c584e4fdd80fc1f22d25846cacc5f2dcd1db2673ca62464c8492a4ed3bfc9dfc3e62ef13322809dd29bd56fa4a3a153a8d373ddde5 grantlee-5.3.1.tar.gz
+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()
diff --git a/user/grantlee/x87fpu.patch b/user/grantlee/x87fpu.patch
new file mode 100644
index 000000000..f439bf1f1
--- /dev/null
+++ b/user/grantlee/x87fpu.patch
@@ -0,0 +1,42 @@
+Upstream-URL: https://github.com/steveire/grantlee/pull/86
+
+From 7e34ffaff40fc085a15bb0ffabb5f247795581fd Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fabian@ritter-vogt.de>
+Date: Sun, 13 Nov 2022 14:01:21 +0100
+Subject: [PATCH] Fix formatting of some larger file sizes on 32bit x86
+
+With the x87 FPU available, GCC uses long double precision for some variables.
+Due to the function call passing a double, some comparisons break down.
+That resulted in "1.00 YB" being printed as "1000.00 ZB" instead.
+
+Fixes #85
+---
+ templates/lib/util.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/templates/lib/util.cpp b/templates/lib/util.cpp
+index 504674a7..5924cdf5 100644
+--- a/templates/lib/util.cpp
++++ b/templates/lib/util.cpp
+@@ -23,6 +23,7 @@
+ #include "metaenumvariable_p.h"
+ #include "metatype.h"
+
++#include <cfloat>
+ #include <QtCore/QStringList>
+
+ QString Grantlee::unescapeStringLiteral(const QString &input)
+@@ -212,7 +213,13 @@ std::pair<qreal, QString> Grantlee::calcFileSize(qreal size, int unitSystem,
+ bool found = false;
+ int count = 0;
+ const qreal baseVal = (_unitSystem == 10) ? 1000.0F : 1024.0F;
++#if FLT_EVAL_METHOD == 2
++ // Avoid that this is treated as long double, as the increased
++ // precision breaks the comparison below.
++ volatile qreal current = 1.0F;
++#else
+ qreal current = 1.0F;
++#endif
+ int units = decimalUnits.size();
+ while (!found && (count < units)) {
+ current *= baseVal;