commit:     05d74e303cc31b646efbb21db536371f38c42b58
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  7 07:57:07 2022 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Oct  7 07:59:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05d74e30

app-emulation/xtrs: Add some type declarations to make the C99 gods happy

Closes: https://bugs.gentoo.org/875674
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 app-emulation/xtrs/files/xtrs-4.9d-implicit.patch | 35 ++++++++++
 app-emulation/xtrs/xtrs-4.9d-r6.ebuild            | 83 +++++++++++++++++++++++
 2 files changed, 118 insertions(+)

diff --git a/app-emulation/xtrs/files/xtrs-4.9d-implicit.patch 
b/app-emulation/xtrs/files/xtrs-4.9d-implicit.patch
new file mode 100644
index 000000000000..959c3fb375a7
--- /dev/null
+++ b/app-emulation/xtrs/files/xtrs-4.9d-implicit.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/875674
+
+--- xtrs-4.9d/trs_disk.c
++++ xtrs-4.9d/trs_disk.c
+@@ -3137,7 +3137,7 @@
+ }
+ 
+ void
+-real_restore(curdrive)
++real_restore(int curdrive)
+ {
+ #if __linux
+   DiskState *d = &disk[curdrive];
+--- xtrs-4.9d/trs_memory.c
++++ xtrs-4.9d/trs_memory.c
+@@ -153,7 +153,7 @@
+     memory_map = which + (trs_model << 4) + (romin << 2);
+ }
+ 
+-void mem_romin(state)
++void mem_romin(int state)
+ {
+     romin = (state & 1);
+     memory_map = (memory_map & ~4) + (romin << 2);
+--- xtrs-4.9d/trs_printer.c
++++ xtrs-4.9d/trs_printer.c
+@@ -18,7 +18,7 @@
+ #include "z80.h"
+ #include "trs.h"
+ 
+-void trs_printer_write(value)
++void trs_printer_write(int value)
+ {
+     if(value == 0x0D)
+     {

diff --git a/app-emulation/xtrs/xtrs-4.9d-r6.ebuild 
b/app-emulation/xtrs/xtrs-4.9d-r6.ebuild
new file mode 100644
index 000000000000..21cc748c8465
--- /dev/null
+++ b/app-emulation/xtrs/xtrs-4.9d-r6.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs readme.gentoo-r1
+
+DESCRIPTION="Radio Shack TRS-80 emulator"
+HOMEPAGE="https://www.tim-mann.org/xtrs.html";
+SRC_URI="https://www.tim-mann.org/trs80/${P}.tar.gz
+       ls-dos? (
+               https://www.tim-mann.org/trs80/ld4-631.zip
+               https://dev.gentoo.org/~ulm/distfiles/ld4-631l.xd3
+       )"
+
+LICENSE="xtrs ls-dos? ( freedist )"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="ls-dos"
+RESTRICT="ls-dos? ( bindist )"
+
+RDEPEND="sys-libs/ncurses:0=
+       sys-libs/readline:0=
+       x11-libs/libX11"
+DEPEND="${RDEPEND}
+       ls-dos? ( app-arch/unzip dev-util/xdelta:3 )"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-lcmod.patch
+       "${FILESDIR}"/${P}-implicit.patch
+)
+
+src_prepare() {
+       default
+       sed -i -e 's/$(CC) -o/$(CC) $(LDFLAGS) -o/' Makefile || die
+       if use ls-dos; then
+               cd "${WORKDIR}" || die
+               xdelta3 -d -s ld4-631.dsk "${DISTDIR}"/ld4-631l.xd3 out.dsk || 
die
+               mv out.dsk ld4-631.dsk || die
+       fi
+}
+
+src_compile() {
+       case $(tc-endian) in
+               little) ;;
+               big) append-flags -Dbig_endian ;;
+               *) die ;;
+       esac
+       emake CC="$(tc-getCC)" DEBUG="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+       dodir /usr/bin /usr/share/xtrs/disks /usr/share/man/man1
+       emake PREFIX="${D}"/usr install
+
+       insopts -m0444
+       insinto /usr/share/xtrs/disks
+       doins cpmutil.dsk utility.dsk
+
+       if use ls-dos; then
+               doins "${WORKDIR}"/ld4-631.dsk
+               dosym disks/ld4-631.dsk /usr/share/xtrs/disk4p-0
+               dosym disks/utility.dsk /usr/share/xtrs/disk4p-1
+       fi
+
+       dodoc ChangeLog README xtrsrom4p.README cpmutil.html dskspec.html
+
+       local DOC_CONTENTS="For copyright reasons, xtrs does not include actual
+               ROM images. Because of this, unless you supply your own ROM, 
xtrs
+               will not function in any mode except 'Model 4p' mode (a minimal
+               free ROM is included for this), which can be run like this:
+               \n\nxtrs -model 4p -diskdir /usr/share/xtrs
+               \n\nIf you already own a copy of the ROM software (e.g., if you 
have
+               a TRS-80 with this ROM), then you can make yourself a copy of 
this
+               for use with xtrs, using utilities available on the web. To load
+               your own ROM, specify the '-romfile' option, or the 
'Xtrs.romfile'
+               X resource. ROM files can be in Intel hex or binary format."
+       readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+       readme.gentoo_print_elog
+}

Reply via email to