Skip to content

Commit

Permalink
autoconf-archive: fix quoting of m4_fatal
Browse files Browse the repository at this point in the history
This cherry-picks a patch set fixing calls to m4_fatal which caused some
packages to fail in autoconf (e.g. cava).
  • Loading branch information
corngood committed Nov 17, 2024
1 parent dfcff3e commit b74c036
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 427e226a2fe3980388abffd6de25ed6b9591cce3 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz93@gmail.com>
Date: Sat, 19 Oct 2024 21:51:30 -0400
Subject: [PATCH 1/3] ax_check_gl.m4: properly quote m4_fatal

It needs to only run as an argument of m4_if, not all the time.

Fixes: 753493bf7e251997f02559b98fc599d4a337d8cd
Bug: https://bugs.gentoo.org/941845
---
m4/ax_check_gl.m4 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/ax_check_gl.m4 b/m4/ax_check_gl.m4
index 850d407..4c2e4ef 100644
--- a/m4/ax_check_gl.m4
+++ b/m4/ax_check_gl.m4
@@ -85,7 +85,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

-#serial 23
+#serial 24

# example gl program
m4_define([_AX_CHECK_GL_PROGRAM],
@@ -187,7 +187,7 @@ AC_DEFUN([_AX_CHECK_GL_LINK_CV],
AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_GENERIC], [
AS_IF([test -n "$GL_LIBS"],[], [
ax_check_gl_manual_libs_generic_extra_libs="$1"
- m4_if($1, [], m4_fatal([$0: argument must not be empty]))
+ m4_if($1, [], [m4_fatal([$0: argument must not be empty])])

_AX_CHECK_GL_SAVE_FLAGS([CFLAGS])
AC_SEARCH_LIBS([glBegin],[$ax_check_gl_manual_libs_generic_extra_libs], [
--
2.46.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From e25f8d9e3ead52f998535b86c763065c5b45cc59 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz93@gmail.com>
Date: Sat, 19 Oct 2024 21:57:16 -0400
Subject: [PATCH 2/3] ax_check_glx.m4: properly quote m4_fatal

It needs to only run as an argument of m4_if, not all the time.

Fixes: 40ca66e7e52bb63e3eee2514855fcf3ad2df7673
---
m4/ax_check_glx.m4 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/ax_check_glx.m4 b/m4/ax_check_glx.m4
index c7890d9..b5027f9 100644
--- a/m4/ax_check_glx.m4
+++ b/m4/ax_check_glx.m4
@@ -61,7 +61,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

-#serial 9
+#serial 10

# example program
m4_define([_AX_CHECK_GLX_PROGRAM],
@@ -183,7 +183,7 @@ AC_DEFUN([_AX_CHECK_GLX_HEADERS],
AC_DEFUN([_AX_CHECK_GLX_MANUAL_LIBS_GENERIC],
[dnl
ax_check_glx_manual_libs_generic_extra_libs="$1"
- m4_if($1, [], m4_fatal([$0: argument must not be empty]))
+ m4_if($1, [], [m4_fatal([$0: argument must not be empty])])

AC_LANG_PUSH([C])
_AX_CHECK_GLX_SAVE_FLAGS()
--
2.46.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 3a23daa3da0eb1a256fda631867e19345d5f6e3a Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz93@gmail.com>
Date: Sat, 19 Oct 2024 21:58:52 -0400
Subject: [PATCH 3/3] ax_switch_flags.m4: properly quote m4_fatal

It needs to only run as an argument of m4_if, not all the time.

Fixes: 2adff78e224c908fd58df91852c8301c25777a8f
---
m4/ax_switch_flags.m4 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/ax_switch_flags.m4 b/m4/ax_switch_flags.m4
index dc79d1e..777aeb0 100644
--- a/m4/ax_switch_flags.m4
+++ b/m4/ax_switch_flags.m4
@@ -36,10 +36,10 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

-#serial 5
+#serial 6

AC_DEFUN([AX_SWITCH_FLAGS], [
- m4_if($1, [], m4_fatal([$0: namespace is empty]))
+ m4_if($1, [], [m4_fatal([$0: namespace is empty])])
AC_REQUIRE(AX_SAVE_FLAGS)
AC_REQUIRE(AX_RESTORE_FLAGS)
AX_SAVE_FLAGS($1[])
--
2.46.1

6 changes: 6 additions & 0 deletions pkgs/by-name/au/autoconf-archive/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ stdenv.mkDerivation rec {
hash = "sha256-e81dABkW86UO10NvT3AOPSsbrePtgDIZxZLWJQKlc2M=";
};

patches = [
./0001-ax_check_gl.m4-properly-quote-m4_fatal.patch
./0002-ax_check_glx.m4-properly-quote-m4_fatal.patch
./0003-ax_switch_flags.m4-properly-quote-m4_fatal.patch
];

strictDeps = true;
enableParallelBuilding = true;

Expand Down

0 comments on commit b74c036

Please sign in to comment.