Fri Mar 6 12:23:01 2020 UTC ()
emulators: Add caprice32.

Caprice32 is a software emulator of the Amstrad CPC 8bit home computer
series. The emulator faithfully imitates the CPC464, CPC664, and CPC6128
models. By recreating the operations of all hardware components at a
low level, the emulator achieves a high degree of compatibility with
original CPC software. These programs or games can be run unmodified at
real-time or higher speeds, depending on the emulator host environment.


(nia)
diff -r1.312 -r1.313 pkgsrc/emulators/Makefile
diff -r0 -r1.1 pkgsrc/emulators/caprice32/DESCR
diff -r0 -r1.1 pkgsrc/emulators/caprice32/MESSAGE
diff -r0 -r1.1 pkgsrc/emulators/caprice32/Makefile
diff -r0 -r1.1 pkgsrc/emulators/caprice32/PLIST
diff -r0 -r1.1 pkgsrc/emulators/caprice32/distinfo
diff -r0 -r1.1 pkgsrc/emulators/caprice32/patches/patch-cap32.cfg
diff -r0 -r1.1 pkgsrc/emulators/caprice32/patches/patch-doc_man6_cap32.6
diff -r0 -r1.1 pkgsrc/emulators/caprice32/patches/patch-makefile
diff -r0 -r1.1 pkgsrc/emulators/caprice32/patches/patch-src_cap32.cpp

cvs diff -r1.312 -r1.313 pkgsrc/emulators/Makefile (expand / switch to unified diff)

--- pkgsrc/emulators/Makefile 2020/01/29 10:33:16 1.312
+++ pkgsrc/emulators/Makefile 2020/03/06 12:23:01 1.313
@@ -1,39 +1,40 @@ @@ -1,39 +1,40 @@
1# $NetBSD: Makefile,v 1.312 2020/01/29 10:33:16 nia Exp $ 1# $NetBSD: Makefile,v 1.313 2020/03/06 12:23:01 nia Exp $
2# 2#
3 3
4COMMENT= Emulators for other operating systems 4COMMENT= Emulators for other operating systems
5 5
6SUBDIR+= 8086tiny 6SUBDIR+= 8086tiny
7SUBDIR+= BasiliskII 7SUBDIR+= BasiliskII
8SUBDIR+= Cygne-SDL 8SUBDIR+= Cygne-SDL
9SUBDIR+= DatLib 9SUBDIR+= DatLib
10SUBDIR+= DatUtil 10SUBDIR+= DatUtil
11SUBDIR+= MAMEDiff 11SUBDIR+= MAMEDiff
12SUBDIR+= PC6001VX 12SUBDIR+= PC6001VX
13SUBDIR+= ROMBuild 13SUBDIR+= ROMBuild
14SUBDIR+= ROMInfo 14SUBDIR+= ROMInfo
15SUBDIR+= ZIPIdent 15SUBDIR+= ZIPIdent
16SUBDIR+= aliados 16SUBDIR+= aliados
17SUBDIR+= applyppf 17SUBDIR+= applyppf
18SUBDIR+= aranym 18SUBDIR+= aranym
19SUBDIR+= arcem 19SUBDIR+= arcem
20SUBDIR+= arnold 20SUBDIR+= arnold
21SUBDIR+= atari800 21SUBDIR+= atari800
22SUBDIR+= b-em 22SUBDIR+= b-em
23SUBDIR+= blastem 23SUBDIR+= blastem
24SUBDIR+= blinkensim 24SUBDIR+= blinkensim
25SUBDIR+= bochs 25SUBDIR+= bochs
26SUBDIR+= cannonball 26SUBDIR+= cannonball
 27SUBDIR+= caprice32
27SUBDIR+= ckmame 28SUBDIR+= ckmame
28SUBDIR+= cmdpack 29SUBDIR+= cmdpack
29SUBDIR+= compat12 30SUBDIR+= compat12
30SUBDIR+= compat13 31SUBDIR+= compat13
31SUBDIR+= compat14 32SUBDIR+= compat14
32SUBDIR+= compat15 33SUBDIR+= compat15
33SUBDIR+= compat15-extras 34SUBDIR+= compat15-extras
34SUBDIR+= compat16 35SUBDIR+= compat16
35SUBDIR+= compat16-extras 36SUBDIR+= compat16-extras
36SUBDIR+= compat20 37SUBDIR+= compat20
37SUBDIR+= compat20-extras 38SUBDIR+= compat20-extras
38SUBDIR+= compat30 39SUBDIR+= compat30
39SUBDIR+= compat30-extras 40SUBDIR+= compat30-extras

