mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: dolphin-emu: Unbundle more libraries and enable tests.
* 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. Reviewed-by: Sou Bunnbu (宋文武) <iyzsong@member.fsf.org> Change-Id: Id996d992674f9efbbb2eb562286447a388716a82
This commit is contained in:
parent
9ad90f5491
commit
cb36e3d0ae
1 changed files with 100 additions and 42 deletions
|
@ -15,7 +15,7 @@
|
||||||
;;; Copyright © 2020 Christopher Howard <christopher@librehacker.com>
|
;;; Copyright © 2020 Christopher Howard <christopher@librehacker.com>
|
||||||
;;; Copyright © 2021 Felipe Balbi <balbi@kernel.org>
|
;;; Copyright © 2021 Felipe Balbi <balbi@kernel.org>
|
||||||
;;; Copyright © 2021, 2024 Felix Gruber <felgru@posteo.net>
|
;;; Copyright © 2021, 2024 Felix Gruber <felgru@posteo.net>
|
||||||
;;; Copyright © 2021, 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
;;; Copyright © 2021, 2024, 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
|
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
|
||||||
;;; Copyright © 2023 c4droid <c4droid@foxmail.com>
|
;;; Copyright © 2023 c4droid <c4droid@foxmail.com>
|
||||||
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
|
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
|
||||||
|
@ -95,6 +95,7 @@
|
||||||
#:use-module (gnu packages ncurses)
|
#:use-module (gnu packages ncurses)
|
||||||
#:use-module (gnu packages networking)
|
#:use-module (gnu packages networking)
|
||||||
#:use-module (gnu packages pkg-config)
|
#:use-module (gnu packages pkg-config)
|
||||||
|
#:use-module (gnu packages pretty-print)
|
||||||
#:use-module (gnu packages pulseaudio)
|
#:use-module (gnu packages pulseaudio)
|
||||||
#:use-module (gnu packages python)
|
#:use-module (gnu packages python)
|
||||||
#:use-module (gnu packages python-build)
|
#:use-module (gnu packages python-build)
|
||||||
|
@ -296,19 +297,50 @@ console.")
|
||||||
(for-each (lambda (dir)
|
(for-each (lambda (dir)
|
||||||
(delete-file-recursively
|
(delete-file-recursively
|
||||||
(string-append "Externals/" dir)))
|
(string-append "Externals/" dir)))
|
||||||
'("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
|
'("LZO" "OpenAL" "Qt" "SFML" "bzip2"
|
||||||
"gettext" "hidapi" "libpng" "libusb" "mbedtls"
|
;; XXX: Attempting to use the vulkan-headers package
|
||||||
"miniupnpc" "MoltenVK" "zlib"))
|
;; 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.
|
;; Clean up source.
|
||||||
(for-each delete-file
|
(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)
|
(build-system cmake-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:tests? #f
|
(list
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-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
|
(add-before 'configure 'generate-fonts&hardcore-libvulkan-path
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
(let ((fontfile
|
(let ((fontfile
|
||||||
(search-input-file inputs
|
(search-input-file inputs
|
||||||
"/share/fonts/truetype/wqy-microhei.ttc"))
|
"/share/fonts/truetype/wqy-microhei.ttc"))
|
||||||
|
@ -325,28 +357,51 @@ console.")
|
||||||
(substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
|
(substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
|
||||||
(("\"vulkan\", 1") (string-append "\"vulkan\""))
|
(("\"vulkan\", 1") (string-append "\"vulkan\""))
|
||||||
(("\"vulkan\"") (string-append "\"" libvulkan "\""))
|
(("\"vulkan\"") (string-append "\"" libvulkan "\""))
|
||||||
(("Common::DynamicLibrary::GetVersionedFilename") ""))))))
|
(("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
|
;; The FindGTK2 cmake script only checks hardcoded directories for
|
||||||
;; glib/gtk headers.
|
;; 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
|
#:configure-flags
|
||||||
(list (string-append "-DX11_INCLUDE_DIR="
|
#~(list (string-append "-DCMAKE_CXX_FLAGS="
|
||||||
(assoc-ref %build-inputs "libx11")
|
"-I" (search-input-directory
|
||||||
|
%build-inputs "include/soundtouch"))
|
||||||
|
(string-append "-DX11_INCLUDE_DIR="
|
||||||
|
#$(this-package-input "libx11")
|
||||||
"/include")
|
"/include")
|
||||||
(string-append "-DX11_LIBRARIES="
|
(string-append "-DX11_LIBRARIES="
|
||||||
(assoc-ref %build-inputs "libx11")
|
(search-input-file %build-inputs
|
||||||
"/lib/libX11.so")
|
"lib/libX11.so"))
|
||||||
"-DX11_FOUND=1")))
|
"-DX11_FOUND=1")
|
||||||
|
#:test-target "unittests"))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list gettext-minimal pkg-config))
|
(list gettext-minimal pkg-config))
|
||||||
(inputs
|
(inputs
|
||||||
(list alsa-lib
|
(list alsa-lib
|
||||||
ao
|
ao
|
||||||
bluez
|
bluez
|
||||||
|
bzip2
|
||||||
|
cubeb
|
||||||
curl
|
curl
|
||||||
|
enet
|
||||||
eudev
|
eudev
|
||||||
ffmpeg-4
|
ffmpeg-4
|
||||||
|
fmt-7
|
||||||
font-wqy-microhei
|
font-wqy-microhei
|
||||||
freetype
|
freetype
|
||||||
glew
|
glew
|
||||||
|
@ -364,6 +419,7 @@ console.")
|
||||||
mbedtls-lts
|
mbedtls-lts
|
||||||
mesa
|
mesa
|
||||||
miniupnpc
|
miniupnpc
|
||||||
|
minizip-ng
|
||||||
openal
|
openal
|
||||||
pugixml
|
pugixml
|
||||||
pulseaudio
|
pulseaudio
|
||||||
|
@ -371,9 +427,11 @@ console.")
|
||||||
sdl2
|
sdl2
|
||||||
sfml
|
sfml
|
||||||
soil
|
soil
|
||||||
soundtouch
|
soundtouch-1/integer-samples
|
||||||
vulkan-loader
|
vulkan-loader
|
||||||
zlib))
|
xxhash
|
||||||
|
zlib
|
||||||
|
`(,zstd "lib")))
|
||||||
(home-page "https://dolphin-emu.org/")
|
(home-page "https://dolphin-emu.org/")
|
||||||
(synopsis "Nintendo Wii and GameCube emulator")
|
(synopsis "Nintendo Wii and GameCube emulator")
|
||||||
(description
|
(description
|
||||||
|
@ -381,7 +439,7 @@ console.")
|
||||||
GameCube and the Wii. It provides compatibility with all PC controllers,
|
GameCube and the Wii. It provides compatibility with all PC controllers,
|
||||||
turbo speed, networked multiplayer, and graphical enhancements.")
|
turbo speed, networked multiplayer, and graphical enhancements.")
|
||||||
(supported-systems '("x86_64-linux" "aarch64-linux"))
|
(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+)))))
|
(license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
|
||||||
|
|
||||||
(define-public dosbox
|
(define-public dosbox
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue