@@ -21,6 +21,7 @@
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
;;; Copyright © 2023 Hendursaga <hendursaga@aol.com>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2024 Altadil <altadil@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -81,6 +82,7 @@ (define-module (gnu packages emulators)
#:use-module (gnu packages graphics)
#:use-module (gnu packages gtk)
#:use-module (gnu packages image)
+ #:use-module (gnu packages kde-frameworks)
#:use-module (gnu packages libedit)
#:use-module (gnu packages libusb)
#:use-module (gnu packages linux)
@@ -102,6 +104,7 @@ (define-module (gnu packages emulators)
#:use-module (gnu packages tls)
#:use-module (gnu packages upnp)
#:use-module (gnu packages video)
+ #:use-module (gnu packages vim)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xiph)
@@ -733,6 +736,67 @@ (define-public mednafen
;; Main license is GPL2+. Some parts are BSD-3.
(license (list license:gpl2+ license:bsd-3))))
+(define-public melonds
+ (package
+ (name "melonds")
+ (version "0.9.5")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/melonDS-emu/melonDS")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0c4hhs5mffj43pa2y18k70q6szc09m8yj0gqw2svszpvpz2n91cz"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f ; No test target available.
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'compile-bios
+ (lambda* (#:key inputs #:allow-other-keys)
+ (define (as arm arch)
+ (invoke "arm-none-eabi-gcc"
+ "-c" "freebios/bios_common.S"
+ (string-append "-march=armv" arch)
+ (string-append "-DBIOS_ARM" arm)
+ "-o" (string-append "bios_arm" arm ".o"))
+ (invoke "arm-none-eabi-objcopy"
+ "-O" "binary"
+ (string-append "bios_arm" arm ".o")
+ (string-append "bios_arm" arm ".bin")))
+
+ (as "7" "4t")
+ (as "9" "5te")
+ (with-output-to-file "src/FreeBIOS.h"
+ (lambda ()
+ (display "#ifndef FREEBIOS_H\n#define FREEBIOS_H\n")
+ (invoke "xxd" "-i" "bios_arm7.bin")
+ (invoke "xxd" "-i" "bios_arm9.bin")
+ (display "#endif\n"))))))))
+ (native-inputs (list (cross-gcc "arm-none-eabi")
+ (cross-binutils "arm-none-eabi")
+ extra-cmake-modules
+ pkg-config
+ xxd))
+ (inputs (list libarchive
+ libpcap
+ libslirp
+ qtbase-5
+ qtmultimedia-5
+ sdl2
+ wayland
+ zstd))
+ (synopsis "DS emulator")
+ (description "melonDS is an emulator of the Nintendo DS. It aims at
+providing fast and accurate emulation. While it is still a work in progress,
+it has a pretty solid set of features, includind a nearly complete core, a JIT
+recompiler for fast emulation, an OpenGL renderer, joystick support and
+savestates.")
+ (home-page "https://melonds.kuribo64.net/")
+ (license license:gpl3+)))
+
(define-public mgba
(package
(name "mgba")