gzip, bump to 1.14 (#12456)

This commit is contained in:
Schrijvers Luc
2025-06-03 18:04:25 +02:00
committed by GitHub
parent b2d6a82f29
commit cc0ce5fc60
4 changed files with 109 additions and 329 deletions

View File

@@ -1,71 +0,0 @@
SUMMARY="The gzip compression utilities"
DESCRIPTION="gzip (GNU zip) is a compression utility designed to be a \
replacement for compress. Its main advantages over compress are much \
better compression and freedom from patented algorithms. It has been \
adopted by the GNU project and is now relatively popular on the Internet."
HOMEPAGE="https://www.gnu.org/software/gzip/"
COPYRIGHT="1992-1993 Jean-loup Gailly
1999-2016 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
REVISION="2"
SOURCE_URI="https://ftpmirror.gnu.org/gzip/gzip-$portVersion.tar.xz"
CHECKSUM_SHA256="ce5e03e519f637e1f814011ace35c4f87b33c0bbabeec35baf5fbd3479e91956"
PATCHES="gzip-$portVersion.patchset"
ARCHITECTURES="all"
PROVIDES="
gzip = $portVersion
cmd:gunzip = $portVersion
cmd:gzexe = $portVersion
cmd:gzip = $portVersion
cmd:uncompress = $portVersion
cmd:zcat = $portVersion
cmd:zcmp = $portVersion
cmd:zdiff = $portVersion
cmd:zegrep = $portVersion
cmd:zfgrep = $portVersion
cmd:zforce = $portVersion
cmd:zgrep = $portVersion
cmd:zless = $portVersion
cmd:zmore = $portVersion
cmd:znew = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
cmd:awk
cmd:gcc
cmd:make
cmd:sed
"
TEST_REQUIRES="
cmd:diff
cmd:grep
cmd:less
cmd:more
"
BUILD()
{
AUTOCONF=: AUTOMAKE=: \
CFLAGS="-O2 -Wno-error" \
runConfigure ./configure
make $jobArgs
}
INSTALL()
{
make install
}
TEST()
{
make check
}

View File

@@ -0,0 +1,87 @@
SUMMARY="The gzip compression utilities"
DESCRIPTION="gzip (GNU zip) is a compression utility designed to be a \
replacement for compress. Its main advantages over compress are much \
better compression and freedom from patented algorithms. It has been \
adopted by the GNU project and is now relatively popular on the Internet."
HOMEPAGE="https://www.gnu.org/software/gzip/"
COPYRIGHT="1992-1993 Jean-loup Gailly
1999-2016 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://ftpmirror.gnu.org/gzip/gzip-$portVersion.tar.xz"
CHECKSUM_SHA256="01a7b881bd220bfdf615f97b8718f80bdfd3f6add385b993dcf6efd14e8c0ac6"
PATCHES="gzip-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandBinDir=$binDir
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
gzip$secondaryArchSuffix = $portVersion
cmd:gunzip$commandSuffix = $portVersion
cmd:gzexe$commandSuffix = $portVersion
cmd:gzip$commandSuffix = $portVersion
cmd:uncompress$commandSuffix = $portVersion
cmd:zcat$commandSuffix = $portVersion
cmd:zcmp$commandSuffix = $portVersion
cmd:zdiff$commandSuffix = $portVersion
cmd:zegrep$commandSuffix = $portVersion
cmd:zfgrep$commandSuffix = $portVersion
cmd:zforce$commandSuffix = $portVersion
cmd:zgrep$commandSuffix = $portVersion
cmd:zless$commandSuffix = $portVersion
cmd:zmore$commandSuffix = $portVersion
cmd:znew$commandSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
if [ "$targetArchitecture" = x86_gcc2 ]; then
REPLACES="
gzip
"
fi
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:awk
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:makeinfo >= 7
cmd:sed
"
TEST_REQUIRES="
cmd:diff
cmd:grep
cmd:less
cmd:more
"
BUILD()
{
AUTOCONF=: AUTOMAKE=: \
CFLAGS="-O2 -Wno-error" \
runConfigure --omit-dirs binDir ./configure \
--bindir=$commandBinDir
make $jobArgs
}
INSTALL()
{
make install
}
TEST()
{
make check
}

View File

@@ -1,258 +0,0 @@
From 666864b06c345f59a6bd1485a34d9f14260d510d Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Tue, 26 Apr 2016 21:03:14 +0000
Subject: Do not try to create hard links.
diff --git a/Makefile.am b/Makefile.am
index 4f51b61..ab4f8e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -160,7 +160,7 @@ install-exec-hook remove-installed-links:
rm -f "$$dest" && \
case $@ in \
install-exec-hook) \
- ln "$$source" "$$dest" || $(LN_S) "$$source" "$$dest";; \
+ $(LN_S) "$$source" "$$dest";; \
esac \
) || exit; \
done; \
--
2.30.2
From 7126f33fc69e45d457c8b911d41899221d830fbc Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 2 Oct 2018 15:27:27 +0200
Subject: gcc2 patch
diff --git a/gzip.c b/gzip.c
index 4300997..d8c8f0e 100644
--- a/gzip.c
+++ b/gzip.c
@@ -305,7 +305,7 @@ static const struct option longopts[] =
/* local functions */
-local noreturn void try_help (void);
+local __attribute__ ((__noreturn__)) void try_help (void);
local void help (void);
local void license (void);
local void version (void);
@@ -325,7 +325,7 @@ local void copy_stat (struct stat *ifstat);
local void install_signal_handlers (void);
static void remove_output_file (bool);
static void abort_gzip_signal (int);
-local noreturn void do_exit (int exitcode);
+local __attribute__ ((__noreturn__)) void do_exit (int exitcode);
static void finish_out (void);
int main (int argc, char **argv);
static int (*work) (int infile, int outfile) = zip; /* function to call */
@@ -1182,6 +1182,7 @@ local char *get_suffix(name)
NULL, NULL};
char const **suf;
bool suffix_of_builtin = false;
+ char *z_lower, *match;
/* Normally put Z_SUFFIX at the start of KNOWN_SUFFIXES, but if it
is a suffix of one of them, put it at the end. */
@@ -1195,7 +1196,7 @@ local char *get_suffix(name)
}
}
- char *z_lower = xstrdup(z_suffix);
+ z_lower = xstrdup(z_suffix);
strlwr(z_lower);
known_suffixes[suffix_of_builtin
? sizeof known_suffixes / sizeof *known_suffixes - 2
@@ -1210,7 +1211,7 @@ local char *get_suffix(name)
}
strlwr(suffix);
slen = strlen(suffix);
- char *match = NULL;
+ match = NULL;
do {
int s = strlen(*suf);
if (slen > s && ! ISSLASH (suffix[slen - s - 1])
diff --git a/gzip.h b/gzip.h
index b150145..76d5efd 100644
--- a/gzip.h
+++ b/gzip.h
@@ -273,7 +273,7 @@ extern int unpack (int in, int out);
extern int unlzh (int in, int out);
/* in gzip.c */
-extern noreturn void abort_gzip (void);
+extern __attribute__ ((__noreturn__)) void abort_gzip (void);
/* in deflate.c */
extern off_t deflate (int pack_level);
@@ -311,11 +311,11 @@ extern char *gzip_base_name (char *fname) _GL_ATTRIBUTE_PURE;
extern int xunlink (char *fname);
extern void make_simple_name (char *name);
extern char *add_envopt (int *argcp, char ***argvp, char const *env);
-extern noreturn void gzip_error (char const *m);
-extern noreturn void xalloc_die (void);
+extern __attribute__ ((__noreturn__)) void gzip_error (char const *m);
+extern __attribute__ ((__noreturn__)) void xalloc_die (void);
extern void warning (char const *m);
-extern noreturn void read_error (void);
-extern noreturn void write_error (void);
+extern __attribute__ ((__noreturn__)) void read_error (void);
+extern __attribute__ ((__noreturn__)) void write_error (void);
extern void display_ratio (off_t num, off_t den, FILE *file);
extern void fprint_off (FILE *, off_t, int);
diff --git a/lib/calloc.c b/lib/calloc.c
index 0a934b3..87ae759 100644
--- a/lib/calloc.c
+++ b/lib/calloc.c
@@ -44,6 +44,7 @@ rpl_calloc (size_t n, size_t s)
return NULL;
}
+{
void *result = calloc (n, s);
#if !HAVE_MALLOC_POSIX
@@ -53,3 +54,4 @@ rpl_calloc (size_t n, size_t s)
return result;
}
+}
diff --git a/lib/filenamecat-lgpl.c b/lib/filenamecat-lgpl.c
index 56981aa..5c23cb6 100644
--- a/lib/filenamecat-lgpl.c
+++ b/lib/filenamecat-lgpl.c
@@ -52,6 +52,7 @@ mfile_name_concat (char const *dir, char const *base, char **base_in_result)
size_t dirlen = dirbase - dir + dirbaselen;
size_t baselen = strlen (base);
char sep = '\0';
+ char *p_concat;
if (dirbaselen)
{
/* DIR is not a file system root, so separate with / if needed. */
@@ -68,7 +69,7 @@ mfile_name_concat (char const *dir, char const *base, char **base_in_result)
sep = '.';
}
- char *p_concat = malloc (dirlen + (sep != '\0') + baselen + 1);
+ p_concat = malloc (dirlen + (sep != '\0') + baselen + 1);
if (p_concat == NULL)
return NULL;
diff --git a/lib/malloc.c b/lib/malloc.c
index f334dd6..cd7db42 100644
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -40,6 +40,7 @@ rpl_malloc (size_t n)
return NULL;
}
+{
void *result = malloc (n);
#if !HAVE_MALLOC_POSIX
@@ -49,3 +50,4 @@ rpl_malloc (size_t n)
return result;
}
+}
diff --git a/lib/malloca.c b/lib/malloca.c
index e7beaaf..ba351b4 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -56,15 +56,18 @@ mmalloca (size_t n)
if (mem != NULL)
{
+ small_t *p;
+ void *vp;
+ idx_t offset;
uintptr_t umem = (uintptr_t)mem, umemplus;
/* The INT_ADD_WRAPV avoids signed integer overflow on
theoretical platforms where UINTPTR_MAX <= INT_MAX. */
INT_ADD_WRAPV (umem, sizeof (small_t) + sa_alignment_max - 1,
&umemplus);
- idx_t offset = ((umemplus & ~alignment2_mask)
+ offset = ((umemplus & ~alignment2_mask)
+ sa_alignment_max - umem);
- void *vp = mem + offset;
- small_t *p = vp;
+ vp = mem + offset;
+ p = vp;
/* Here p >= mem + sizeof (small_t),
and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
hence p + n <= mem + nplus.
diff --git a/lib/realloc.c b/lib/realloc.c
index c878381..026cdd8 100644
--- a/lib/realloc.c
+++ b/lib/realloc.c
@@ -52,6 +52,7 @@ rpl_realloc (void *p, size_t n)
return NULL;
}
+{
void *result = realloc (p, n);
#if !HAVE_MALLOC_POSIX
@@ -61,3 +62,4 @@ rpl_realloc (void *p, size_t n)
return result;
}
+}
diff --git a/lib/savedir.c b/lib/savedir.c
index e91ceb5..cc25f8f 100644
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -149,11 +149,12 @@ streamsavedir (DIR *dirp, enum savedir_option option)
if (cmp)
{
+ idx_t i;
if (entries_used)
qsort (entries, entries_used, sizeof *entries, cmp);
name_space = ximalloc (used + 1);
used = 0;
- for (idx_t i = 0; i < entries_used; i++)
+ for (i = 0; i < entries_used; i++)
{
char *dest = name_space + used;
used += stpcpy (dest, entries[i].name) - dest + 1;
diff --git a/lib/stdnoreturn.in.h b/lib/stdnoreturn.in.h
index d9e7466..ffe68ff 100644
--- a/lib/stdnoreturn.in.h
+++ b/lib/stdnoreturn.in.h
@@ -17,7 +17,7 @@
/* Written by Paul Eggert. */
-#ifndef noreturn
+#if !defined(noreturn) && !defined(__HAIKU__)
/* ISO C11 <stdnoreturn.h> for platforms that lack it.
diff --git a/lib/xmalloc.c b/lib/xmalloc.c
index 993c1ee..50ddde5 100644
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -245,6 +245,7 @@ xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
This is typically idx_t, but it should be size_t on (theoretical?)
platforms where SIZE_MAX < IDX_MAX so xpalloc does not pass
values greater than SIZE_MAX to xrealloc. */
+{
#if IDX_MAX <= SIZE_MAX
idx_t nbytes;
#else
@@ -271,6 +272,7 @@ xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
*pn = n;
return pa;
}
+}
/* Allocate S bytes of zeroed memory dynamically, with error checking.
There's no need for xnzalloc (N, S), since it would be equivalent
--
2.30.2

View File

@@ -0,0 +1,22 @@
From 666864b06c345f59a6bd1485a34d9f14260d510d Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Tue, 26 Apr 2016 21:03:14 +0000
Subject: Do not try to create hard links.
diff --git a/Makefile.am b/Makefile.am
index 4f51b61..ab4f8e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -160,7 +160,7 @@ install-exec-hook remove-installed-links:
rm -f "$$dest" && \
case $@ in \
install-exec-hook) \
- ln "$$source" "$$dest" || $(LN_S) "$$source" "$$dest";; \
+ $(LN_S) "$$source" "$$dest";; \
esac \
) || exit; \
done; \
--
2.30.2