[bug#73488,games,v3,5/7] gnu: Add jg-bsnes.

Message ID b9cd504cc5247182df15983bd2ee709f29c5d6d1.1727940344.git.maxim.cournoyer@gmail.com
State New
Headers
Series Add Jolly Good and some of its emulators |

Commit Message

Maxim Cournoyer Oct. 3, 2024, 7:25 a.m. UTC
  * gnu/packages/emulators.scm (jg-bsnes): New variable.

Change-Id: If88a7bea0c87c8af8fce051f8bec891ff249449f
---

Changes in v3:
 - Remove extraneous 'modules' field from origin

 gnu/packages/emulators.scm | 73 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
  

Comments

Maxim Cournoyer Oct. 5, 2024, 1:38 p.m. UTC | #1
Hi,

Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> Am Donnerstag, dem 03.10.2024 um 16:25 +0900 schrieb Maxim Cournoyer:
>> * gnu/packages/emulators.scm (jg-bsnes): New variable.
>> 
>> Change-Id: If88a7bea0c87c8af8fce051f8bec891ff249449f

[...]

>> +(define-public jg-bsnes
>> +  (package
>> +    (name "jg-bsnes")
>> +    (version "2.0.0")
>> +    (source (origin
>> +              (method git-fetch)
>> +              (uri (git-reference
>> +                    (url "https://gitlab.com/jgemu/bsnes")
>> +                    (commit version)))
>> +              (file-name (git-file-name name version))
>> +              ;; XXX: Some source dependencies are bundled and are
>> not easy to
>> +              ;; unbundle due to the build system building an object
>> combining
>> +              ;; their sources directly:
>> +              ;;  - byuuML
>> +              ;;  - gb
>> +              ;;  - libcoco
>> +              ;;  - snes_spc
> If possible, file an upstream bug and refer to that.

I don't think that's too feasible; these sources are intended to be used in
source forms; they don't ship with any build system.  See for example
byuuML [0].  gb corresponds to the 'core' source files of SameBoy:
https://github.com/LIJI32/SameBoy; it doesn't seem possible to build a
'core' library from that, although its symbols are probably part of the
a sameboy.so library we could build as part as our 'sameboy' package, so
this could be a possibility.

libco is supposed to be removed at some point [1] and finally spec_dsp
appears to be a modified forked of the original spec_dsp.c and spc_dsp.h
(no build system), making it more source than library.

I've still opened an issue mentioning that it'd be nice to use more deps
from the system, and that it seems it'd be practical to do so for
SameBoy [2].

[0]  https://github.com/SolraBizna/byuuML/tree/master?tab=readme-ov-file#using-the-byuuml-library
[1]  https://gitlab.com/jgemu/bsnes/-/issues/3
[2]  https://gitlab.com/jgemu/bsnes/-/issues/6

-- 
Thanks,
Maxim
  

Patch

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index ae2a78a0f6..4c1a705994 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -2356,6 +2356,79 @@  (define-public jgrf
                      license:public-domain ;md5.h, md5.c, parg.h, parg.c
                      license:cc0)))))
 
+(define-public jg-bsnes
+  (package
+    (name "jg-bsnes")
+    (version "2.0.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitlab.com/jgemu/bsnes")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              ;; XXX: Some source dependencies are bundled and are not easy to
+              ;; unbundle due to the build system building an object combining
+              ;; their sources directly:
+              ;;  - byuuML
+              ;;  - gb
+              ;;  - libcoco
+              ;;  - snes_spc
+              (snippet '(begin
+                          (use-modules (guix build utils))
+                          (delete-file-recursively "deps/libsamplerate")))
+              (sha256
+               (base32
+                "0z1ka4si8vcb0j6ih087cni18vpgfd3qnaw24awycxz23xc0jkdv"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f                  ;no test suite
+           #:make-flags
+           #~(list (string-append "AR=" #$(ar-for-target))
+                   (string-append "CC=" #$(cc-for-target))
+                   (string-append "CXX=" #$(cxx-for-target))
+                   (string-append "PREFIX=" #$output))
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)))) ;no configure script
+    (native-inputs (list jg-api pkg-config))
+    (inputs (list libsamplerate))
+    (home-page "https://gitlab.com/jgemu/bsnes")
+    (synopsis "Jolly Good Fork of bsnes")
+    (description "@code{bsnes-jg} is a cycle accurate emulator for the Super
+Famicom/Super Nintendo Entertainment System, including support for the Super
+Game Boy, BS-X Satellaview, and Sufami Turbo.  @code{bsnes-jg} is a fork of
+@code{bsnes} v115, Many changes have been made post-fork:
+@itemize
+@item Higher quality resampler with settings
+@item Improved performance without loss of accuracy
+@item Portability improvements
+@item Removal of accuracy-reducing hacks and unnecessary code
+@item Significant increase in standards compliance
+@item Translation to the C++ Standard Library (ISO C++11)
+@end itemize
+
+In particular, it uses much less @acronym{CPU, Central Processing Unit}
+compared to the original @code{bsnes} (though not as little as @code{zsnes}).
+
+The supported file formats are:
+@itemize @file
+@item .sfc
+@item .smc
+@item .bs
+@item .st
+@item .fig
+@item .swc
+@end itemize
+
+This is intended to be used with the Jolly Good Reference Frontend
+@command{jollygood} command from the @code{jgrf} package.")
+    ;; The project license is GPL3+.  The bundled source licenses are also
+    ;; listed below.
+    (license (list license:gpl3+
+                   license:bsd-3        ;byuuML
+                   license:expat        ;gb
+                   license:isc          ;libco
+                   license:lgpl2.1+))))
+
 (define-public zsnes
   (package
     (name "zsnes")