File Added: pkgsrc/emulators/caprice32/DESCR
Caprice32 is a software emulator of the Amstrad CPC 8bit home computer
series. The emulator faithfully imitates the CPC464, CPC664, and CPC6128
models. By recreating the operations of all hardware components at a
low level, the emulator achieves a high degree of compatibility with
original CPC software. These programs or games can be run unmodified at
real-time or higher speeds, depending on the emulator host environment.

File Added: pkgsrc/emulators/caprice32/MESSAGE
===========================================================================
$NetBSD: MESSAGE,v 1.1 2020/03/06 12:23:01 nia Exp $

For copyright reasons ROM files cannot be redistributed with the package.

Caprice32 searches ${PREFIX}/share/caprice32/rom for BASIC and AMSDOS ROM
images in MAME/MESS format (only not compressed), e.g. cpc6128.rom and
amsdos.rom.

Note that Caprice32's executable name is "cap32" rather than "caprice32".

The F1 key opens Caprice32's menu.

===========================================================================

File Added: pkgsrc/emulators/caprice32/Makefile
# $NetBSD: Makefile,v 1.1 2020/03/06 12:23:01 nia Exp $

DISTNAME=	caprice32-4.5.0
CATEGORIES=	emulators
MASTER_SITES=	${MASTER_SITE_GITHUB:=ColinPitrat/}
GITHUB_TAG=	v${PKGVERSION_NOREV}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://github.com/ColinPitrat/caprice32
COMMENT=	Emulator of the Amstrad CPC 8bit home computer range
LICENSE=	gnu-gpl-v2

USE_TOOLS+=	gmake pkg-config
USE_LANGUAGES=	c c++
MAKE_FILE=	makefile

MAKE_FLAGS+=	prefix=${PREFIX}
MAKE_FLAGS+=	GIT_HASH="pkgsrc"

SUBST_CLASSES+=		conf
SUBST_STAGE.conf=	pre-configure
SUBST_MESSAGE.conf=	Fix paths.
SUBST_FILES.conf+=	cap32.cfg
SUBST_FILES.conf+=	src/cap32.cfg
SUBST_FILES.conf+=	src/cap32.cpp
SUBST_FILES.conf+=	doc/man6/cap32.6
SUBST_VARS.conf+=	PREFIX
SUBST_VARS.conf+=	PKG_SYSCONFDIR

EGDIR=		${PREFIX}/share/examples/caprice32

CONF_FILES+=	${EGDIR}/cap32.cfg ${PKG_SYSCONFDIR}/cap32.cfg

RESTRICTED=	Questionable ROM images in source tree
NO_SRC_ON_FTP=	${RESTRICTED}

.include "../../devel/SDL/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/emulators/caprice32/PLIST
@comment $NetBSD: PLIST,v 1.1 2020/03/06 12:23:01 nia Exp $
bin/cap32
man/man6/cap32.6
share/caprice32/resources/audio.bmp
share/caprice32/resources/cap32logo.bmp
share/caprice32/resources/disk.bmp
share/caprice32/resources/general.bmp
share/caprice32/resources/input.bmp
share/caprice32/resources/keymap_es_linux.map
share/caprice32/resources/keymap_es_win.map
share/caprice32/resources/keymap_fr_linux.map
share/caprice32/resources/keymap_fr_win.map
share/caprice32/resources/keymap_uk_linux.map
share/caprice32/resources/keymap_uk_win.map
share/caprice32/resources/keymap_us.map
share/caprice32/resources/rom.bmp
share/caprice32/resources/vera_mono.ttf
share/caprice32/resources/vera_sans.ttf
share/caprice32/resources/video.bmp
share/examples/caprice32/cap32.cfg

File Added: pkgsrc/emulators/caprice32/distinfo
$NetBSD: distinfo,v 1.1 2020/03/06 12:23:01 nia Exp $

