From 8c3976940c45b7f1ee118c0530f041cdee613248 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 25 Mar 2024 22:41:21 +0000 Subject: games-util/loki_patch: Fix building with GCC 14, EAPI 8 Thanks to NHOrus for the patch. Closes: https://bugs.gentoo.org/926323 Signed-off-by: James Le Cuirot --- .../files/loki_patch-20091105-xdelta-gzip.patch | 44 ++++++++++++++++ .../loki_patch/loki_patch-20091105-r1.ebuild | 61 ++++++++++++++++++++++ games-util/loki_patch/loki_patch-20091105.ebuild | 59 --------------------- games-util/loki_patch/metadata.xml | 11 ++-- 4 files changed, 112 insertions(+), 63 deletions(-) create mode 100644 games-util/loki_patch/files/loki_patch-20091105-xdelta-gzip.patch create mode 100644 games-util/loki_patch/loki_patch-20091105-r1.ebuild delete mode 100644 games-util/loki_patch/loki_patch-20091105.ebuild (limited to 'games-util') diff --git a/games-util/loki_patch/files/loki_patch-20091105-xdelta-gzip.patch b/games-util/loki_patch/files/loki_patch-20091105-xdelta-gzip.patch new file mode 100644 index 000000000000..ec4eeb758a3a --- /dev/null +++ b/games-util/loki_patch/files/loki_patch-20091105-xdelta-gzip.patch @@ -0,0 +1,44 @@ +--- a/loki_patch/loki_xdelta.c ++++ b/loki_patch/loki_xdelta.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/games-util/loki_patch/loki_patch-20091105-r1.ebuild b/games-util/loki_patch/loki_patch-20091105-r1.ebuild new file mode 100644 index 000000000000..aba786f80e73 --- /dev/null +++ b/games-util/loki_patch/loki_patch-20091105-r1.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +DESCRIPTION="Loki Software binary patch tool" +HOMEPAGE="https://github.com/icculus/loki_patch" +SRC_URI=" + mirror://gentoo/${P}.tar.bz2 + mirror://gentoo/loki_setupdb-${PV}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + dev-util/xdelta:0 + dev-libs/libxml2 + dev-libs/glib:2" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +S="${WORKDIR}" + +PATCHES=( + "${FILESDIR}"/${P}-build.patch + "${FILESDIR}"/${P}-patchdata.patch + "${FILESDIR}"/${P}-xdelta-gzip.patch +) + +src_prepare() { + default + + cd loki_setupdb || die + mv configure.{in,ac} || die + eautoreconf + + cd "${S}"/${PN} || die + mv configure.{in,ac} || die + eautoreconf +} + +src_configure() { + cd loki_setupdb || die + econf + cd "${S}"/${PN} || die + econf +} + +src_compile() { + emake -C loki_setupdb + emake -C loki_patch +} + +src_install() { + cd ${PN} || die + dobin loki_patch make_patch + dodoc CHANGES NOTES README TODO +} diff --git a/games-util/loki_patch/loki_patch-20091105.ebuild b/games-util/loki_patch/loki_patch-20091105.ebuild deleted file mode 100644 index 1fc2b57f633a..000000000000 --- a/games-util/loki_patch/loki_patch-20091105.ebuild +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit autotools - -DESCRIPTION="Loki Software binary patch tool" -HOMEPAGE="http://www.icculus.org/loki_setup/" -SRC_URI=" - mirror://gentoo/${P}.tar.bz2 - mirror://gentoo/loki_setupdb-${PV}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" - -RDEPEND=" - dev-util/xdelta:0 - dev-libs/libxml2 - dev-libs/glib:2" -DEPEND="${RDEPEND}" -BDEPEND="virtual/pkgconfig" - -S="${WORKDIR}" -PATCHES=( - "${FILESDIR}"/${P}-build.patch - "${FILESDIR}"/${P}-patchdata.patch -) - -src_prepare() { - default - - cd loki_setupdb || die - mv configure.{in,ac} || die - eautoreconf - - cd "${S}"/${PN} || die - mv configure.{in,ac} || die - eautoreconf -} - -src_configure() { - cd loki_setupdb || die - econf - cd "${S}"/${PN} || die - econf -} - -src_compile() { - emake -C loki_setupdb - emake -C loki_patch -} - -src_install() { - cd ${PN} || die - dobin loki_patch make_patch - dodoc CHANGES NOTES README TODO -} diff --git a/games-util/loki_patch/metadata.xml b/games-util/loki_patch/metadata.xml index 1c3ba213c494..5b4310eed8d7 100644 --- a/games-util/loki_patch/metadata.xml +++ b/games-util/loki_patch/metadata.xml @@ -1,8 +1,11 @@ - - games@gentoo.org - Gentoo Games Project - + + games@gentoo.org + Gentoo Games Project + + + icculus/loki_patch + -- cgit v1.2.3-65-gdbad