[DRE-commits] [ruby-re2] 01/01: Build with --std=c++11. RE2 now requires this. (Closes: #820349)

Stefano Rivera stefano at rivera.za.net
Fri Apr 8 22:03:25 UTC 2016


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

stefanor pushed a commit to branch master
in repository ruby-re2.

commit 54975d79454f1de1b1bc042c774e94a1888aedd8
Author: Stefano Rivera <stefanor at debian.org>
Date:   Fri Apr 8 14:39:09 2016 -0700

    Build with --std=c++11. RE2 now requires this. (Closes: #820349)
---
 debian/changelog      |  6 ++++++
 debian/patches/c++11  | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series |  1 +
 3 files changed, 62 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 5f13046..ce293f8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ruby-re2 (0.7.0-2) UNRELEASED; urgency=medium
+
+  * Build with --std=c++11. RE2 now requires this. (Closes: #820349)
+
+ -- Stefano Rivera <stefanor at debian.org>  Fri, 08 Apr 2016 14:37:34 -0700
+
 ruby-re2 (0.7.0-1) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/c++11 b/debian/patches/c++11
new file mode 100644
index 0000000..473e42c
--- /dev/null
+++ b/debian/patches/c++11
@@ -0,0 +1,55 @@
+Description: RE2 now requires C++11
+Author: Stefano Rivera <stefanor at debian.org>
+Forwarded: https://github.com/mudge/re2/pull/30
+Bug-Debian: https://bugs.debian.org/820349
+
+--- a/ext/re2/extconf.rb
++++ b/ext/re2/extconf.rb
+@@ -8,12 +8,35 @@ require 'mkmf'
+ 
+ incl, lib = dir_config("re2", "/usr/local/include", "/usr/local/lib")
+ 
+-$CFLAGS << " -Wall -Wextra -funroll-loops"
++# for try_compile: Pass -x c++ to force gcc to compile the test program as C++
++# (as it will end in .c by default).
++cxx_source = "-x c++"
++
++if defined? $CXXFLAGS
++  $CXXFLAGS << " -Wall -Wextra -std=c++11"
++  cxx_source << " #{$CXXFLAGS}"
++else
++  $CFLAGS << " -Wall -Wextra -std=c++11"
++end
+ 
+ have_library("stdc++")
+ have_header("stdint.h")
+ have_func("rb_str_sublen")
+ 
++checking_for("C++11 support") do
++  trivial_test = <<SRC
++int main() {
++  return 0;
++}
++SRC
++
++  if !try_compile(trivial_test, cxx_source)
++    abort "Require a compiler with C++11 support"
++  else
++    true
++  end
++end
++
+ if have_library("re2")
+ 
+   # Determine which version of re2 the user has installed.
+@@ -35,9 +58,7 @@ int main() {
+ }
+ SRC
+ 
+-    # Pass -x c++ to force gcc to compile the test program
+-    # as C++ (as it will end in .c by default).
+-    if try_compile(test_re2_match_signature, "-x c++")
++    if try_compile(test_re2_match_signature, cxx_source)
+       $defs.push("-DHAVE_ENDPOS_ARGUMENT")
+     end
+   end
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a7985d8
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+c++11

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-re2.git



More information about the Pkg-ruby-extras-commits mailing list