Skip to content

Commit

Permalink
Update grantlee5 to version 5.3.1 / rev 9 via SR 1035528
Browse files Browse the repository at this point in the history
https://build.opensuse.org/request/show/1035528
by user cgiboudeaux + dimstar_suse
- Update to 5.3.1
  * Use C++11 nullptr where appropriate
  * Use QRandomGenerator instead of deprecated qRand
  * Increase compatibility with Qt 6 APIs
  * Add CMake option to build with Qt 6 - GRANTLEE_BUILD_WITH_QT6
  * Support enum introspection on Q_GADGET
  * filesizeformat implementation as well as localized filesize
  * Make enums comparable with more operations
  * Add "truncatechars" filter
  * Fix concatenation of string lists
- Refreshed patches:
  * includes.diff
  * grantlee-5.2.0-fix-ctest-ld-library-path.patch
- Add patch to fix tests on i586 (gh#steveire/grantlee#85):
  * fix-i586-precision.patch
- Add keyring for GPG source verification

- Require cmake(Qt5LinguistTools) for building to enable testing of
- update to version 0.1.3
  • Loading branch information
cgiboudeaux authored and bmwiedemann committed Nov 16, 2022
1 parent 9145cf8 commit 6d0eedc
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 24 deletions.
Binary file modified packages/g/grantlee5/.files
Binary file not shown.
26 changes: 26 additions & 0 deletions packages/g/grantlee5/.rev
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,30 @@
<comment></comment>
<requestid>805835</requestid>
</revision>
<revision rev="9" vrev="1">
<srcmd5>29f2e67bd4e4b2b9773d313262f28dc1</srcmd5>
<version>5.3.1</version>
<time>1668609727</time>
<user>dimstar_suse</user>
<comment>- Update to 5.3.1
* Use C++11 nullptr where appropriate
* Use QRandomGenerator instead of deprecated qRand
* Increase compatibility with Qt 6 APIs
* Add CMake option to build with Qt 6 - GRANTLEE_BUILD_WITH_QT6
* Support enum introspection on Q_GADGET
* filesizeformat implementation as well as localized filesize
* Make enums comparable with more operations
* Add &quot;truncatechars&quot; filter
* Fix concatenation of string lists
- Refreshed patches:
* includes.diff
* grantlee-5.2.0-fix-ctest-ld-library-path.patch
- Add patch to fix tests on i586 (gh#steveire/grantlee#85):
* fix-i586-precision.patch
- Add keyring for GPG source verification

- Require cmake(Qt5LinguistTools) for building to enable testing of
- update to version 0.1.3</comment>
<requestid>1035528</requestid>
</revision>
</revisionlist>
40 changes: 40 additions & 0 deletions packages/g/grantlee5/fix-i586-precision.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 13094b78a790786030a468453c2b3ead4c7fd9cf 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..a0381c59 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;
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,27 @@ by the tests.
textdocument/tests/CMakeLists.txt | 1 +
2 files changed, 2 insertions(+)

--- a/textdocument/tests/CMakeLists.txt 2019-12-18 20:57:28.000000000 +0100
+++ b/textdocument/tests/CMakeLists.txt 2019-12-19 14:19:32.712757537 +0100
@@ -14,6 +14,7 @@
Index: grantlee-5.3.1/textdocument/tests/CMakeLists.txt
===================================================================
--- grantlee-5.3.1.orig/textdocument/tests/CMakeLists.txt
+++ grantlee-5.3.1/textdocument/tests/CMakeLists.txt
@@ -23,6 +23,7 @@ macro(GRANTLEE_TEXTDOCUMENT_UNIT_TESTS)
add_test(${_testname} ${_testname}_exec )
target_link_libraries(${_testname}_exec Grantlee::TextDocument textdocument_test_builtins)
set_property(GLOBAL APPEND PROPERTY TEST_COVERAGE "${CMAKE_CURRENT_BINARY_DIR}/${_testname}_exec" )
+ set_property(TEST ${_testname} PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/textdocument/lib")
endforeach(_testname)
endmacro(GRANTLEE_TEXTDOCUMENT_UNIT_TESTS)

--- a/templates/tests/CMakeLists.txt 2019-12-18 20:57:28.000000000 +0100
+++ b/templates/tests/CMakeLists.txt 2019-12-19 14:17:42.057605600 +0100
@@ -68,6 +68,7 @@

Index: grantlee-5.3.1/templates/tests/CMakeLists.txt
===================================================================
--- grantlee-5.3.1.orig/templates/tests/CMakeLists.txt
+++ grantlee-5.3.1/templates/tests/CMakeLists.txt
@@ -89,6 +89,7 @@ macro(grantlee_templates_unit_tests)
endif()

set_property(GLOBAL APPEND PROPERTY TEST_COVERAGE "${CMAKE_CURRENT_BINARY_DIR}/${_testname}_exec" )
+ set_property(TEST ${_testname} PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/templates/lib:${CMAKE_BINARY_DIR}/grantlee")
endforeach(_testname)
endmacro()

1 change: 0 additions & 1 deletion packages/g/grantlee5/grantlee-5.2.0.tar.gz

This file was deleted.

1 change: 1 addition & 0 deletions packages/g/grantlee5/grantlee-5.3.1.tar.gz
24 changes: 22 additions & 2 deletions packages/g/grantlee5/grantlee5.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
-------------------------------------------------------------------
Sun Nov 13 11:19:25 UTC 2022 - Luca Beltrame <lbeltrame@kde.org>

- Update to 5.3.1
* Use C++11 nullptr where appropriate
* Use QRandomGenerator instead of deprecated qRand
* Increase compatibility with Qt 6 APIs
* Add CMake option to build with Qt 6 - GRANTLEE_BUILD_WITH_QT6
* Support enum introspection on Q_GADGET
* filesizeformat implementation as well as localized filesize
* Make enums comparable with more operations
* Add "truncatechars" filter
* Fix concatenation of string lists
- Refreshed patches:
* includes.diff
* grantlee-5.2.0-fix-ctest-ld-library-path.patch
- Add patch to fix tests on i586 (gh#steveire/grantlee#85):
* fix-i586-precision.patch
- Add keyring for GPG source verification

-------------------------------------------------------------------
Thu May 14 20:32:27 UTC 2020 - Fabian Vogt <fabian@ritter-vogt.de>

Expand All @@ -6,7 +26,7 @@ Thu May 14 20:32:27 UTC 2020 - Fabian Vogt <fabian@ritter-vogt.de>
-------------------------------------------------------------------
Tue Mar 31 09:18:33 UTC 2020 - Matthias Fehring <buschmann23@opensuse.org>

- Require cmake(Qt5LinguistTools) for building to enable testing of
- Require cmake(Qt5LinguistTools) for building to enable testing of
internationalization
- Use xvfb-run to run all tests, this obsoletes the following patch:
* grantlee-5.2.0-disable-textdocument-tests.patch
Expand Down Expand Up @@ -222,7 +242,7 @@ Fri Sep 10 16:25:51 UTC 2010 - tittiatcoke@gmail.com
-------------------------------------------------------------------
Mon Jul 19 19:56:27 UTC 2010 - freitag@novell.com

- update to version 0.1.3
- update to version 0.1.3

-------------------------------------------------------------------
Mon Apr 19 20:07:43 UTC 2010 - tittiatcoke@gmail.com
Expand Down
29 changes: 29 additions & 0 deletions packages/g/grantlee5/grantlee5.keyring
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQGiBEu+MA8RBADp2YIeQhF69CtoPRA2SR71vDnmEtp7AkLWi4h6a8O7K2wQMBby
hyZPWeguPs8C9jbp58u5d1ufd7P12/wmevPEUriOdUN4kdrZf48IODr5u1/W44ow
AkaTHrjQY0+gpbGkncTU/ifaryR6+m1mwp1tsFjoa2KRR0kzDizzuynlPwCg7Ac/
qCH/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8cewkmTPPOTDYMP
7dNua/BPFsoPqepgylMc2yQD048l4NEhtvx3KFQGuMAm8skTsvmi9BUM0dkDCkTK
lVRlkv5I2y8qiaSUb2+fvCeFhtyTghW+74Eq3qKVB5sK9CNVgX6uwDz+oeDsgiDo
Nq9/y4YhuDOI4yUTB0wSQvAAJnczFvmxH1HGsJU72JOxEbYfHRiISQQYEQIACQUC
S74wDwIbDAAKCRDSZMex0C1lCZs2AKCJ0LsYeEggPtTB2NGT4cm6VpixxQCfSxLA
qBE1xByW/GR3eyZxbppDxno=
=X2xR
-----END PGP PUBLIC KEY BLOCK-----
11 changes: 7 additions & 4 deletions packages/g/grantlee5/grantlee5.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# spec file for package grantlee5
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand All @@ -22,18 +22,21 @@
%{?!cmake_install:%global cmake_install() DESTDIR=%{buildroot} make install}

Name: grantlee5
Version: 5.2.0
Version: 5.3.1
Release: 0
Summary: Qt string template library
License: LGPL-2.1-or-later
Group: System/Libraries
URL: http://grantlee.org/
Source: http://www.grantlee.org/downloads/grantlee-%{version}.tar.gz
URL: https://github.com/steveire/grantlee
Source: https://github.com/steveire/grantlee/releases/download/v%{version}/grantlee-%{version}.tar.gz
Source2: baselibs.conf
Source3: grantlee5.keyring
# PATCH-FIX-OPENSUSE includes.diff -- since upstream doesn't provide a way to install to custom directory, we cheat!
Patch0: includes.diff
# PATCH-FIX-OPENSUSE grantlee-5.2.0-fix-ctest-ld-library-path.patch -- set ld library path for tests
Patch1: grantlee-5.2.0-fix-ctest-ld-library-path.patch
# PATCH-FIX-UPSTREAM https://github.com/steveire/grantlee/pull/86/
Patch2: fix-i586-precision.patch
BuildRequires: cmake >= 3.5
BuildRequires: cmake(Qt5Core) >= 5.3
BuildRequires: cmake(Qt5Gui) >= 5.3
Expand Down
20 changes: 12 additions & 8 deletions packages/g/grantlee5/includes.diff
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
--- a/templates/lib/CMakeLists.txt 2019-12-18 20:57:28.000000000 +0100
+++ b/templates/lib/CMakeLists.txt 2019-12-19 00:53:23.253568027 +0100
@@ -125,7 +125,7 @@
Index: grantlee-5.3.1/templates/lib/CMakeLists.txt
===================================================================
--- grantlee-5.3.1.orig/templates/lib/CMakeLists.txt
+++ grantlee-5.3.1/templates/lib/CMakeLists.txt
@@ -137,7 +137,7 @@ install(TARGETS Grantlee_Templates EXPOR
RUNTIME DESTINATION bin COMPONENT Templates
LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT Templates
ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT Templates
Expand All @@ -9,7 +11,7 @@
)

install(FILES
@@ -152,10 +152,10 @@
@@ -164,10 +164,10 @@ install(FILES
token.h
util.h
variable.h
Expand All @@ -22,9 +24,11 @@
- DESTINATION include COMPONENT Templates
+ DESTINATION include/grantlee5 COMPONENT Templates
)
--- a/textdocument/lib/CMakeLists.txt 2019-12-18 20:57:28.000000000 +0100
+++ b/textdocument/lib/CMakeLists.txt 2019-12-19 00:54:55.780989914 +0100
@@ -48,7 +48,7 @@
Index: grantlee-5.3.1/textdocument/lib/CMakeLists.txt
===================================================================
--- grantlee-5.3.1.orig/textdocument/lib/CMakeLists.txt
+++ grantlee-5.3.1/textdocument/lib/CMakeLists.txt
@@ -54,7 +54,7 @@ install(TARGETS Grantlee_TextDocument EX
RUNTIME DESTINATION bin COMPONENT TextDocument
LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT TextDocument
ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT TextDocument
Expand All @@ -33,7 +37,7 @@
)

install(FILES
@@ -59,10 +59,10 @@
@@ -65,10 +65,10 @@ install(FILES
texthtmlbuilder.h
mediawikimarkupbuilder.h
${CMAKE_CURRENT_BINARY_DIR}/grantlee_textdocument_export.h
Expand Down

0 comments on commit 6d0eedc

Please sign in to comment.