unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 1047dd48191439a2a6104faf234f3e7e560837a4 3078 bytes (raw)
name: gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
 
Upstream-status: https://gitlab.com/jgemu/bsnes/-/merge_requests/429

diff --git a/Makefile b/Makefile
index 7371ff4..a4a8457 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,9 @@ MKDIRS := deps/byuuML \
 	src/expansion \
 	src/processor
 
+# Set to 1 to use a system-provided SameBoy shared library.
+USE_EXTERNAL_SAMEBOY := 0
+
 # Global symbols
 # TODO: Darwin export files expect mangled symbols for C++
 SYMBOLS :=
@@ -61,6 +64,9 @@ CPPFLAGS_GB := -DGB_INTERNAL -DGB_DISABLE_CHEATS -DGB_DISABLE_DEBUGGER \
 	-D_GNU_SOURCE -DGB_VERSION=\"0.16.6\"
 
 INCLUDES += $(CFLAGS_SAMPLERATE) -I$(DEPDIR)
+ifeq ($(USE_EXTERNAL_SAMEBOY), 0)
+INCLUDES += -I$(DEPDIR)/gb
+endif
 LIBS += $(LIBS_SAMPLERATE)
 
 EXT := cpp
@@ -81,7 +87,13 @@ WARNINGS_CO := $(WARNINGS_MIN) -Wmissing-prototypes
 WARNINGS_ICD := $(WARNINGS_CXX)
 WARNINGS_GB := -Wall -Wno-missing-braces -Wno-multichar -Wno-unused-result
 
-CSRCS := deps/gb/apu.c \
+CSRCS := \
+	deps/libco/libco.c \
+	deps/snes_spc/spc_dsp.c
+
+ifeq ($(USE_EXTERNAL_SAMEBOY), 0)
+CSRCS += \
+	deps/gb/apu.c \
 	deps/gb/camera.c \
 	deps/gb/display.c \
 	deps/gb/gb.c \
@@ -96,9 +108,16 @@ CSRCS := deps/gb/apu.c \
 	deps/gb/sgb.c \
 	deps/gb/sm83_cpu.c \
 	deps/gb/timing.c \
-	deps/gb/workboy.c \
-	deps/libco/libco.c \
-	deps/snes_spc/spc_dsp.c
+	deps/gb/workboy.c
+else
+CFLAGS_SAMEBOY = $(shell $(PKG_CONFIG) --cflags sameboy || echo fail)
+LIBS_SAMEBOY = $(shell $(PKG_CONFIG) --libs sameboy || echo fail)
+ifeq ($(CFLAGS_SAMEBOY)$(LIBS_SAMEBOY),failfail)
+$(error "pkg-config failure; CFLAGS_SAMEBOY and LIBS_SAMEBOY missing")
+endif
+INCLUDES += $(CFLAGS_SAMEBOY)
+LIBS += $(LIBS_SAMEBOY)
+endif
 
 CXXSRCS := deps/byuuML/byuuML.cpp \
 	src/audio.cpp \
@@ -243,8 +262,11 @@ install-data: all
 
 install-docs::
 	cp $(DEPDIR)/byuuML/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-byuuML
-	cp $(DEPDIR)/gb/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-gb
 	cp $(DEPDIR)/libco/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-libco
 	cp $(DEPDIR)/snes_spc/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-spc
+ifeq ($(USE_EXTERNAL_SAMEBOY), 0)
+install-docs::
+	cp $(DEPDIR)/gb/LICENSE $(DESTDIR)$(DOCDIR)/LICENSE-gb
+endif
 
 include $(SOURCEDIR)/mk/rules.mk
diff --git a/README b/README
index 3db6823..910c8d5 100644
--- a/README
+++ b/README
@@ -30,7 +30,8 @@ Options:
   ENABLE_HTML - Set to a non-zero value to generate the html documentation.
   ENABLE_STATIC - Set to a non-zero value to build a static archive.
   ENABLE_STATIC_JG - Set to a non-zero value to build a static JG archive.
-  USE_VENDORED_SAMPLERATE - Set non-zero to use vendored libsamplerate
+  USE_VENDORED_SAMPLERATE - Set non-zero to use vendored libsamplerate.
+  USE_EXTERNAL_SAMEBOY - Set non-zero to use system-provided sameboy.
 
 Linux:
   make
diff --git a/src/coprocessor/icd.cpp b/src/coprocessor/icd.cpp
index 2b0fb96..066b63e 100644
--- a/src/coprocessor/icd.cpp
+++ b/src/coprocessor/icd.cpp
@@ -28,7 +28,7 @@
 #include "icd.hpp"
 
 extern "C" {
-  #include <gb/gb.h>
+  #include <gb.h>
 }
 
 //warning: the size of this object will be too large due to C++ size rules differing from C rules.

debug log:

solving 1047dd4819 ...
found 1047dd4819 in https://yhetil.org/guix-patches/cb93e8ce73ea21c6764d15e85744b0732bc11d87.1728684335.git.maxim.cournoyer@gmail.com/

applying [1/1] https://yhetil.org/guix-patches/cb93e8ce73ea21c6764d15e85744b0732bc11d87.1728684335.git.maxim.cournoyer@gmail.com/
diff --git a/gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch b/gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch
new file mode 100644
index 0000000000..1047dd4819

1:14: space before tab in indent.
 	src/expansion \
1:15: space before tab in indent.
 	src/processor
1:16: trailing whitespace.
 
1:24: space before tab in indent.
 	-D_GNU_SOURCE -DGB_VERSION=\"0.16.6\"
1:25: trailing whitespace.
 
Checking patch gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch...
Applied patch gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch cleanly.
warning: squelched 18 whitespace errors
warning: 23 lines add whitespace errors.

index at:
100644 1047dd48191439a2a6104faf234f3e7e560837a4	gnu/packages/patches/jg-bsnes-unbundle-sameboy.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).