[packages/ruby] fix build with autoconf 2.70

atler atler at pld-linux.org
Tue Jun 15 16:30:51 CEST 2021


commit f39e721385f7236b0dbc6ffb636b407ef2109154
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Jun 15 12:52:15 2021 +0000

    fix build with autoconf 2.70

 autoconf2.70.patch | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ruby.spec          |  2 ++
 2 files changed, 64 insertions(+)
---
diff --git a/ruby.spec b/ruby.spec
index ed9eb9a..aba71b6 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -54,6 +54,7 @@ Source54:	http://www.unicode.org/Public/9.0.0/ucd/UnicodeData.txt
 Source4:	rdoc.1
 Source5:	testrb.1
 Source6:	operating_system.rb
+Patch0:		autoconf2.70.patch
 Patch2:		fix-bison-invocation.patch
 Patch3:		mkmf-verbose.patch
 Patch4:		strip-ccache.patch
@@ -678,6 +679,7 @@ wywołującego je. Aby to osiągnąć wystarczy bardzo mało kodu.
 
 %prep
 %setup -q -n %{oname}-%{pkg_version} -a2 -a3
+%patch0 -p1
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
diff --git a/autoconf2.70.patch b/autoconf2.70.patch
new file mode 100644
index 0000000..d5d03ac
--- /dev/null
+++ b/autoconf2.70.patch
@@ -0,0 +1,62 @@
+From fcc88da5eb162043adcba552646677d2ab5adf55 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox at gentoo.org>
+Date: Mon, 16 Nov 2020 08:42:15 +0000
+Subject: [PATCH] configure.ac: fix for upcoming autoconf-2.70
+
+The failure initially noticed on `autoconf-2.69d` (soon to become 2.70):
+
+```
+$ ./configure
+./configure: line 8720: syntax error near unexpected token `fi'
+./configure: line 8720: `fi'
+```
+
+Before the change generated `./configure ` snippet looked like:
+
+```
+    if ! $CC -E -xc - <<SRC >/dev/null
+then :
+
+	#if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
+	#error premature clang
+	#endif
+SRC
+	as_fn_error $? "clang version 3.0 or later is required" "$LINENO" 5
+fi
+```
+
+Note the newline that breaks here-document syntax.
+
+After the change the snippet does not use here-document.
+
+Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
+---
+ configure.ac | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a5e3dc76f6f5..4e4a52f066d6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -271,13 +271,14 @@ AS_CASE(["$host_os:$build_os"],
+     # clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported)
+     # Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn)
+     # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
+-    AS_IF([! $CC -E -xc - <<SRC >/dev/null], [
+-	@%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
+-	@%:@error premature clang
+-	@%:@endif
+-SRC
+-	AC_MSG_ERROR([clang version 3.0 or later is required])
+-    ])
++    AC_PREPROC_IFELSE(
++	[AC_LANG_PROGRAM([
++	    @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
++	    @%:@error premature clang
++	    @%:@endif
++	])],
++	[],
++	[AC_MSG_ERROR([clang version 3.0 or later is required])])
+ ])
+ AS_IF([test x"${build}" != x"${host}"], [
+   AC_CHECK_TOOL(CC, gcc)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby.git/commitdiff/09881376e39ee7a14b191af135551b624669ba0b



More information about the pld-cvs-commit mailing list