GNU bug report logs - #68469
[PATCH] gnu: Add melonds.

Previous Next

Package: guix-patches;

Reported by: altadil <Altadil <at> protonmail.com>

Date: Mon, 15 Jan 2024 12:49:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 68469 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#68469; Package guix-patches. (Mon, 15 Jan 2024 12:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to altadil <Altadil <at> protonmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 15 Jan 2024 12:49:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: altadil <Altadil <at> protonmail.com>
To: guix-patches <at> gnu.org
Cc: altadil <altadil <at> protonmail.com>
Subject: [PATCH] gnu: Add melonds.
Date: Mon, 15 Jan 2024 12:47:53 +0000
* gnu/packages/emulators.scm (melonds): New variable.

Change-Id: I8f7d31686fe5c9860acd86eb5740933218ca2910
---
guix build --no-grafts --check --rounds=2 --system=x86_64-linux was
run successfully on a Zen4 CPU.
 gnu/packages/emulators.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index cde3ee052c..a0235e572b 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -21,6 +21,7 @@
 ;;; Copyright © 2023 Yovan Naumovski <yovan <at> gorski.stream>
 ;;; Copyright © 2023 Hendursaga <hendursaga <at> aol.com>
 ;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
+;;; Copyright © 2024 Altadil <altadil <at> 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)
@@ -733,6 +735,39 @@ (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.
+    (native-inputs (list extra-cmake-modules pkg-config))
+    (inputs (list curl
+                  gnutls
+                  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")

base-commit: 162d6a2fdd6af13272967c77347a54934ecb45e6
-- 
2.41.0






Information forwarded to guix-patches <at> gnu.org:
bug#68469; Package guix-patches. (Tue, 16 Jan 2024 07:12:01 GMT) Full text and rfc822 format available.

Message #8 received at 68469 <at> debbugs.gnu.org (full text, mbox):

From: Lilah Tascheter <lilah <at> lunabee.space>
To: 68469 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: Add melonds.
Date: Tue, 16 Jan 2024 01:11:23 -0600
hi!

great patch!! :)
there's a few small issues I found:
* the source hash line is too long, style guide says lines shouldn't
  exceed 80 cols.
* melonds doesn't actually require curl and gnutls. no clue why their
  README says it does. I've verified it compiles without them.
* melonds secretly bundles in pre-compiled DS firmware in
  src/FreeBIOS.h. they do, however, provide source, but our buildscript
  shouldn't rely on bundled blobs.

I took the liberty of attaching an edited patch. hope that's alright!

- lilah

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

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index cde3ee052c..0f7962115d 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -21,6 +21,7 @@
 ;;; Copyright © 2023 Yovan Naumovski <yovan <at> gorski.stream>
 ;;; Copyright © 2023 Hendursaga <hendursaga <at> aol.com>
 ;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
+;;; Copyright © 2024 Altadil <altadil <at> 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")

base-commit: 21f5d20d68e0359f8111ccb936905649c70db9c1
-- 
2.41.0






Information forwarded to guix-patches <at> gnu.org:
bug#68469; Package guix-patches. (Tue, 28 May 2024 14:36:03 GMT) Full text and rfc822 format available.

Message #11 received at 68469 <at> debbugs.gnu.org (full text, mbox):

From: cesarbcr <cesarbcr <at> protonmail.com>
To: "68469 <at> debbugs.gnu.org" <68469 <at> debbugs.gnu.org>
Cc: "lilah <at> lunabee.space" <lilah <at> lunabee.space>
Subject: Re: [PATCH] gnu: Add melonds
Date: Tue, 28 May 2024 11:03:02 +0000
Hi,
thanks a lot for your help!
Really sorry to not have answered sooner (I wrongly assumed debbugs would send notifications to me, so didn’t check the thread).

It seems your level in packaging is far above mine, so I can’t comment on your improvement (except saying it’s impressive ^.^).
The only thing I can add is: you should add yourself to the copyright lines at the top (but anyone can do it for you, once we get feedback from a reviewer).

Thanks again!
Altadil




This bug report was last modified 1 year and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.