recode: update to 3.7.15.

This commit is contained in:
oreo639 2025-03-16 02:25:36 -07:00 committed by oreo639
parent 3a621be877
commit 3e461f7546
8 changed files with 102 additions and 113 deletions

View file

@ -771,7 +771,7 @@ libmms.so.0 libmms-0.6_1
libsmbios.so.2 libsmbios-2.2.28_1
libsmbios_c.so.2 libsmbios-2.2.28_1
libjasper.so.4 libjasper-1.900.27_1
librecode.so.0 librecode-3.6_1
librecode.so.3 librecode-3.7.14_1
libenca.so.0 libenca-1.13_1
libwavpack.so.1 libwavpack-4.60.1_1
libSDL_net-1.2.so.0 SDL_net-1.2.7_1

View file

@ -0,0 +1,81 @@
From 3e978f71c717a22ab75f8e709e536809361cfb95 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Mon, 24 Mar 2025 02:06:03 -0700
Subject: [PATCH] task.c: backport input stream ownership check to non-pipe
codepath
80516f601ce5f1cee44848615dffe4252f2d205f only fixed the pipe codepath, but the
issue also exists for the non HAS_PIPE codepath as well.
---
src/task.c | 44 +++++++++++++++++++++++++++++---------------
1 file changed, 29 insertions(+), 15 deletions(-)
diff --git a/src/task.c b/src/task.c
index c619512..9227fda 100644
--- a/src/task.c
+++ b/src/task.c
@@ -218,6 +218,31 @@ recode_transform_byte_to_variable (RECODE_SUBTASK subtask)
SUBTASK_RETURN (subtask);
}
+/*-------------------------------------------------------------------.
+| Close the subtask input file pointer if it is owned by librecode. |
+`-------------------------------------------------------------------*/
+
+static bool
+close_subtask_input (RECODE_SUBTASK subtask)
+{
+ if (subtask->input.file)
+ {
+ if (subtask->input.file && subtask->input.name &&
+ subtask->input.name[0])
+ {
+ if (fclose (subtask->input.file) != 0)
+ {
+ recode_perror (NULL, "fclose (%s)", subtask->input.name);
+ recode_if_nogo (RECODE_SYSTEM_ERROR, subtask);
+ return false;
+ }
+ }
+
+ subtask->input.file = NULL;
+ }
+ return true;
+}
+
/*------------------------------------------------------------------------.
| Execute the conversion sequence for a recoding TASK. If no conversions |
| are needed, merely copy the input onto the output. |
@@ -358,9 +383,8 @@ recode_perform_task (RECODE_TASK task)
/* Close the input file when we opened it. */
- if (subtask->input.file && subtask->input.name &&
- subtask->input.name[0])
- fclose (subtask->input.file);
+ if (!close_subtask_input (subtask))
+ goto exit;
}
#endif
}
@@ -400,18 +424,8 @@ recode_perform_task (RECODE_TASK task)
#else
/* Post-step clean up for memory sequence. */
- if (subtask->input.file)
- {
- FILE *fp = subtask->input.file;
-
- subtask->input.file = NULL;
- if (fclose (fp) != 0)
- {
- recode_perror (NULL, "fclose (%s)", subtask->input.name);
- recode_if_nogo (RECODE_SYSTEM_ERROR, subtask);
- goto exit;
- }
- }
+ if (!close_subtask_input (subtask))
+ goto exit;
/* Prepare for next step. */

View file

