From f1833eb828326705e2ff5693f05b1b5fd4b0de33 Mon Sep 17 00:00:00 2001 From: Rutger Helling Date: Wed, 21 Feb 2018 10:35:44 +0100 Subject: [PATCH 2/2] gnu: Add dolphin-emu. * gnu/packages/games.scm (dolphin-emu): New variable. --- gnu/packages/games.scm | 132 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 131 insertions(+), 1 deletion(-) diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 0ac7d992c..eaab55cee 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 John Darrington ;;; Copyright © 2013 Nikita Karetnikov -;;; Copyright © 2014, 2015, 2016 David Thompson +;;; Copyright © 2014, 2015, 2016, 2018 David Thompson ;;; Copyright © 2014, 2015, 2016, 2017 Eric Bavier ;;; Copyright © 2014 Cyrill Schenkel ;;; Copyright © 2014 Sylvain Beucler @@ -89,6 +89,7 @@ #:use-module (gnu packages libcanberra) #:use-module (gnu packages libedit) #:use-module (gnu packages libunwind) + #:use-module (gnu packages libusb) #:use-module (gnu packages haskell) #:use-module (gnu packages mp3) #:use-module (gnu packages music) @@ -113,6 +114,7 @@ #:use-module (gnu packages fontutils) #:use-module (gnu packages gstreamer) #:use-module (gnu packages bash) + #:use-module (gnu packages digest) #:use-module (gnu packages perl) #:use-module (gnu packages qt) #:use-module (gnu packages compression) @@ -5767,3 +5769,131 @@ Strife, Chex Quest, and fan-created games like Harmony, Hacx and Freedoom.") (license:non-copyleft ; modified dumb "file://dumb/licence.txt" "Dumb license, explicitly GPL compatible."))))) + +;; Building from recent Git because the official 5.0 release no longer builds. +(define-public dolphin-emu + (let ((commit "d04b179111f8d863f360839474cb82c766f762b8") + (revision "0")) + (package + (name "dolphin-emu") + (version (git-version "5.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dolphin-emu/dolphin.git") + (commit commit))) + (file-name (git-file-name name version)) + (modules '((guix build utils))) + (snippet + '(begin + (for-each delete-file-recursively + ; Remove external stuff we don't need. + '("Externals/LZO" + "Externals/OpenAL" + "Externals/Qt" + "Externals/SFML" + "Externals/SOIL" + "Externals/curl" + "Externals/ffmpeg" + "Externals/gettext" + "Externals/hidapi" + "Externals/libpng" + "Externals/libusb" + "Externals/mbedtls" + "Externals/miniupnpc" + "Externals/wxWidgets3" + "Externals/zlib")) + #t)) + (sha256 + (base32 + "0g725wmhlim73zrhi47wmr1bmplpy4b7sbimd5pm8xpfhj5nm10l")))) + (build-system cmake-build-system) + (arguments + '(#:tests? #f + ;; The FindGTK2 cmake script only checks hardcoded directories for + ;; glib/gtk headers. + + #:phases + (modify-phases %standard-phases + (add-before 'configure 'remove-more-binaries&generate-fonts + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((fontfile + (string-append (assoc-ref inputs "font-wqy-microhei") + "/share/fonts/truetype/wqy-microhei.ttc"))) + (for-each delete-file (find-files "." "\\.bin$")) + (for-each delete-file (find-files "." "\\.dsy$")) + (for-each delete-file (find-files "." "\\.exe$")) + (for-each delete-file (find-files "." "\\.jar$")) + (for-each delete-file (find-files "." "\\.pdf$")) + (for-each delete-file (find-files "." "\\.rar$")) + (chdir "docs") + (invoke "bash" "-c" "g++ -O2 -std=c++11 $(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 "..") + #t)))) + + #:configure-flags + (list (string-append "-DGTK2_GDKCONFIG_INCLUDE_DIR=" + (assoc-ref %build-inputs "gtk+") + "/lib/gtk-2.0/include") + (string-append "-DGTK2_GLIBCONFIG_INCLUDE_DIR=" + (assoc-ref %build-inputs "glib") + "/lib/glib-2.0/include") + (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"))) + ; TODO: Make Vulkan backend work. + (native-inputs + `(("pkg-config" ,pkg-config) + ("gettext" ,gnu-gettext))) + (inputs + `(("alsa-lib" ,alsa-lib) + ("ao" ,ao) + ("bluez" ,bluez) + ("curl" ,curl) + ("eudev" ,eudev) + ("ffmpeg" ,ffmpeg) + ("font-wqy-microhei" ,font-wqy-microhei) + ("freetype" ,freetype) + ("glew" ,glew) + ("glib" ,glib) + ("glu" ,glu) + ("gtk+" ,gtk+-2) + ("hidapi" ,hidapi) + ("libevdev" ,libevdev) + ("libpng" ,libpng) + ("libusb" ,libusb) + ("libx11" ,libx11) + ("libxi" ,libxi) + ("libxrandr" ,libxrandr) + ("lzo" ,lzo) + ("mbedtls-apache" ,mbedtls-apache) + ("mesa" ,mesa) + ("miniupnpc" ,miniupnpc) + ("openal" ,openal) + ("pulseaudio" ,pulseaudio) + ("qtbase" ,qtbase) + ("sdl2" ,sdl2) + ("sfml" ,sfml) + ("soil" ,soil) + ("soundtouch" ,soundtouch) + ("wxwidgets" ,wxwidgets-gtk2-3.1) + ("zlib" ,zlib))) + (home-page "https://dolphin-emu.org/") + (synopsis "Nintendo Wii and GameCube emulator") + (description + "Dolphin is an emulator for two Nintendo video game consoles: the +GameCube and the Wii. It provides compatibility with all PC controllers, +turbo speed, networked multiplayer, and graphical enhancements.") + (supported-systems '("x86_64-linux")) ; TODO: should also work on ARM64. + ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0. + (license (list license:gpl2+ license:asl2.0))))) -- 2.16.2