From patchwork Sat Jan 18 08:50:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37137 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 2C8D327BBEA; Sat, 18 Jan 2025 08:52:48 +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=ham 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 5DE6327BBE2 for ; Sat, 18 Jan 2025 08:52:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tZ4Yt-0003On-4Q; Sat, 18 Jan 2025 03:52:11 -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-0003NJ-Jh 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 1tZ4Ym-0007cr-Ao for guix-patches@gnu.org; Sat, 18 Jan 2025 03:52:04 -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=TU0K7RMdntPDF45tCth/xpeHqW9nJog/J1/Rljq2UVE=; b=MGoABYhAgcamy9MIecAsN4/PHXwdckObC1FWPbpNu/2L+bWZyb4J9iBQPnxSr2VEX+/YNO+C+nHyDlepWC5z8f5dtx/n+sW8uho4drRJL/nSbNIGyhKhIerqmtzuXDZcRs+hRcrug7A0q5rWxDUqCR8I2/36qZdRM3CdXvt5ObBTAj+NFRO0S3noSbjgQbmvV7xvjdbBWfMBGIsNk500jPVpe4fM56lwlo/01/9A97g2gZAwpohjeWuDswis8uct4k2Dc0GoMFrrBZemgy9z3aQVXHLGYEz2upQbAadrnwMqhMDWI4Eqi4rEVHRNrX47LVoFTB4b3ksgqqydzy+XCA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tZ4Yk-00088F-EE; Sat, 18 Jan 2025 03:52:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75619] [PATCH v2 02/10] gnu: dolphin-emu: Unbundle more libraries and enable tests. 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.173719029231133 (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]:40040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tZ4YF-00085y-2B for submit@debbugs.gnu.org; Sat, 18 Jan 2025 03:51:31 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:56829) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tZ4Y7-00085E-RK for 75619@debbugs.gnu.org; Sat, 18 Jan 2025 03:51:25 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2166360285dso57902075ad.1 for <75619@debbugs.gnu.org>; Sat, 18 Jan 2025 00:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737190277; x=1737795077; 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=TU0K7RMdntPDF45tCth/xpeHqW9nJog/J1/Rljq2UVE=; b=cZjVrRyaMdleKa7Ekuce9F6HhpO9cHdiIeInVbwkC9A1LvtLdFOnb+s+zFWtLchy7/ PA0p1VYuIfUaPtV7l0CEEPGvIK6GX26Z0olH6JUTJvTyrLHR90QaV+CzQYXQgpJN7ApU v2RaIxH3H1OywTUNtQa7uFFjopjF6oyvitYCPysuEBjg8KO0Nflx7fqgpZsd9w9GUYr/ 8HKL97Jh1P1/L7Enzjyzp0WVnwSWA1xGOT6vLR6IqXrys2M3R8WlhLrjG0TTPwx4xjrK CKGCS7IcFWRIZDQSOm5i1TQc4L2D02J2OGvMcyMN0f7yBjmOsQ2AT7B5WVh3vuXLSJOS 9SSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737190277; x=1737795077; 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=TU0K7RMdntPDF45tCth/xpeHqW9nJog/J1/Rljq2UVE=; b=lU7PltHv8B6KKMp1HPb3H+nEloyZexFPUUkmAWc0GZmC2YVvbGobLKEzfLQid/1cqN aY46xhTsAONY0i2W6Fn1q2KChGl4iv26KsLU7tU/p6kZxMeJ0CpEOLC/09nzVnYtJxLm qzU8o3eZMdvF5U1xhOr3xCExdVQQtM4aOLkUvRDk6Oxq+DgkcYc84aoKYopb0KDJX9ts DkBzjLPc80dwhtOVoeBQb0rqOm/NbBjE4qzJ0xTOLL7/ym7HgyavyntEoP3eg/4Af4rX ZzNU4xmHa//T9UgqXp06BFfB9c+zrAJv+RHvbefycNYFeIT3JgQy9VosVaS9GJW8V7a4 e49Q== X-Gm-Message-State: AOJu0YyWFnutrked4ZXQb2HKQyUc1gHSwutlcUTHh19IasvWJ+1BnvTI 1LiUd20IgSz9i6o2KpqAqYVGmyHeaKTIWg0XbyOkLK+xaUMVeLCo1QOdA2JX2bQ= X-Gm-Gg: ASbGncuuob8VzvkUbZT52bpS2gqgBRXBwDSm3A7E5RT/ROE8BJytuYieiW7PzzUrZSy yb8x94zJKqMB7t046oOYfTaBWTqTEBjApPBbxRk3NSf/heIyfUllO23F3LkN/5332oiGnb4fzkN SEWNnN8BrmBvFQOr/40gX1QVVM3GfKFZb0GfrYrNXoY6RoLGgilOTM7/p13HIhhA9d+AvfkD2Fz K66zxjYrSp9Sl6yxazezLGb9FuMKhNbooQpCnTQ7fmss5IOm6jz7IS7D2ZwBMQFMBgwHojpLhZM IhB5UAcU27mk X-Google-Smtp-Source: AGHT+IHw/sacXXsArbH3tR3bdUdiokb5Znc7n+G3T6G1DCYNBDbVGjU7i+QGdJZFPUzWpepLhoHoEg== X-Received: by 2002:a17:903:32cb:b0:215:54a1:8584 with SMTP id d9443c01a7336-21c35503ae9mr87236905ad.17.1737190276572; Sat, 18 Jan 2025 00:51:16 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jan 2025 00:51:16 -0800 (PST) From: Maxim Cournoyer Date: Sat, 18 Jan 2025 17:50:46 +0900 Message-ID: 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 * gnu/packages/emulators.scm (dolphin-emu) [source] : Delete bzip2, cubeb, enet, fmt, pugixml, soundtouch, xxhash and zstd sources and de-register enet, soundtouch and xxhash from the build system. [arguments] <#:tests?>: Delete argument. <#:phases>: Add remove-unittests-target-post-build-command and post-check phases. <#:configure-flags>: Specify CMAKE_CXX_FLAGS to locate soundtouch headers. <#:test-target>: New argument. [inputs]: Add bzip2, cubeb, enet, fmt-7, minizip-ng, xxhash and zstd:lib. Replace soundtouch with soundtouch-1/integer-samples. Change-Id: Id996d992674f9efbbb2eb562286447a388716a82 --- gnu/packages/emulators.scm | 142 ++++++++++++++++++++++++++----------- 1 file changed, 100 insertions(+), 42 deletions(-) diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm index 9e2d6485dd..6f77329f27 100644 --- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm @@ -15,7 +15,7 @@ ;;; Copyright © 2020 Christopher Howard ;;; Copyright © 2021 Felipe Balbi ;;; Copyright © 2021, 2024 Felix Gruber -;;; Copyright © 2021, 2024 Maxim Cournoyer +;;; Copyright © 2021, 2024, 2025 Maxim Cournoyer ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2023 c4droid ;;; Copyright © 2023 Yovan Naumovski @@ -94,6 +94,7 @@ (define-module (gnu packages emulators) #:use-module (gnu packages ncurses) #:use-module (gnu packages networking) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages pretty-print) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) #:use-module (gnu packages python-build) @@ -294,58 +295,112 @@ (define-public dolphin-emu ;; Remove external stuff we don't need. (for-each (lambda (dir) (delete-file-recursively - (string-append "Externals/" dir))) - '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg" - "gettext" "hidapi" "libpng" "libusb" "mbedtls" - "miniupnpc" "MoltenVK" "zlib")) + (string-append "Externals/" dir))) + '("LZO" "OpenAL" "Qt" "SFML" "bzip2" + ;; XXX: Attempting to use the vulkan-headers package + ;; results in "error: + ;; ‘VK_PRESENT_MODE_RANGE_SIZE_KHR’ was not declared + ;; in this scope". + ;;"Vulkan" + "cubeb" "curl" "enet" + "ffmpeg" "fmt" "gettext" + ;; XXX: Attempting to use an unbundled glslang at the + ;; exact commit used by Dolphin still results in + ;; "error: ‘DefaultTBuiltInResource’ is not a member + ;; of ‘glslang’". + ;;"glslang" + ;; XXX: Googletest cannot currently easily be + ;; unbundled, as there are missing linking + ;; directives. + ;;"gtest" + "hidapi" "libpng" "libusb" "mbedtls" + "miniupnpc" "minizip" "MoltenVK" "pugixml" + "soundtouch" + "xxhash" "zlib" "zstd")) ;; Clean up source. (for-each delete-file - (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$")))))) + (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$")) + ;; Do not attempt to include now-missing directories. + (substitute* "CMakeLists.txt" + ((".*add_subdirectory.*Externals/enet.*") "") + ((".*add_subdirectory.*Externals/soundtouch.*") "") + ((".*add_subdirectory.*Externals/xxhash.*") "")))))) (build-system cmake-build-system) (arguments - '(#:tests? #f - #:phases - (modify-phases %standard-phases - (add-before 'configure 'generate-fonts&hardcore-libvulkan-path - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((fontfile - (search-input-file inputs - "/share/fonts/truetype/wqy-microhei.ttc")) - (libvulkan - (search-input-file inputs "/lib/libvulkan.so"))) - (chdir "docs") - (invoke "bash" "-c" "g++ -O2 $(freetype-config \ + (list + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'remove-unittests-target-post-build-command + (lambda _ + ;; To skip a few problematic tests, CTest will be manually + ;; invoked in the post-check phase. + (with-directory-excursion "Source/UnitTests" + (substitute* "CMakeLists.txt" + (("add_custom_command\\(TARGET unittests POST_BUILD.*") + ""))))) + (add-before 'configure 'generate-fonts&hardcore-libvulkan-path + (lambda* (#:key inputs #:allow-other-keys) + (let ((fontfile + (search-input-file inputs + "/share/fonts/truetype/wqy-microhei.ttc")) + (libvulkan + (search-input-file inputs "/lib/libvulkan.so"))) + (chdir "docs") + (invoke "bash" "-c" "g++ -O2 $(freetype-config \ --cflags --libs) gc-font-tool.cpp -o gc-font-tool") - (invoke "./gc-font-tool" "a" fontfile "font_western.bin") - (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin") - (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin") - (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin") - (chdir "..") - (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp" - (("\"vulkan\", 1") (string-append "\"vulkan\"")) - (("\"vulkan\"") (string-append "\"" libvulkan "\"")) - (("Common::DynamicLibrary::GetVersionedFilename") "")))))) - - ;; The FindGTK2 cmake script only checks hardcoded directories for - ;; glib/gtk headers. - - #:configure-flags - (list (string-append "-DX11_INCLUDE_DIR=" - (assoc-ref %build-inputs "libx11") - "/include") - (string-append "-DX11_LIBRARIES=" - (assoc-ref %build-inputs "libx11") - "/lib/libX11.so") - "-DX11_FOUND=1"))) + (invoke "./gc-font-tool" "a" fontfile "font_western.bin") + (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin") + (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin") + (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin") + (chdir "..") + (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp" + (("\"vulkan\", 1") (string-append "\"vulkan\"")) + (("\"vulkan\"") (string-append "\"" libvulkan "\"")) + (("Common::DynamicLibrary::GetVersionedFilename") ""))))) + (add-after 'check 'post-check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "Source/UnitTests" + (invoke "ctest" "-V" "--output-on-failure" + ;; These tests fail due to libusb failing to + ;; init inside the build container. + "-E" (string-join + '("MMIOTest" + "PageFaultTest" + "CoreTimingTest" + "FileSystemTest" + "PowerPCTest" + "VertexLoaderTest") + "|"))))))) + ;; 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 + ;; build system. + #:configure-flags + #~(list (string-append "-DCMAKE_CXX_FLAGS=" + "-I" (search-input-directory + %build-inputs "include/soundtouch")) + (string-append "-DX11_INCLUDE_DIR=" + #$(this-package-input "libx11") + "/include") + (string-append "-DX11_LIBRARIES=" + (search-input-file %build-inputs + "lib/libX11.so")) + "-DX11_FOUND=1") + #:test-target "unittests")) (native-inputs (list gettext-minimal pkg-config)) (inputs (list alsa-lib ao bluez + bzip2 + cubeb curl + enet eudev ffmpeg-4 + fmt-7 font-wqy-microhei freetype glew @@ -363,6 +418,7 @@ (define-public dolphin-emu mbedtls-lts mesa miniupnpc + minizip-ng openal pugixml pulseaudio @@ -370,9 +426,11 @@ (define-public dolphin-emu sdl2 sfml soil - soundtouch + soundtouch-1/integer-samples vulkan-loader - zlib)) + xxhash + zlib + `(,zstd "lib"))) (home-page "https://dolphin-emu.org/") (synopsis "Nintendo Wii and GameCube emulator") (description @@ -380,7 +438,7 @@ (define-public dolphin-emu GameCube and the Wii. It provides compatibility with all PC controllers, turbo speed, networked multiplayer, and graphical enhancements.") (supported-systems '("x86_64-linux" "aarch64-linux")) - ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0. + ;; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0. (license (list license:gpl2+ license:asl2.0 license:fdl1.2+))))) (define-public dosbox