Skip to content

Commit

Permalink
games-emulation/fbzx: add 4.6.0, EAPI-7
Browse files Browse the repository at this point in the history
- update homepage/src_uri
- libsdl -> libsdl2
- add missing [joystick] (bug #733446)
- add prefix to runtime datadir
- use provided .desktop file
- rebased makefile patch with method to select alsa/pulseaudio
  rather than always require both (sources have defines already)

gcc11 bug #789597 fixed upstream since v4.1.0 ('byte/word' removed)

Closes: https://bugs.gentoo.org/733446
Closes: https://bugs.gentoo.org/789597
Signed-off-by: Ionen Wolkens <[email protected]>
  • Loading branch information
ionenwks committed Jun 1, 2021
1 parent 0962650 commit b1c9ee7
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 0 deletions.
1 change: 1 addition & 0 deletions games-emulation/fbzx/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST fbzx-3.0.0.tar.gz 435239 BLAKE2B 5105995a7972c7310628c0e4d3af7f1a749192bc24ac312e493d8821edf5ec329a65eedcbfa6c8479a4f4d134ca730acef7ee27ef2f89253f2e179c7cf8c2bf1 SHA512 cf2a01a1dde62da03c1f04e91f226859ae4cf06d099597dc1a1554c4ff9782dd287f9d924083829eee40cf0450c053d818f963f68381f9e16e0e61ca1f3d3083
DIST fbzx_4.6.0.tar.bz2 307308 BLAKE2B 0cf6e9bf3e01c5a03e0925707aab46829ed8e3f0e4c0791d362ab8972d5d0175e35635e5ad6f895db369b4cb543efc40561fa41ec1cfd739c7252762250bdb7e SHA512 4644038c615e2487361e8a7a72d69ae2e136945160d4cc8ed982365243a7e016edff6165ae86a3f50e3f0f4d45540bfd933353ca17596f9d8e10153c492f15d9
53 changes: 53 additions & 0 deletions games-emulation/fbzx/fbzx-4.6.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit desktop toolchain-funcs

DESCRIPTION="Full Screen Sinclair Spectrum emulator"
HOMEPAGE="http://www.rastersoft.com/programas/fbzx.html"
SRC_URI="http://www.rastersoft.com/descargas/fbzx/${PN}_${PV}.tar.bz2"
S="${WORKDIR}/${PN}_${PV}"

LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="alsa pulseaudio"

RDEPEND="
media-libs/libsdl2[joystick,video]
alsa? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"

PATCHES=(
"${FILESDIR}"/${P}-joystick-invert.patch
"${FILESDIR}"/${P}-makefile.patch
)

src_prepare() {
default

sed -i "s|/usr/share|${EPREFIX}/usr/share/${PN}|" src/llscreen.cpp || die
}

src_compile() {
tc-export CXX PKG_CONFIG

emake ALSA=$(usex alsa) PULSE=$(usex pulseaudio)
}

src_install() {
dobin src/${PN}
dodoc AMSTRAD CAPABILITIES FAQ HISTORY.md README.{TZX,md} TODO
doicon data/${PN}.svg
domenu data/${PN}.desktop

insinto /usr/share/${PN}
doins -r data/spectrum-roms

insinto /usr/share/${PN}/${PN}
doins data/keymap.bmp
}
32 changes: 32 additions & 0 deletions games-emulation/fbzx/files/fbzx-4.6.0-joystick-invert.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Fixed in 4.7.0 but, while marked as released for some time,
it hasn't been tagged nor given a tarball (yet), so backport
fix to this troublesome issue for now.

https://gitlab.com/rastersoft/fbzx/-/commit/7bd47e2
From: Sergio Costas <[email protected]>
Date: Sat, 17 Apr 2021 14:15:32 +0200
Subject: [PATCH] Fixed the SINCLAIR joystick emulation

The horizontal movements were inverted.
--- a/src/keyboard.cpp
+++ b/src/keyboard.cpp
@@ -386,3 +386,3 @@
case 2: // sinclair 1
- temporal_io = SDLK_1;
+ temporal_io = SDLK_2;
break;
@@ -390,3 +390,3 @@
case 3: // sinclair 2
- temporal_io = SDLK_6;
+ temporal_io = SDLK_7;
break;
@@ -406,3 +406,3 @@
case 2: // sinclair 1
- temporal_io = SDLK_2;
+ temporal_io = SDLK_1;
break;
@@ -410,3 +410,3 @@
case 3: // sinclair 2
- temporal_io = SDLK_7;
+ temporal_io = SDLK_6;
break;
60 changes: 60 additions & 0 deletions games-emulation/fbzx/files/fbzx-4.6.0-makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Respect CXX, CXXFLAGS, CPPFLAGS, and PKG_CONFIG.
Add way to choose audio backend (alsa, pulse, or neither).

Alternatively, cmake migration has been proposed upstream:
https://gitlab.com/rastersoft/fbzx/-/merge_requests/10
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,8 +3,14 @@
CC=g++ -c $(FLAGS)
-CXX=g++ -c $(FLAGS)
-LN=g++
+LN=$(CXX)

-CFLAGS += `pkg-config --cflags sdl2 libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA
-CXXFLAGS += `pkg-config --cflags sdl2 libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA
-LDFLAGS += `pkg-config --libs sdl2 libpulse-simple alsa`
+CXXFLAGS:=-c $(CXXFLAGS) $(CPPFLAGS) $(shell $(PKG_CONFIG) --cflags sdl2)
+LDFLAGS:=$(LDFLAGS) $(shell $(PKG_CONFIG) --libs sdl2)
+ifeq ($(ALSA),yes)
+ CXXFLAGS+=$(shell $(PKG_CONFIG) --cflags alsa) -DD_SOUND_ALSA
+ LDFLAGS+=$(shell $(PKG_CONFIG) --libs alsa)
+endif
+ifeq ($(PULSE),yes)
+ CXXFLAGS+=$(shell $(PKG_CONFIG) --cflags libpulse-simple) -DD_SOUND_PULSE
+ LDFLAGS+=$(shell $(PKG_CONFIG) --libs libpulse-simple)
+endif

@@ -15,24 +21,24 @@
Z80free.o: z80free/Z80free.c z80free/Z80free.h
- $(CXX) -o Z80free.o z80free/Z80free.c
+ $(CXX) $(CXXFLAGS) -o Z80free.o z80free/Z80free.c

Z80free_codes.o: z80free/Z80free_codes.c z80free/Z80free.h
- $(CXX) -o Z80free_codes.o z80free/Z80free_codes.c
+ $(CXX) $(CXXFLAGS) -o Z80free_codes.o z80free/Z80free_codes.c

Z80free_codesCB.o: z80free/Z80free_codesCB.c z80free/Z80free.h
- $(CXX) -o Z80free_codesCB.o z80free/Z80free_codesCB.c
+ $(CXX) $(CXXFLAGS) -o Z80free_codesCB.o z80free/Z80free_codesCB.c

Z80free_codesED.o: z80free/Z80free_codesED.c z80free/Z80free.h
- $(CXX) -o Z80free_codesED.o z80free/Z80free_codesED.c
+ $(CXX) $(CXXFLAGS) -o Z80free_codesED.o z80free/Z80free_codesED.c

Z80free_codesDD.o: z80free/Z80free_codesDD.c z80free/Z80free.h
- $(CXX) -o Z80free_codesDD.o z80free/Z80free_codesDD.c
+ $(CXX) $(CXXFLAGS) -o Z80free_codesDD.o z80free/Z80free_codesDD.c

Z80free_codesFD.o: z80free/Z80free_codesFD.c z80free/Z80free.h
- $(CXX) -o Z80free_codesFD.o z80free/Z80free_codesFD.c
+ $(CXX) $(CXXFLAGS) -o Z80free_codesFD.o z80free/Z80free_codesFD.c

Z80free_codesDDCB.o: z80free/Z80free_codesDDCB.c z80free/Z80free.h
- $(CXX) -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
+ $(CXX) $(CXXFLAGS) -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c

Z80free_codesFDCB.o: z80free/Z80free_codesFDCB.c z80free/Z80free.h
- $(CXX) -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
+ $(CXX) $(CXXFLAGS) -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c

0 comments on commit b1c9ee7

Please sign in to comment.