summaryrefslogtreecommitdiff
path: root/emulators/caprice32/patches
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/caprice32/patches')
-rw-r--r--emulators/caprice32/patches/patch-cap32.cfg24
-rw-r--r--emulators/caprice32/patches/patch-doc_man6_cap32.624
-rw-r--r--emulators/caprice32/patches/patch-makefile53
-rw-r--r--emulators/caprice32/patches/patch-src_cap32.cpp15
4 files changed, 116 insertions, 0 deletions
diff --git a/emulators/caprice32/patches/patch-cap32.cfg b/emulators/caprice32/patches/patch-cap32.cfg
new file mode 100644
index 00000000000..3b4062815b4
--- /dev/null
+++ b/emulators/caprice32/patches/patch-cap32.cfg
@@ -0,0 +1,24 @@
+$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=
diff --git a/emulators/caprice32/patches/patch-doc_man6_cap32.6 b/emulators/caprice32/patches/patch-doc_man6_cap32.6
new file mode 100644
index 00000000000..26934087aef
--- /dev/null
+++ b/emulators/caprice32/patches/patch-doc_man6_cap32.6
@@ -0,0 +1,24 @@
+$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
diff --git a/emulators/caprice32/patches/patch-makefile b/emulators/caprice32/patches/patch-makefile
new file mode 100644
index 00000000000..e32556062b8
--- /dev/null
+++ b/emulators/caprice32/patches/patch-makefile
@@ -0,0 +1,53 @@
+$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
+
+ ####################################
diff --git a/emulators/caprice32/patches/patch-src_cap32.cpp b/emulators/caprice32/patches/patch-src_cap32.cpp
new file mode 100644
index 00000000000..3e384b02408
--- /dev/null
+++ b/emulators/caprice32/patches/patch-src_cap32.cpp
@@ -0,0 +1,15 @@
+$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";
+ }
+ }
+ }