From d30df28ef492ffce1e7cabf85f4b1300248fab73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 12 Apr 2023 12:49:21 +0200 Subject: [PATCH] Check for setlocale() at configure time --- ...-2.2.13-Check-for-setlocale-function.patch | 40 +++++++++++++++++++ indent.spec | 8 +++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 indent-2.2.13-Check-for-setlocale-function.patch diff --git a/indent-2.2.13-Check-for-setlocale-function.patch b/indent-2.2.13-Check-for-setlocale-function.patch new file mode 100644 index 0000000..f4e6356 --- /dev/null +++ b/indent-2.2.13-Check-for-setlocale-function.patch @@ -0,0 +1,40 @@ +From 3734443b661799b8fa893d4379be62cd1ce96ae0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 12 Apr 2023 12:43:23 +0200 +Subject: [PATCH] Check for setlocale() function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +After modernizing configure.ac, setlocale() stopped to be checked, +HAVE_SETLOCALE defined, and setlocale() called from main(). As +a result indent-2.2.13 stopped printing localized messages. + +This patch fixes it. + +I checked all HAVE_ macros for their configure-time checks. +HAVE_SETLOCALE was the only missing. + + + +Signed-off-by: Petr Písař +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 92b612d..85f4383 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -48,7 +48,7 @@ AC_SUBST(localedir) + AC_CHECK_INCLUDES_DEFAULT + AC_PROG_EGREP + +-AC_CHECK_FUNCS(strchr memcpy memmove utime) ++AC_CHECK_FUNCS(setlocale strchr memcpy memmove utime) + AC_CHECK_HEADERS(unistd.h string.h malloc.h utime.h sys/utime.h) + + if test "$ac_cv_func_utime" = yes +-- +2.40.0 + diff --git a/indent.spec b/indent.spec index 3e58239..c419f7a 100644 --- a/indent.spec +++ b/indent.spec @@ -1,7 +1,7 @@ Summary: A GNU program for formatting C code Name: indent Version: 2.2.13 -Release: 1%{?dist} +Release: 2%{?dist} # COPYING: GPL-3.0 text # doc/indent.texi: Latex2e-like (Fedora-acceptable, # TODO: waiting on an identifier @@ -112,6 +112,9 @@ Source1: https://ftpmirror.gnu.org/%{name}/%{name}-%{version}.tar.xz.sig # and # . Source2: https://shadura.me/key.pgp +# Check for setlocale() at configure time, proposed to an upstream, +# . +Patch0: indent-2.2.13-Check-for-setlocale-function.patch BuildRequires: autoconf2.7x >= 2.71 # autoconf-archive for unbundled ax_cc_for_build.m4 BuildRequires: autoconf-archive @@ -175,6 +178,9 @@ make check %{?_smp_mflags} %{_infodir}/indent.info* %changelog +* Wed Apr 12 2023 Petr Pisar - 2.2.13-2 +- Check for setlocale() at configure time + * Tue Mar 21 2023 Petr Pisar - 2.2.13-1 - 2.2.13 bump