SHA1 (caprice32-4.5.0.tar.gz) = c1f824023a0cee23488e238cb518d4b176594ee2
RMD160 (caprice32-4.5.0.tar.gz) = b803d7f0f8742fc7bb10d23e24c71dbaa7484f6b
SHA512 (caprice32-4.5.0.tar.gz) = 9f4c2583fa7d5215901765109177eef60c89dc322b59c352473bdc00dabc5d65dba112bcf4c41b47322c98e9b76d11fc7ecdf9e9973c57ba42b6966ceaba5efd
Size (caprice32-4.5.0.tar.gz) = 577297 bytes
SHA1 (patch-cap32.cfg) = 862cb8eff1235e3cbd95410a5e2074cf7a48df09
SHA1 (patch-doc_man6_cap32.6) = 9779e2fb84d22f4f74bb8540872239e4359d0aeb
SHA1 (patch-makefile) = 8a25b98eeb0e7b2c016628bb3dda0e8a8e084915
SHA1 (patch-src_cap32.cpp) = c6d6c23f8a0cc59cdecbe63d99cca5b87f1eb274

File Added: pkgsrc/emulators/caprice32/patches/Attic/patch-cap32.cfg
$NetBSD: patch-cap32.cfg,v 1.1 2020/03/06 12:23:01 nia Exp $

Fix paths.

--- cap32.cfg.orig	2019-01-04 19:01:29.000000000 +0000
+++ cap32.cfg
@@ -50,7 +50,7 @@ joystick_menu_button=9
 joystick_vkeyboard_button=10
 # resources_path
 #   path to resources (menu images...)
-resources_path=/usr/local/share/caprice32/resources
+resources_path=@PREFIX@/share/caprice32/resources
 # boot_time
 #   Estimated time in video frames the CPC takes to boot.
 #   Caprice will emulate this number of frames before starting to send a provided autocmd.
@@ -167,7 +167,7 @@ printer_file=./printer.dat
 sdump_dir=./screenshots
 
 [rom]
-rom_path=/usr/local/share/caprice32/rom
+rom_path=@PREFIX@/share/caprice32/rom
 slot00=
 slot01=
 slot02=

File Added: pkgsrc/emulators/caprice32/patches/patch-doc_man6_cap32.6
$NetBSD: patch-doc_man6_cap32.6,v 1.1 2020/03/06 12:23:01 nia Exp $

Fix path.

--- doc/man6/cap32.6.orig	2019-01-04 19:01:29.000000000 +0000
+++ doc/man6/cap32.6
@@ -26,7 +26,7 @@ The \fBrom_path\fR entry in the configur
 .PP
 \fBConfiguration\fR
 .RS
-When launched, Caprice32 will look for a configuration file in several locations. If a configuration file was specified using the \fB\-\-cfg_file\fR command line switch, Caprice32 will try and use it. If no configuration file was specified, or the configuration file specified does not exist, Caprice32 will try and open, in this order: \fB$CWD/cap32.cfg\fR ($CWD being the directory where the cap32 executable resides), then a \fB.cap32.cfg\fR file in the user home directory, then \fB/etc/cap32.cfg\fR. Caprice32 will use the first valid file it finds. If no configuration file is found, a default configuration will be used.
+When launched, Caprice32 will look for a configuration file in several locations. If a configuration file was specified using the \fB\-\-cfg_file\fR command line switch, Caprice32 will try and use it. If no configuration file was specified, or the configuration file specified does not exist, Caprice32 will try and open, in this order: \fB$CWD/cap32.cfg\fR ($CWD being the directory where the cap32 executable resides), then a \fB.cap32.cfg\fR file in the user home directory, then \fB@PKG_SYSCONFDIR@/cap32.cfg\fR. Caprice32 will use the first valid file it finds. If no configuration file is found, a default configuration will be used.
 .PP
 The configuration file contains various configuration parameters, some of which can be modified from the GUI.
 When saving the configuration from the GUI, it will be written in the configuration file specified by the \fB\-\-cfg_file\fR switch, if it exists, else in $CWD/cap32.cfg if it exists, otherwise in $HOME/.cap32.cfg.
@@ -138,7 +138,7 @@ The screen capture code uses driedfruit 
 .SH FILES
 $HOME/.cap32.cfg
 .br
-/etc/cap32.cfg
+@PKG_SYSCONFDIR@/cap32.cfg
 
 .SH SEE ALSO
 https://github.com/ColinPitrat/caprice32

