[oe-commits] [openembedded-core] 13/13: vte-native: reduce c++ requirements from c++17 -> c++14

git at git.openembedded.org git at git.openembedded.org
Mon Apr 29 16:59:40 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 80dd9023643628e8870d8dcf053a3ee3100b11eb
Author: Andreas Müller <schnitzeltony at gmail.com>
AuthorDate: Mon Apr 29 16:07:30 2019 +0200

    vte-native: reduce c++ requirements from c++17 -> c++14
    
    This should fix build on ancient hosts
    
    Signed-off-by: Andreas Müller <schnitzeltony at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ...1-Reduce-gcc-required-support-downto-c-14.patch | 34 +++++++++++++++++
 .../0001-Revert-parser-glue-Use-std-clamp.patch    | 44 ++++++++++++++++++++++
 ...e.cc-replace-std-clamp-by-std-min-std-max.patch | 33 ++++++++++++++++
 meta/recipes-support/vte/vte_0.56.1.bb             |  7 ++++
 4 files changed, 118 insertions(+)

diff --git a/meta/recipes-support/vte/vte/0001-Reduce-gcc-required-support-downto-c-14.patch b/meta/recipes-support/vte/vte/0001-Reduce-gcc-required-support-downto-c-14.patch
new file mode 100644
index 0000000..19379b4
--- /dev/null
+++ b/meta/recipes-support/vte/vte/0001-Reduce-gcc-required-support-downto-c-14.patch
@@ -0,0 +1,34 @@
+From 6d33f959f442f1338846f6f80e826f1345951b57 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony at gmail.com>
+Date: Sat, 27 Apr 2019 12:52:03 +0200
+Subject: [PATCH] Reduce gcc required support downto c++14
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Native builds require host gcc and they might not support full c++17 but enough
+to build vte-native.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andreas Müller <schnitzeltony at gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1c7a753b..698e795d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -97,7 +97,7 @@ AC_HEADER_STDC
+ AM_PROG_CC_C_O
+ AC_PROG_SED
+ 
+-AX_CXX_COMPILE_STDCXX([17])
++AX_CXX_COMPILE_STDCXX([14])
+ 
+ AC_SYS_LARGEFILE
+ 
+-- 
+2.20.1
+
diff --git a/meta/recipes-support/vte/vte/0001-Revert-parser-glue-Use-std-clamp.patch b/meta/recipes-support/vte/vte/0001-Revert-parser-glue-Use-std-clamp.patch
new file mode 100644
index 0000000..581996d
--- /dev/null
+++ b/meta/recipes-support/vte/vte/0001-Revert-parser-glue-Use-std-clamp.patch
@@ -0,0 +1,44 @@
+From 9e562ebaf4c01f864cd5791ad759465cb32a9dc5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony at gmail.com>
+Date: Sat, 27 Apr 2019 13:03:33 +0200
+Subject: [PATCH] Revert "parser: glue: Use std::clamp"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+std::clamp requires c++17
+
+Upstream-Status: Inappropriate [configuration]
+
+This reverts commit 1a84c427cd2ea05939b86eb47c21a437d0ce6d79.
+
+Signed-off-by: Andreas Müller <schnitzeltony at gmail.com>
+---
+ src/parser-glue.hh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/parser-glue.hh b/src/parser-glue.hh
+index c12bb784..9c23a0a3 100644
+--- a/src/parser-glue.hh
++++ b/src/parser-glue.hh
+@@ -281,7 +281,7 @@ public:
+                                    int max_v) const noexcept
+         {
+                 auto v = param(idx, default_v);
+-                return std::clamp(v, min_v, max_v);
++                return std::min(std::max(v, min_v), max_v);
+         }
+ 
+         /* param_nonfinal:
+@@ -381,7 +381,7 @@ public:
+                                       int max_v) const noexcept
+         {
+                 int v = __builtin_expect(idx < size(), 1) ? vte_seq_arg_value_final(m_seq->args[idx], default_v) : default_v;
+-                return std::clamp(v, min_v, max_v);
++                return std::min(std::max(v, min_v), max_v);
+         }
+ 
+         /* collect_subparams:
+-- 
+2.20.1
+
diff --git a/meta/recipes-support/vte/vte/0001-vte.cc-replace-std-clamp-by-std-min-std-max.patch b/meta/recipes-support/vte/vte/0001-vte.cc-replace-std-clamp-by-std-min-std-max.patch
new file mode 100644
index 0000000..ef53458
--- /dev/null
+++ b/meta/recipes-support/vte/vte/0001-vte.cc-replace-std-clamp-by-std-min-std-max.patch
@@ -0,0 +1,33 @@
+From db3b9cceb55130b0a4b3414be804530c368ececc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony at gmail.com>
+Date: Sat, 27 Apr 2019 13:22:52 +0200
+Subject: [PATCH] vte.cc: replace std:clamp by std:min(std:max(..)..)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+std::clamp requires c++17
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andreas Müller <schnitzeltony at gmail.com>
+---
+ src/vte.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/vte.cc b/src/vte.cc
+index 0aa9a3fc..c9faab49 100644
+--- a/src/vte.cc
++++ b/src/vte.cc
+@@ -5125,7 +5125,7 @@ Terminal::resolve_selection_endpoint(vte::grid::halfcoords const& rowcolhalf, bo
+                 /* Just find the nearest cell boundary within the line, not caring about CJKs, unused
+                  * cells, or wrapping at EOL. The @after parameter is unused in this mode. */
+                 col += half;
+-                col = std::clamp (col, 0L, m_column_count);
++                col = std::min (std::max(col, 0L), m_column_count);
+         } else {
+                 switch (m_selection_type) {
+                 case selection_type_char:
+-- 
+2.20.1
+
diff --git a/meta/recipes-support/vte/vte_0.56.1.bb b/meta/recipes-support/vte/vte_0.56.1.bb
index 3585e9c..b261c03 100644
--- a/meta/recipes-support/vte/vte_0.56.1.bb
+++ b/meta/recipes-support/vte/vte_0.56.1.bb
@@ -19,6 +19,13 @@ SRC_URI += "file://0001-Don-t-enable-stack-protection-by-default.patch \
            file://0001-app.cc-use-old-school-asignment-to-avoid-gcc-4.8-err.patch \
            file://0001-Add-W_EXITCODE-macro-for-non-glibc-systems.patch \
            "
+
+SRC_URI_append_class-native = " \
+    file://0001-Reduce-gcc-required-support-downto-c-14.patch \
+    file://0001-Revert-parser-glue-Use-std-clamp.patch \
+    file://0001-vte.cc-replace-std-clamp-by-std-min-std-max.patch \
+"
+
 SRC_URI[archive.md5sum] = "a8984cd5a101dbff0b0c875d1de3f692"
 SRC_URI[archive.sha256sum] = "02fa8ecc02a9332e47f486795494527b5687b3bd448e73e6b67285f2f326dc7c"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list