[arch-commits] Commit in mapnik/trunk (PKGBUILD mapnik-std-c++14.patch)

Evangelos Foutras foutrelis at archlinux.org
Sat Dec 12 13:12:00 UTC 2020


    Date: Saturday, December 12, 2020 @ 13:12:00
  Author: foutrelis
Revision: 773277

Build in C++14 mode in preparation for boost 1.75

Added:
  mapnik/trunk/mapnik-std-c++14.patch
Modified:
  mapnik/trunk/PKGBUILD

------------------------+
 PKGBUILD               |    5 ++
 mapnik-std-c++14.patch |   89 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 94 insertions(+)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-12-12 13:07:32 UTC (rev 773276)
+++ PKGBUILD	2020-12-12 13:12:00 UTC (rev 773277)
@@ -15,9 +15,11 @@
 makedepends=('boost' 'scons')
 source=(https://github.com/$pkgname/$pkgname/releases/download/v$pkgver/$pkgname-v$pkgver.tar.bz2
         mapnik-boost173.patch
+        mapnik-std-c++14.patch
         mapnik-freetype2.patch::https://github.com/mapnik/mapnik/pull/3892.patch)
 sha256sums=('4b1352e01f7ce25ab099e586d7ae98e0b74145a3bf94dd365cb0a2bdab3b9dc2'
             'fc6fb17c90dd1b2d861a5d8886797a5536bc31ab4b018ba1688f41fb25be27b4'
+            '89b6f6be54feca2ba120516a39e20d3ae9706b7fbde140d73538f2727ab31fbe'
             '774a8590b698e9dc2a483e6ff48781ed0400ba06b901f12a1ed50c9114833d47')
 
 prepare() {
@@ -25,6 +27,9 @@
 
   patch -Np1 -i ../mapnik-boost173.patch
 
+  # C++14 mode required by Boost.Geometry 1.75
+  patch -Np1 -i ../mapnik-std-c++14.patch
+
   # Use pkg-config to find FreeType2 if available
   # https://github.com/mapnik/mapnik/pull/3892
   patch -Np1 -i "${srcdir}"/mapnik-freetype2.patch

Added: mapnik-std-c++14.patch
===================================================================
--- mapnik-std-c++14.patch	                        (rev 0)
+++ mapnik-std-c++14.patch	2020-12-12 13:12:00 UTC (rev 773277)
@@ -0,0 +1,89 @@
+From 3b184fb55efbf36511c7bb453a284b1c1afdd595 Mon Sep 17 00:00:00 2001
+From: artemp <artem at mapnik.org>
+Date: Thu, 8 Dec 2016 10:43:25 +0100
+Subject: [PATCH] SConstruct - require c++14
+
+(cherry picked from commit 1372ca48ef841e548241552671831ac1736e91e6)
+---
+ SConstruct | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/SConstruct b/SConstruct
+index 960c9087e..f47f268a6 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -42,8 +42,8 @@ ICU_LIBS_DEFAULT='/usr/'
+ 
+ DEFAULT_CC = "cc"
+ DEFAULT_CXX = "c++"
+-DEFAULT_CXX11_CXXFLAGS = " -std=c++11 -DU_USING_ICU_NAMESPACE=0"
+-DEFAULT_CXX11_LINKFLAGS = ""
++DEFAULT_CXX14_CXXFLAGS = " -std=c++14 -DU_USING_ICU_NAMESPACE=0"
++DEFAULT_CXX14_LINKFLAGS = ""
+ if sys.platform == 'darwin':
+     # homebrew default
+     ICU_INCLUDES_DEFAULT='/usr/local/opt/icu4c/include/'
+@@ -1168,12 +1168,12 @@ int main()
+         return True
+     return False
+ 
+-def supports_cxx11(context,silent=False):
++def supports_cxx14(context,silent=False):
+     ret = context.TryRun("""
+ 
+ int main()
+ {
+-#if __cplusplus >= 201103
++#if __cplusplus >= 201402L
+     return 0;
+ #else
+     return -1;
+@@ -1182,7 +1182,7 @@ int main()
+ 
+ """, '.cpp')
+     if not silent:
+-        context.Message('Checking if compiler (%s) supports -std=c++11 flag... ' % context.env.get('CXX','CXX'))
++        context.Message('Checking if compiler (%s) supports -std=c++14 flag... ' % context.env.get('CXX','CXX'))
+     if silent:
+         context.did_show_result=1
+     context.Result(ret[0])
+@@ -1214,7 +1214,7 @@ conf_tests = { 'prioritize_paths'      : prioritize_paths,
+                'harfbuzz_with_freetype_support': harfbuzz_with_freetype_support,
+                'boost_regex_has_icu'   : boost_regex_has_icu,
+                'sqlite_has_rtree'      : sqlite_has_rtree,
+-               'supports_cxx11'        : supports_cxx11,
++               'supports_cxx14'        : supports_cxx14,
+                'CheckBoostScopedEnum'  : CheckBoostScopedEnum,
+                }
+ 
+@@ -1351,13 +1351,13 @@ if not preconfigured:
+ 
+     # set any custom cxxflags and ldflags to come first
+     if sys.platform == 'darwin' and not env['HOST']:
+-        DEFAULT_CXX11_CXXFLAGS += ' -stdlib=libc++'
+-        DEFAULT_CXX11_LINKFLAGS = ' -stdlib=libc++'
++        DEFAULT_CXX14_CXXFLAGS += ' -stdlib=libc++'
++        DEFAULT_CXX14_LINKFLAGS = ' -stdlib=libc++'
+     env.Append(CPPDEFINES = env['CUSTOM_DEFINES'])
+-    env.Append(CXXFLAGS = DEFAULT_CXX11_CXXFLAGS)
++    env.Append(CXXFLAGS = DEFAULT_CXX14_CXXFLAGS)
+     env.Append(CXXFLAGS = env['CUSTOM_CXXFLAGS'])
+     env.Append(CFLAGS = env['CUSTOM_CFLAGS'])
+-    env.Append(LINKFLAGS = DEFAULT_CXX11_LINKFLAGS)
++    env.Append(LINKFLAGS = DEFAULT_CXX14_LINKFLAGS)
+     env.Append(LINKFLAGS = env['CUSTOM_LDFLAGS'])
+ 
+     ### platform specific bits
+@@ -1488,9 +1488,9 @@ if not preconfigured:
+     if env['PRIORITIZE_LINKING']:
+         conf.prioritize_paths(silent=True)
+ 
+-    # test for C++11 support, which is required
+-    if not env['HOST'] and not conf.supports_cxx11():
+-        color_print(1,"C++ compiler does not support C++11 standard (-std=c++11), which is required. Please upgrade your compiler")
++    # test for C++14 support, which is required
++    if not env['HOST'] and not conf.supports_cxx14():
++        color_print(1,"C++ compiler does not support C++14 standard (-std=c++14), which is required. Please upgrade your compiler")
+         Exit(1)
+ 
+     if not env['HOST']:



More information about the arch-commits mailing list