Subject: [PATCH] gnu: Add flycast.

From: Andrew Wong <[email-masked]>
Date: Tue, 11 Feb 2025 15:51:53 -0500

* gnu/packages/emulators.scm (flycast): New variable.

Change-Id: I358235492a3493c3126f7ca9f738ed2706e36105
---
Flycast has a libretro core too, but I haven't gotten it working yet. I am also working directly with the developer to try to un-bundle some of the deps.
 gnu/packages/emulators.scm | 56 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index f20b6da79b..c6ff685948 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -4072,6 +4072,62 @@ (define-public exomizer
     ;; zlib license with an (non-)advertising clause.
     (license license:zlib)))
 
+(define-public flycast
+  (package
+    (name "flycast")
+    (version "2.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/flyinghead/flycast")
+             (commit (string-append "v" version))
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0ainy75gkrvilcm89hq6wq9md41w0mxgp6l27q5fzrxxykpjh6ym"))
+       (modules '((guix build utils)
+                  (guile)))
+       (snippet
+        #~(begin
+            (substitute* "CMakeLists.txt"
+              (("add_subdirectory\\(core/deps/Vulkan-Headers\\)")
+               "find_package(VulkanHeaders)"))))))
+    (build-system cmake-build-system)
+    (inputs (list pkg-config
+                  sdl2
+                  vulkan-headers
+                  glslang
+                  libzip
+                  curl
+                  alsa-lib
+                  lua
+                  ao
+                  pulseaudio
+                  miniupnpc
+                  ;; vv needed for vulkan
+                  spirv-tools))
+    (arguments
+     (list #:tests? #f                   ;no target 'test'
+           #:configure-flags
+           #~(list "-DUSE_HOST_GLSLANG=OFF"
+                   ;; https://github.com/flyinghead/flycast/issues/1843
+                   "-DUSE_HOST_LIBZIP=ON"
+                   "-DUSE_HOST_SDL=ON"
+                   "-DUSE_ALSA=ON"
+                   "-DUSE_LUA=ON"
+                   "-DUSE_LIBAO=ON"
+                   "-DUSE_PULSEAUDIO=ON"
+                   "-DUSE_BREAKPAD=OFF"
+                   "-DUSE_VULKAN=ON"
+                   "-DUSE_DX9=OFF"
+                   "-DUSE_DX11=OFF")))
+    (home-page "https://github.com/flyinghead/flycast")
+    (synopsis "Sega Dreamcast, Naomi, Naomi 2, and Atomiswave emulator")
+    (description "Flycast is a multi-platform Sega Dreamcast, Naomi, Naomi 2,
+and Atomiswave emulator derived from reicast.")
+    (license license:gpl2+)))
+
 (define-public freedisksysrom
   ;; There is no release; use the latest commit.
   (let ((commit "0d5f95f109bb3aadf2bb9510bfda13879bbd5266")

base-commit: 5a897c5c95a81278b044c18d962d3bd83131ba06
-- 
2.48.1