From patchwork Sat Jan 18 08:50:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37134 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 8951527BBE2; Sat, 18 Jan 2025 08:52:31 +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 65F7927BBED for ; Sat, 18 Jan 2025 08:52:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tZ4Yn-0003Nq-8Z; Sat, 18 Jan 2025 03:52:05 -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 1tZ4Ym-0003N9-1D for guix-patches@gnu.org; Sat, 18 Jan 2025 03:52:04 -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 1tZ4Yl-0007ch-Km for guix-patches@gnu.org; Sat, 18 Jan 2025 03:52:03 -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=HB9GebcY/FwBl3TPKcXAKSmU8gOsTa+fWssUIiiNlOzFmkZ1HkPnAyLuRmYFCtdOOAAnGr0IUBgX3BQapoHpfjqMvV0Yc1dfy8i3JIn1p6q4LH1YZqYaocydlTmC5cYkms2lM8UYI1NrcSt2mn0da/ooxvhVAtVwt+kDKuayEWYgdiuuILIE6E5NaBmc0EFFaBgD6RO3NjOxF3T7pod7uWpOjgRcaTlrFR0KtRQut92KSdQd5ce1L3eaptk7JKOfQaIT1w3peAxVO3PquHxTgbAz0TBJTCpZkhhIP7o8ipsVhknNYuL3c3J2w2SG0H0hhbOC6zTryDRhE6MuZYrdHg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tZ4Yk-00088O-TO; Sat, 18 Jan 2025 03:52:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75619] [PATCH v2 03/10] 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: Sat, 18 Jan 2025 08:52:02 +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.173719029231141 (code B ref 75619); Sat, 18 Jan 2025 08:52:02 +0000 Received: (at 75619) by debbugs.gnu.org; 18 Jan 2025 08:51:32 +0000 Received: from localhost ([127.0.0.1]:40042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tZ4YG-00086B-0n for submit@debbugs.gnu.org; Sat, 18 Jan 2025 03:51:32 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:48567) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tZ4Y9-00085I-PU for 75619@debbugs.gnu.org; Sat, 18 Jan 2025 03:51:27 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-21bc1512a63so57895695ad.1 for <75619@debbugs.gnu.org>; Sat, 18 Jan 2025 00:51:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737190279; x=1737795079; 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=dDuvrTdQrdIyc9U9vG8VJtV1RlWEr7qtr7bcrmOkrFJpw+qkzWrZXWugNT6e4B5Lke pqLlf95zBQFrY2KBgWvexsoJhvY+4uSxIFOAJmqvCSXCe8HbOjVJj8etUZwofSyNDCCj 545NK08zqTGmxoag8KsAaU6RFaW8OQAZCNGFz/ioIOElz7SG1qgEWOO2SHPWfl4Ab1au scIVHdFy9UMtyQiR+MksHkhzCQiwZLwoqq3tkz/Nxr/avHqB4JskfCOKXW4yAGCc//SC NtG1zhx51mdJbaQiqIqSdG3VWjuII2w4bd+V94WhMUdBidfx5Iy36gqBU3hmar5tceCj UQuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737190279; x=1737795079; 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=bjVYWznNdPLfx3RqTVPGR9HICJqR/snieHZnDWm0PJkNcQ4cVLoR5dP2H5Gtemqmil boR0RTwwk9zeYaJRGKF5djfl3T43v7VFy/ktpqEX69mcWHU8cxkOCYP9ivKoWUNVacG+ 9fL374o/62UjCA0rtCilKyoXaUJ2ecNVL8rpl/oNZZmy49Yacta3hRn3WbcTPCjvlMG1 Va/x+IgQ3Ql2W03++o26wK7w2hdTGSQt5CJWhp5/zSuOlnaQIGdRcKER5IRa0/nJxqxN i8sm/fwvufe98IjHNJGo3vOoTenhRmDoqWFZ/jYrvWGi+QD8qaDuQu+9jNm9wviCKjfb /PdA== X-Gm-Message-State: AOJu0YyElN8eJ99Pdp0m5nWf9xHvheThSIRLUPqFKhuiqHTFVS1sDPYQ l9MR9/4cnonqJgmbFQTwukDF8I5sW6KcGi9Xgk5iHGtWyPjqV28ZoLXZtAkfjto= X-Gm-Gg: ASbGncvA6AT0uCcPrzeL9fqqK99JTL8w3CwxgRLZ5QpnBPszrA/sOvG7Ff0gzFt7gQ1 0sE1mu5hGFjDlcA+4vFB/O/cQpOGFZiI+p8wZ2TS0Tu1OQYZeckq4Ha0lyqpEJH3Bqno4R3K0WI am5bFqEOTWGrUL2DYcS5GDa3sYrx7LgU+v9rRinLbs8e2UxqB0+lgHhdaW92O0WwSVLZVr5jyEm qkUOcmOpfr06aezH6xNO33onxfMgfFrFPlnEFY1RqghkTtGhet2iRYEiuowk6zuuwFLb57NgGW5 reHxcXE9o+qS X-Google-Smtp-Source: AGHT+IFLiJ6CG4AZp4k48wao4NtEJ+mrxP4DjEEPV0l7keJ41Mxc1Y5LJzSuLJMTxjqCon2atX7FXg== X-Received: by 2002:a17:902:f644:b0:215:8d29:af2d with SMTP id d9443c01a7336-21c3563060amr100888715ad.38.1737190278690; Sat, 18 Jan 2025 00:51:18 -0800 (PST) Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d401344sm27610225ad.205.2025.01.18.00.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jan 2025 00:51:18 -0800 (PST) From: Maxim Cournoyer Date: Sat, 18 Jan 2025 17:50:47 +0900 Message-ID: <87b75e47d4fc308896e1ab8e86bd58cd049ab97f.1737190254.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <035ad50ab4e122c87225bd43e423fb17c75578e1.1737190254.git.maxim.cournoyer@gmail.com> References: <035ad50ab4e122c87225bd43e423fb17c75578e1.1737190254.git.maxim.cournoyer@gmail.com> 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