@ -1,46 +0,0 @@
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 237fe72..684ee68 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -22,6 +22,7 @@ AUTOMAKE_OPTIONS = gnits
noinst_LIBRARIES = libreco.a
noinst_HEADERS = error.h getopt.h gettext.h pathmax.h xstring.h
libreco_a_SOURCES = error.c getopt.c getopt1.c xstrdup.c
+libreco_a_CFLAGS = -fPIC
EXTRA_DIST = alloca.c gettext.c malloc.c realloc.c strtol.c strtoul.c
diff --git a/lib/error.c b/lib/error.c
index 53b650c..7f879aa 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -65,7 +65,7 @@ void (*error_print_progname) (
/* This variable is incremented each time `error' is called. */
unsigned int error_message_count;
-#ifdef _LIBC
+#if 1
/* In the GNU C library, there is a predefined variable for this. */
# define program_name program_invocation_name
@@ -73,8 +73,6 @@ unsigned int error_message_count;
/* In GNU libc we want do not want to use the common name `error' directly.
Instead make it a weak alias. */
-# define error __error
-# define error_at_line __error_at_line
#else /* not _LIBC */
diff --git a/src/Makefile.am b/src/Makefile.am
index c918aa7..dff6c71 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,6 +48,7 @@ recode_LDADD = librecode.la ../lib/libreco.a
librecode_la_SOURCES = argmatch.c charname.c combine.c fr-charname.c \
hash.c iconv.c libiconv.c localcharset.c merged.c names.c outer.c quotearg.c \
recode.c request.c strip-pool.c task.c xmalloc.c $(C_STEPS)
+librecode_la_LIBADD = ../lib/libreco.a
librecode_la_LDFLAGS = -version-info 0:0:0
INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/libiconv

View file

@ -1,19 +0,0 @@
http://bugs.gentoo.org/283029
--- a/m4/flex.m4
+++ b/m4/flex.m4
@@ -8,11 +8,11 @@ dnl ad_AC_PROG_FLEX
dnl Look for flex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
AC_DEFUN(ad_AC_PROG_FLEX,
[AC_CHECK_PROGS(LEX, flex, missing)
-if test "$LEX" = missing; then
+AS_IF([test "$LEX" = missing], [dnl
LEX="\$(top_srcdir)/$ac_aux_dir/missing flex"
LEX_OUTPUT_ROOT=lex.yy
AC_SUBST(LEX_OUTPUT_ROOT)dnl
-else
+], [:
AC_PROG_LEX
AC_DECL_YYTEXT
-fi])
+])])

View file

@ -1,23 +0,0 @@
http://bugs.gentoo.org/239372
patch by Dmitry Karasik
--- recode-3.6/m4/gettext.m4
+++ recode-3.6/m4/gettext.m4
@@ -109,12 +109,12 @@
else
ac_items="$LINGUAS"
for ac_item in $ac_items; do
- case "$ALL_LINGUAS" in
- *$ac_item*)
+ for supported_item in $ALL_LINGUAS; do
+ if test "$ac_item" = "$supported_item"; then
ac_print="$ac_print $ac_item"
MOFILES="$MOFILES $ac_item.mo"
- ;;
- esac
+ fi
+ done
done
fi
AC_SUBST(MOFILES)

View file

@ -1,11 +0,0 @@
--- recode-3.6/doc/recode.texi 2000-12-06 20:55:33.000000000 +0100
+++ recode-3.6/doc/recode.texi 2020-04-08 03:31:51.282594665 +0200
@@ -3713,7 +3713,7 @@
between HTML and various other charsets.
Here is a list of those HTML variants which @code{recode} supports.
-Some notes have been provided by François Yergeau @email{yergeau@@alis.com}.
+Some notes have been provided by François Yergeau @email{yergeau@@alis.com}.
@table @code
@item XML-standalone

View file

@ -1,25 +1,33 @@
# Template file for 'recode'
pkgname=recode
version=3.6
revision=10
version=3.7.15
revision=1
build_style=gnu-configure
configure_args="--without-included-gettext jm_cv_func_working_malloc=yes
jm_cv_func_working_realloc=yes"
hostmakedepends="automake gettext libtool texinfo"
configure_args="--enable-shared --disable-static"
hostmakedepends="automake gettext-devel libtool libltdl-devel texinfo python3
libiconv-utils"
makedepends="libiconv-devel"
checkdepends="python3-Cython python3-devel"
short_desc="Character set conversion utility"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="http://recode.progiciels-bpi.ca/"
distfiles="${DEBIAN_SITE}/main/r/${pkgname}/${pkgname}_${version}.orig.tar.gz"
checksum=e3e6a4f3f8e5c6052ab70155990c074d87aa0b614fc1be31d194750d1d962fcf
homepage="https://github.com/rrthomas/Recode"
distfiles="https://github.com/rrthomas/recode/releases/download/v${version}/recode-${version}.tar.gz"
checksum=f590407fc51badb351973fc1333ee33111f05ec83a8f954fd8cf0c5e30439806
CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/libiconv"
LDFLAGS="-liconv"
pre_configure() {
vsed -e 's,AM_CONFIG_HEADER,AC_CONFIG_HEADERS,g' -i configure.in
vsed -i -e "/^AM_C_PROTOTYPES.*/d" configure.in
vsed -i -e "s/ansi2knr//" src/Makefile.am
rm acinclude.m4
autoreconf -fi
libtoolize
# Remove libc specific iconv name list
vsed -e "s/os.popen('iconv/os.popen('gnu-iconv/g" -i tables.py
rm src/iconvdecl.h
# Disable using pipe strategy, fork casues issues with buffered outputs
# https://github.com/rrthomas/recode/issues/67
vsed -e "s/HAVE_PIPE/0/g" -i src/task.c
}
librecode_package() {
@ -34,7 +42,6 @@ recode-devel_package() {
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
}
}