File Added: pkgsrc/emulators/caprice32/patches/patch-makefile
$NetBSD: patch-makefile,v 1.1 2020/03/06 12:23:01 nia Exp $

We pass our own flags.

--- makefile.orig	2019-01-04 19:01:29.000000000 +0000
+++ makefile
@@ -50,7 +50,6 @@ COMMON_CFLAGS += -DWITH_IPF
 LIBS += $(MINGW_PATH)/bin/$(CAPSIPFDLL)
 endif
 else
-prefix = /usr/local
 TARGET = cap32
 TEST_TARGET = test_runner
 IPATHS = -Isrc/ -Isrc/gui/includes `pkg-config --cflags freetype2` `sdl-config --cflags` `pkg-config --cflags libpng`
@@ -97,7 +96,7 @@ TEST_OBJECTS:=$(TEST_DEPENDS:.d=.o)
 WARNINGS = -Wall -Wextra -Wzero-as-null-pointer-constant -Wformat=2 -Wold-style-cast -Wmissing-include-dirs -Wlogical-op -Woverloaded-virtual -Wpointer-arith -Wredundant-decls
 COMMON_CFLAGS += $(CFLAGS) -std=c++11 $(IPATHS)
 DEBUG_FLAGS = -Werror -g -O0 -DDEBUG
-RELEASE_FLAGS = -O2 -funroll-loops -ffast-math -fomit-frame-pointer -fno-strength-reduce -finline-functions -s
+RELEASE_FLAGS = -ffast-math -fno-strength-reduce -finline-functions
 BUILD_FLAGS = $(RELEASE_FLAGS)
 
 debug: BUILD_FLAGS:=$(DEBUG_FLAGS)
@@ -117,7 +116,7 @@ ifdef DEBUG
 BUILD_FLAGS = $(DEBUG_FLAGS)
 all: check_deps debug
 else
-all: check_deps distrib
+all: check_deps $(TARGET)
 endif
 
 # gtest doesn't build with warnings flags, hence the COMMON_CFLAGS
@@ -204,11 +203,15 @@ distrib: $(TARGET)
 	ln -s caprice32-$(VERSION).tar.bz2 $(ARCHIVE)/caprice32_$(VERSION).orig.tar.bz2 || true
 
 install: $(TARGET)
-	install -D $(TARGET) $(DESTDIR)$(prefix)/bin/$(TARGET)
-	install -D $(GROFF_DOC) $(DESTDIR)$(prefix)/share/man/man6/cap32.6
-	install -D -m664 cap32.cfg $(DESTDIR)/etc/cap32.cfg
-	mkdir -p $(DESTDIR)$(prefix)/share/caprice32
-	cp -r resources rom $(DESTDIR)$(prefix)/share/caprice32
+	$(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(prefix)/bin
+	$(BSD_INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(prefix)/bin/$(TARGET)
+	$(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(prefix)/$(PKGMANDIR)/man6
+	$(BSD_INSTALL_MAN) $(GROFF_DOC) $(DESTDIR)$(prefix)/$(PKGMANDIR)/man6/cap32.6
+	$(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(prefix)/share/examples/caprice32
+	$(BSD_INSTALL_DATA) cap32.cfg $(DESTDIR)$(prefix)/share/examples/caprice32/cap32.cfg
+	$(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(prefix)/share/caprice32/resources
+	$(BSD_INSTALL_DATA) resources/* $(DESTDIR)$(prefix)/share/caprice32/resources
+	$(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(prefix)/share/caprice32/rom
 endif
 
 ####################################

File Added: pkgsrc/emulators/caprice32/patches/patch-src_cap32.cpp
$NetBSD: patch-src_cap32.cpp,v 1.1 2020/03/06 12:23:01 nia Exp $

Fix paths.

--- src/cap32.cpp.orig	2019-01-04 19:01:29.000000000 +0000
+++ src/cap32.cpp
@@ -1578,7 +1578,7 @@ std::string getConfigurationFilename(boo
         configFilename = std::string(getenv("HOME")) + "/.cap32.cfg";
         // If still not found, look for cap32.cfg in /etc
         if (!forWrite && access(configFilename.c_str(), F_OK) != 0) {
-           configFilename = "/etc/cap32.cfg";
+           configFilename = "@PKG_SYSCONFDIR@/cap32.cfg";
         }
      }
   }