dev-ruby/charlock_holmes: Always build in C++11 mode
authorDavid Seifert <soap@gentoo.org>
Sat, 1 Dec 2018 11:38:12 +0000 (12:38 +0100)
committerDavid Seifert <soap@gentoo.org>
Sat, 1 Dec 2018 11:39:35 +0000 (12:39 +0100)
Closes: https://bugs.gentoo.org/653398
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: David Seifert <soap@gentoo.org>
dev-ruby/charlock_holmes/charlock_holmes-0.7.6.ebuild
dev-ruby/charlock_holmes/files/charlock_holmes-0.7.6-gcc5.patch [new file with mode: 0644]

index b9bbacc1a91ba0da5fa9d03af0f088007756553b..47c7658b1bd68b70a7e583e90dd87a72be0328b3 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -26,6 +26,8 @@ CDEPEND="dev-libs/icu:=
 DEPEND+=" ${CDEPEND}"
 RDEPEND+=" ${CDEPEND}"
 
+PATCHES=( "${FILESDIR}"/${PN}-0.7.6-gcc5.patch )
+
 all_ruby_prepare() {
        sed -i -e '/bundler/d' test/helper.rb || die
 
diff --git a/dev-ruby/charlock_holmes/files/charlock_holmes-0.7.6-gcc5.patch b/dev-ruby/charlock_holmes/files/charlock_holmes-0.7.6-gcc5.patch
new file mode 100644 (file)
index 0000000..944efac
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/ext/charlock_holmes/extconf.rb
++++ b/ext/charlock_holmes/extconf.rb
+@@ -54,11 +54,8 @@
+ have_library 'icuuc' or abort 'libicuuc missing'
+ have_library 'icudata' or abort 'libicudata missing'
+-# icu4c might be built in C++11 mode, but it also might not have been
+-icuconfig = `which icu-config`.chomp if icuconfig.empty?
+-if File.exist?(icuconfig) && `#{icuconfig} --cxxflags`.include?("c++11")
+-  $CXXFLAGS << ' -std=c++11'
+-end
++# Always use C++11
++$CXXFLAGS << ' -std=c++11'
+ $CFLAGS << ' -Wall -funroll-loops'
+ $CFLAGS << ' -Wextra -O0 -ggdb3' if ENV['DEBUG']