GNU bug report logs - #75693
[PATCH v3 02/11] gnu: dolphin-emu: Unbundle more libraries and enable tests.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Mon, 20 Jan 2025 14:31:03 UTC

Severity: normal

Tags: notabug, patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75693 in the body.
You can then email your comments to 75693 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to adam.faiz <at> disroot.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org:
bug#75693; Package guix-patches. (Mon, 20 Jan 2025 14:31:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to adam.faiz <at> disroot.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org. (Mon, 20 Jan 2025 14:31:04 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v3 02/11] gnu: dolphin-emu: Unbundle more libraries and enable
 tests.
Date: Mon, 20 Jan 2025 23:28:24 +0900
* gnu/packages/emulators.scm (dolphin-emu)
[source] <snippet>: 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 53225f3aab..ebe4601304 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -15,7 +15,7 @@
 ;;; Copyright © 2020 Christopher Howard <christopher <at> librehacker.com>
 ;;; Copyright © 2021 Felipe Balbi <balbi <at> kernel.org>
 ;;; Copyright © 2021, 2024 Felix Gruber <felgru <at> posteo.net>
-;;; Copyright © 2021, 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2021, 2024, 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2023 c4droid <c4droid <at> foxmail.com>
 ;;; Copyright © 2023 Yovan Naumovski <yovan <at> gorski.stream>
@@ -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
-- 
2.47.1





Added tag(s) notabug. Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 23 Jan 2025 12:13:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 75693 <at> debbugs.gnu.org and Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 23 Jan 2025 12:13:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 20 Feb 2025 12:24:21 GMT) Full text and rfc822 format available.

This bug report was last modified 21 days ago.

Previous Next


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