GNU bug report logs - #75694
[PATCH v3 03/11] gnu: dolphin-emu: Build .bin binary files and preserve data ones.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Maxim Cournoyer <maxim.cournoyer@HIDDEN>; Keywords: patch notabug; Done: Maxim Cournoyer <maxim.cournoyer@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.
bug closed, send any further explanations to 75694 <at> debbugs.gnu.org and Maxim Cournoyer <maxim.cournoyer@HIDDEN> Request was from Maxim Cournoyer <maxim.cournoyer@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) notabug. Request was from Maxim Cournoyer <maxim.cournoyer@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Jan 2025 14:30:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 09:30:47 2025
Received: from localhost ([127.0.0.1]:49513 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tZsne-0007CM-3S
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 09:30:47 -0500
Received: from lists.gnu.org ([2001:470:142::17]:45790)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>)
 id 1tZsnV-0007BF-RG
 for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 09:30:39 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <maxim.cournoyer@HIDDEN>)
 id 1tZsnQ-0007OQ-Ga
 for guix-patches@HIDDEN; Mon, 20 Jan 2025 09:30:32 -0500
Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <maxim.cournoyer@HIDDEN>)
 id 1tZsnO-0004wB-Nx
 for guix-patches@HIDDEN; Mon, 20 Jan 2025 09:30:32 -0500
Received: by mail-pl1-x635.google.com with SMTP id
 d9443c01a7336-21631789fcdso67564785ad.1
 for <guix-patches@HIDDEN>; Mon, 20 Jan 2025 06:30:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1737383429; x=1737988229; darn=gnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=Qhs7g3BO+NEIwSjxu17wcOHvOJKVSQvYmbtjRKH9Ps4=;
 b=a+K5h77UGKaeqs3sXskh4ZjZX2/y3nsySinSBaW0C8puDddLOk8PRzIb1hpGFKUjwj
 9zulEgqtTWiPNn2xlMcy9grEB56I3Zgf8Oy8PnfiDt360VdwQq4GEbpx1R3lMOwHP728
 DD+8q14RtzvyrkRUy+jRZrtJofsXTBgy2yuoJ1Mm98uc+hB5RVvLXd64NsTtX6jtBiYW
 s4onm3EShItGep3+4UTJqjxywWTH8q2BDhQhuA3lfgrslFeVJc/Vy6AORITwMcaPLcVi
 4KL6xfqy141nCYpzie069MWlFaUDNhkh0gwEhXAa1B6NvSB1IoU97IS9yCtlHqdaX2P4
 rxhA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737383429; x=1737988229;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=Qhs7g3BO+NEIwSjxu17wcOHvOJKVSQvYmbtjRKH9Ps4=;
 b=jwifVoX84sUJ+M3Xv6EpoKEG8jX9zXnqKwGR4qy/Hwck01niMSEVRdVTyPA3vszaFJ
 i3C1W1/G8ig4DbtMStT1CxjYAeQIBINCb5l6iK/FcjcM7IqNfIUQ4fgA5zZ3UTf4vEW+
 2KNfP9CTfll+WH0wduwUtJQVMklwLrpnhrzgCeQo/Tp/EJZw7Mk7ifehUTYTOQUmMEa5
 N8nCORiDFGy5lYKTvtLCKIcY6PAiMZWgUNFYUTONWVISLRmrNwObB2CIerXeD9WteI2t
 e5PdHuYT6DNvukkPIvahcS9C2c/7z5ve0yonH69dTJ8YGG3eAnoIDJurTCohH6la+3Lb
 kqxQ==
X-Gm-Message-State: AOJu0YxCIACv7/cZRBJ+PMRzBBSoSD7mwr0UPU41N/2r7RdQUYSVL/00
 Jba8a0Y065EmL9i/hTURoVnvPyUmZPIyGyWxS0UyPUGBo5zd4rpHtx2ljaqk
X-Gm-Gg: ASbGncv5eGKUhdIiFEdLUL4k/I++E4vHbWcUIChUS3GCT5mFCt1a5uVQcZYHbtpSPPX
 V1WwkaSTngqSqh3Ac8S4GXBj/9yMEPVXa2Go31tWPrCWoMUwpepoMdLVWifk0gkRiO6pIXHW1vx
 vqgol1fSwQCes959U5xRKhTp4ubhi1WKz0pa5+b2bYmzsbBcqS/9DfQ4i6Ke7W/+ZzRfKXXJQrI
 aT7l+X3agzZfvqcL3FEZgdtmuiQunGNOGL1ZrzUKpM0ane/zjBWpunPsXksiTomuxOyxh/aMvzG
 3Ms06rYJY8nX
X-Google-Smtp-Source: AGHT+IGVc1wY/5gP9mAU9Z7zjNbA7Dq8AU35Bcom3L3AlA5ucwAxNiA25bWhU5R+u20mjuK34D9PmA==
X-Received: by 2002:a05:6a20:7f9f:b0:1e1:a920:225d with SMTP id
 adf61e73a8af0-1eb2174b1f4mr18105504637.19.1737383428628; 
 Mon, 20 Jan 2025 06:30:28 -0800 (PST)
Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-72dab9c8d2bsm7396313b3a.92.2025.01.20.06.30.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jan 2025 06:30:28 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH v3 03/11] gnu: dolphin-emu: Build .bin binary files and
 preserve data ones.
