From patchwork Fri Jan 17 04:45:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37097 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9D6FC27BBE9; Fri, 17 Jan 2025 04:47:36 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C2B2727BBE2 for ; Fri, 17 Jan 2025 04:47:35 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYeGC-0005Ja-OJ; Thu, 16 Jan 2025 23:47:08 -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 ) id 1tYeGA-0005J1-7h for guix-patches@gnu.org; Thu, 16 Jan 2025 23:47:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYeG8-0004zA-7h for guix-patches@gnu.org; Thu, 16 Jan 2025 23:47:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=T5RsxWDs8q5GrbfpoFm97GWxQ7oUsUa2lgitQKyJiGY=; b=cmAYxPEwyUKys8l9v/X8JE5ZS9GN1G3fbxtk/X+gh0Kn/a7o30N7q9DxIx3Poz10rd2eP89d/B+nlQOEYeWt+3WjjRSDE7UoOWCzi8cOPqDuFi7mA+yP29bNZDMBECnCKp6dT+iUWUsfNezAYHqJpcyV2Hre3riPbwBTl5wgfPkfTwFWp1OEREb4b74xy9nb+xuVzfnSvlx/pQeBGtsTuOjdCxO+YPfG31K99aLycDsKoxOlVSvbSGvstzYmMkUcJRBUrmyPNyjUZjmsdpRusHzGiXuqFAj3RHTx4zvOUhkgc2xdUsjkwImZr3E/xc6Mk2pi1RAkq4UGvJai92D/fQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tYeG7-0001Sh-5m; Thu, 16 Jan 2025 23:47:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75619] [PATCH 3/7] gnu: dolphin-emu: Build .bin binary files and preserve data ones. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: adam.faiz@disroot.org, liliana.prikler@gmail.com, iyzsong@envs.net, guix-patches@gnu.org Resent-Date: Fri, 17 Jan 2025 04:47:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75619 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75619@debbugs.gnu.org Cc: Maxim Cournoyer , Adam Faiz , Liliana Marie Prikler , =?utf-8?b?5a6L5paH5q2m?= X-Debbugs-Original-Xcc: Adam Faiz , Liliana Marie Prikler , =?utf-8?b?5a6L5paH5q2m?= Received: via spool by 75619-submit@debbugs.gnu.org id=B75619.17370892135569 (code B ref 75619); Fri, 17 Jan 2025 04:47:03 +0000 Received: (at 75619) by debbugs.gnu.org; 17 Jan 2025 04:46:53 +0000 Received: from localhost ([127.0.0.1]:35600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tYeFw-0001Rl-EE for submit@debbugs.gnu.org; Thu, 16 Jan 2025 23:46:52 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:49322) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tYeFu-0001RL-00 for 75619@debbugs.gnu.org; Thu, 16 Jan 2025 23:46:50 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21634338cfdso41888735ad.2 for <75619@debbugs.gnu.org>; Thu, 16 Jan 2025 20:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737089203; x=1737694003; darn=debbugs.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=T5RsxWDs8q5GrbfpoFm97GWxQ7oUsUa2lgitQKyJiGY=; b=d1eRLFhUfyHlB9aKstlFE0vteUQZsRukppB/WhyNPSSnlcJYqgya1ms46IC6htRam2 e8wp4zfdlSUFdjsxRE6T5oGpqsPOu44ebpxYtL2sNsA0xuXbaS9m7Vn9r636sgP0XkM3 46p0Jt2/D+0mmpYZX7U4EkJOH9HJGuPhjVT54yulZMHYb4qd1csFEdFuwYpWnGhrBT50 IHqQqw8UXA3DDF9mq9md2BNaMjNpGpo7ddgyMf8XgGIA/c6cVJ3YZwBDumiWB01O9UFJ 1NH2veSis6/lRwAfQwn9WbD/hBM1zyAbG9NJ91shD+DUxnMntVTf/cegGtbTwMC7MAFy pbFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737089203; x=1737694003; 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=T5RsxWDs8q5GrbfpoFm97GWxQ7oUsUa2lgitQKyJiGY=; b=mdW6gwqsuTrmaKi0DHqYqzlS0Re6O/pDe7/jY8N/Xo45BHtuBwRd4MeUw99NPP95xP t4fkO4vgIyb2RxK8pQnBzcdPQR73VMKURV/ko5bwfoj7duXxi0/1UXQj+E755Lh4OpzV syBu8JRIQ4EwIdSdiv+48q6f0OIEMrOXQNvOqZYjOPSNtn3RBWf3fUxlMEKdMRq3MzKn C0PNxJUANQqoQQ468PthVjeKuDDuW0IvY91aYBh/1f1xlUgHQRZNdvIPTpm+CfmI/NN5 oKGD9pl8G+D6p8wroCjTwE4UOazJt3pNHSrs3rtpM+Sru5EztcdsQZ1GXrZKboNZWktM iivw== X-Gm-Message-State: AOJu0YwCv0YTzajQ5dWLdd7NojIN/+dwC89ypT/m6+av6GV5ltGoLZH3 Cf+r24PhVNyTaTyVTGU9sGFNcZxmLpdvs+EjGzmAbCFn3tQ2sDDWoEt4p3gZ X-Gm-Gg: ASbGncvCUve501I6CqkeIGbUkkk1U47yToIjnWKDDRUTpkT9oUKM/BCJ1x1ZFLWzF4G GwmLfCX9Ee0JWRXMOUJ0AJkC+3QEtgidnffMdzMeFfyBJno3XcyZYPvUE0/0g6DA2Nk3SYcT6+n XtOtIRca7sTxERS34DxNlpWSrXFNfOzFZDXzkiW7oJn5fhqY/sjr6eRELVt1Y+fy+/k/N96Ms3D z8VbEqm+ZAEqd9gkVqNIeQi03WrbfZHJM35IoE1iCoitDfcx1chVJSgj0fgEKb8P/+wmTbR1PQ= X-Google-Smtp-Source: AGHT+IHVRqhrNcwKvG6v7QyfZ0Nvnsi17OJSrayTQ4LvdS5vUE/eeOrKZZ4GDe2zw9T/hqLgLmlKfA== X-Received: by 2002:a05:6a20:244f:b0:1e1:9fef:e960 with SMTP id adf61e73a8af0-1eb214650d6mr1961257637.6.1737089202904; Thu, 16 Jan 2025 20:46:42 -0800 (PST) Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-a9bdf57de17sm863935a12.77.2025.01.16.20.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 20:46:42 -0800 (PST) From: Maxim Cournoyer Date: Fri, 17 Jan 2025 13:45:53 +0900 Message-ID: <87b75e47d4fc308896e1ab8e86bd58cd049ab97f.1737083128.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches These files are necessary to save games, enable cheat codes, etc. * gnu/packages/emulators.scm (dolphin-emu) [source] : 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] : 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 6f77329f27..2486485805 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