diff options
author | James Le Cuirot <chewi@gentoo.org> | 2024-03-25 22:32:12 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2024-03-25 22:42:30 +0000 |
commit | 647cf6b4aa4ca620121a4c15513c9999e22fedcd (patch) | |
tree | 89a88904b66f8c68c153f444038f325c025505a1 | |
parent | sys-apps/openrc: drop 0.53 (diff) | |
download | gentoo-647cf6b4aa4ca620121a4c15513c9999e22fedcd.tar.gz gentoo-647cf6b4aa4ca620121a4c15513c9999e22fedcd.tar.bz2 gentoo-647cf6b4aa4ca620121a4c15513c9999e22fedcd.zip |
dev-util/xdelta: Fix building 1.1.4 with GCC 14
Thanks to NHOrus for the patch.
Closes: https://bugs.gentoo.org/919228
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
-rw-r--r-- | dev-util/xdelta/files/xdelta-1.1.4-gzip.patch | 59 | ||||
-rw-r--r-- | dev-util/xdelta/xdelta-1.1.4-r4.ebuild | 43 |
2 files changed, 102 insertions, 0 deletions
diff --git a/dev-util/xdelta/files/xdelta-1.1.4-gzip.patch b/dev-util/xdelta/files/xdelta-1.1.4-gzip.patch new file mode 100644 index 000000000000..67696da730ce --- /dev/null +++ b/dev-util/xdelta/files/xdelta-1.1.4-gzip.patch @@ -0,0 +1,59 @@ +https://bugs.gentoo.org/919228 + +--- a/test/xdeltatest.c ++++ b/test/xdeltatest.c +@@ -512,7 +512,7 @@ run_command (TestProfile *tp, int zlevel, int slevel, File* from, File* to, File + if (zlevel > 0 && starts_with (tp->name, "diff")) + { + Patch *patch = read_patch (out, & sbuf); +- gzFile *rewrite = gzopen (out->name, diff_gzargs); ++ gzFile rewrite = gzopen (out->name, diff_gzargs); + + if (! rewrite) fail (); + +diff --git a/xdelta-1.1.4/xdmain.c b/../../xdelta-1.1.4.new/xdmain.c +index b1abc74..9c27195 100755 +--- a/xdmain.c ++++ b/xdmain.c +@@ -179,6 +179,7 @@ struct _XdFileHandle + guint narrow_high; + guint current_pos; + FILE* in; ++ gzFile zin; + gboolean (* in_read) (XdFileHandle* handle, void* buf, gint nbyte); + gboolean (* in_close) (XdFileHandle* handle); + gboolean in_compressed; +@@ -520,7 +521,7 @@ xd_gzwrite (XdFileHandle* fh, const void* buf, gint nbyte) + static gboolean + xd_gzread (XdFileHandle* fh, void* buf, gint nbyte) + { +- return gzread (fh->in, buf, nbyte) == nbyte; ++ return gzread (fh->zin, buf, nbyte) == nbyte; + } + + static gboolean +@@ -532,7 +533,7 @@ xd_gzclose (XdFileHandle* fh) + static gboolean + xd_gzrclose (XdFileHandle* fh) + { +- return gzclose (fh->in) == Z_OK; ++ return gzclose (fh->zin) == Z_OK; + } + + static void +@@ -1022,13 +1023,13 @@ xd_handle_narrow (XdFileHandle* fh, guint low, guint high, gboolean compressed) + } + + g_assert (fh->fd >= 0); +- fh->in = gzdopen (dup (fh->fd), "rb"); ++ fh->zin = gzdopen (dup (fh->fd), "rb"); + fh->in_read = &xd_gzread; + fh->in_close = &xd_gzrclose; + fh->in_compressed = TRUE; + fh->current_pos = 0; + +- if (! fh->in) ++ if (! fh->zin) + { + xd_error ("gzdopen failed: %s\n", g_strerror (errno)); + return -1; diff --git a/dev-util/xdelta/xdelta-1.1.4-r4.ebuild b/dev-util/xdelta/xdelta-1.1.4-r4.ebuild new file mode 100644 index 000000000000..b632f97574e6 --- /dev/null +++ b/dev-util/xdelta/xdelta-1.1.4-r4.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools toolchain-funcs + +DESCRIPTION="Computes changes between binary or text files and creates deltas" +HOMEPAGE="https://xdelta.googlecode.com/" +SRC_URI="https://${PN}.googlecode.com/files/${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" + +RDEPEND=">=dev-libs/glib-2 + >=sys-libs/zlib-1.1.4:=" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${P}-m4.patch" + "${FILESDIR}/${P}-glib2.patch" + "${FILESDIR}/${P}-pkgconfig.patch" + "${FILESDIR}/${P}-gzip.patch" +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + tc-export CC + econf --disable-static +} + +src_install() { + default + + # no static archives + find "${ED}" -name '*.la' -delete || die +} |