Date: Mon, 20 Jan 2025 23:28:25 +0900
Message-ID: <98ff956042580475a5e439ed6825ed7df7a9b282.1737383313.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <7a983f303aba15d35ec687bcba4de4fee572899b.1737383313.git.maxim.cournoyer@HIDDEN>
References: <7a983f303aba15d35ec687bcba4de4fee572899b.1737383313.git.maxim.cournoyer@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Adam Faiz <adam.faiz@HIDDEN>, Liliana Marie Prikler <liliana.prikler@HIDDEN>, 宋文武 <iyzsong@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::635;
 envelope-from=maxim.cournoyer@HIDDEN; helo=mail-pl1-x635.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

These files are necessary to save games, enable cheat codes, etc.

* gnu/packages/emulators.scm (dolphin-emu) [source] <snippet>: Refine to avoid
deleting a few .bin which are not executable objects but rather configuration
files samples.
[phases]: Add build-codeloader.bin, build-dsp_rom.bin and build-dsp_coefs.bin
phases.
[arguments] <configure-flags>: Add -DDSPTOOL=ON.
[native-inputs]: Add a cross-compiler for powerpc.  Add python-minimal and
python-numpy.

Change-Id: Ida8df1add940e1708c557223409d854aa995e8a5
---
 gnu/packages/emulators.scm | 50 ++++++++++++++++++++++++++++++++++----
 1 file changed, 45 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index ebe4601304..52c59b3965 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -98,6 +98,7 @@ (define-module (gnu packages emulators)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages sphinx)
@@ -289,7 +290,8 @@ (define-public dolphin-emu
          (file-name (git-file-name name version))
          (sha256
           (base32 "1p8qsxlabgmz3nic0a9ghh9d3lzl5f8i3kmdrrvx6w8kdlp33018"))
-         (modules '((guix build utils)))
+         (modules '((guix build utils)
+                    (ice-9 regex)))
          (snippet
           '(begin
              ;; Remove external stuff we don't need.
@@ -317,9 +319,19 @@ (define-public dolphin-emu
                          "miniupnpc" "minizip" "MoltenVK" "pugixml"
                          "soundtouch"
                          "xxhash" "zlib" "zstd"))
-             ;; Clean up source.
+             ;; Clean up the source.
              (for-each delete-file
-                       (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
+                       (find-files
+                        "."
+                        (lambda (file _)
+                          (and (string-match "\\.(bin|dsy|exe|jar|rar)$" file)
+                               ;; Preserve the important wc24 .bin
+                               ;; configuration *data* files.
+                               (not (member (basename file)
+                                            '("misc.bin"
+                                              "nwc24dl.bin"
+                                              "nwc24fl.bin"
+                                              "nwc24fls.bin")))))))
              ;; Do not attempt to include now-missing directories.
              (substitute* "CMakeLists.txt"
                ((".*add_subdirectory.*Externals/enet.*") "")
@@ -371,7 +383,30 @@ (define-public dolphin-emu
                                     "FileSystemTest"
                                     "PowerPCTest"
                                     "VertexLoaderTest")
-                                  "|")))))))
+                                  "|"))))))
+            (add-before 'install 'build-codeloader.bin
+              (lambda _
+                (with-directory-excursion "../source/docs"
+                  ;; The following command-line is adapted from the example in
+                  ;; codehandler.s.
+                  (invoke "powerpc-linux-gnu-gcc" "-mpowerpc" "-mbig"
+                          "codehandler.s" "-nostartfiles" "-nodefaultlibs"
+                          "-nostdlib" "-T" "codehandler.ld"
+                          "-o" "codehandler.bin")
+                  (copy-file "codehandler.bin" "../Data/Sys/codehandler.bin"))))
+            (add-before 'install 'build-dsp_rom.bin
+              (lambda _
+                ;; Ensure dsptool is on PATH.
+                (setenv "PATH" (string-append (getenv "PATH") ":"
+                                              (getcwd) "/Binaries"))
+                (with-directory-excursion "../source"
+                  (invoke "dsptool" "-o" "Data/Sys/GC/dsp_rom.bin"
+                          "docs/DSP/free_dsp_rom/dsp_rom.ds"))))
+            (add-before 'install 'build-dsp_coefs.bin
+              (lambda _
+                (with-directory-excursion "../source"
+                  (invoke "python3" "docs/DSP/free_dsp_rom/generate_coefs.py")
+                  (rename-file "dsp_coef.bin" "Data/Sys/GC/dsp_coef.bin")))))
         ;; The FindGTK2 cmake script only checks hardcoded directories for
         ;; glib/gtk headers.  Also add some include directories via the CXX
         ;; flags to let GCC find some headers not actively searched by the
@@ -380,6 +415,7 @@ (define-public dolphin-emu
         #~(list (string-append "-DCMAKE_CXX_FLAGS="
                                "-I" (search-input-directory
                                      %build-inputs "include/soundtouch"))
+                "-DDSPTOOL=ON"
                 (string-append "-DX11_INCLUDE_DIR="
                                #$(this-package-input "libx11")
                                "/include")
@@ -389,7 +425,11 @@ (define-public dolphin-emu
                 "-DX11_FOUND=1")
         #:test-target "unittests"))
       (native-inputs
-       (list gettext-minimal pkg-config))
+       (list (cross-gcc "powerpc-linux-gnu")
+             gettext-minimal
+             pkg-config
+             python-minimal
+             python-numpy))
       (inputs
        (list alsa-lib
              ao
-- 
2.47.1





Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer@HIDDEN>:
New bug report received and forwarded. Copy sent to adam.faiz@HIDDEN, liliana.prikler@HIDDEN, iyzsong@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to adam.faiz@HIDDEN, liliana.prikler@HIDDEN, iyzsong@HIDDEN, guix-patches@HIDDEN:
bug#75694; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 23 Jan 2025 12:15:01 UTC

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