app-text/msort: c23 porting

Remove erroneous extern, fix configure so it enables fopen()

Bug: https://bugs.gentoo.org/880333
Signed-off-by: NHOrus <jy6x2b32pie9@yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/39350
Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
This commit is contained in:
NHOrus
2024-11-17 21:52:13 +04:00
committed by Conrad Kostecki
parent 20b29eccb9
commit 9bde74954b
2 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
--- msort-8.53.orig/configure.ac 2024-11-17 17:40:59.811316465 +0000
+++ msort-8.53/configure.ac 2024-11-17 17:44:22.697222141 +0000
@@ -3,6 +3,8 @@
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
+AC_USE_SYSTEM_EXTENSIONS
+
AC_DEFUN([AC_C_LONG_LONG],
[AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
[if test "$GCC" = yes; then
--- msort-8.53.orig/misc.c 2024-11-17 17:40:59.812316460 +0000
+++ msort-8.53/misc.c 2024-11-17 17:42:50.841717590 +0000
@@ -419,7 +419,6 @@
OpenFile(char *file,char *mode,char *pgname)
{
FILE *fp;
- extern FILE *fopen();
if((fp = fopen(file,mode)) != NULL) return fp;
else{

View File

@@ -0,0 +1,48 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools
DESCRIPTION="A program for sorting files in sophisticated ways"
HOMEPAGE="https://billposer.org/Software/msort.html"
SRC_URI="https://billposer.org/Software/Downloads/${P}.tar.bz2"
KEYWORDS="~amd64 ~x86"
LICENSE="GPL-3 LGPL-3"
SLOT="0"
IUSE="heap +icu +libuninum"
RDEPEND="dev-libs/tre
icu? ( dev-libs/icu:= )
!icu? ( dev-libs/libutf8proc:= )
libuninum? ( dev-libs/libuninum:= )"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${P}-fix-icu-build.patch"
"${FILESDIR}/${P}-fix-missing-limits-header.patch"
"${FILESDIR}/${P}-fix-segfault-on-certain-input.patch"
"${FILESDIR}/${P}-respect-users-cflags.patch"
"${FILESDIR}/${P}-configure-clang16.patch"
"${FILESDIR}/${P}-fix-missing-prototypes.patch"
)
src_prepare() {
default
eautoreconf
}
src_configure() {
local myeconfargs=(
$(use_enable !heap allocaok)
$(use_enable !icu utf8proc)
$(use_enable libuninum uninum)
--disable-debugbuild
)
econf "${myeconfargs[@]}"
}