diff mbox series

[bug#58499,v2] gnu: Add citra

Message ID ac9f5d3c6c36fc50e4fe796d154a36456da2f26e.1666302902.git.florhizome@posteo.net
State New
Headers show
Series [bug#58499,v2] gnu: Add citra | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

florhizome Oct. 20, 2022, 9:55 p.m. UTC
From: florhizome <florhizome@posteo.net>

* gnu: Add citra. 
---
 gnu/packages/emulators.scm | 103 +++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)


base-commit: 00ff6f7c399670a76efffb91276dea2633cc130c

Comments

Liliana Marie Prikler Oct. 22, 2022, 5:29 p.m. UTC | #1
Am Donnerstag, dem 20.10.2022 um 21:55 +0000 schrieb
florhizome@posteo.net:
> From: florhizome <florhizome@posteo.net>
> 
> * gnu: Add citra. 
Missing ChangeLog.
> ---
>  gnu/packages/emulators.scm | 103
> +++++++++++++++++++++++++++++++++++++
>  1 file changed, 103 insertions(+)
> 
> diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
> index 4d7710f8ea..be4e10bb9c 100644
> --- a/gnu/packages/emulators.scm
> +++ b/gnu/packages/emulators.scm
> @@ -61,6 +61,7 @@ (define-module (gnu packages emulators)
>    #:use-module (gnu packages cross-base)
>    #:use-module (gnu packages curl)
>    #:use-module (gnu packages digest)
> +  #:use-module (gnu packages documentation)
>    #:use-module (gnu packages elf)
>    #:use-module (gnu packages flex)
>    #:use-module (gnu packages fltk)
> @@ -74,6 +75,7 @@ (define-module (gnu packages emulators)
>    #:use-module (gnu packages gl)
>    #:use-module (gnu packages glib)
>    #:use-module (gnu packages gnome)
> +  #:use-module (gnu packages gstreamer)
>    #:use-module (gnu packages gtk)
>    #:use-module (gnu packages image)
>    #:use-module (gnu packages libedit)
> @@ -105,6 +107,7 @@ (define-module (gnu packages emulators)
>    #:use-module (gnu packages xorg)
>    #:use-module (gnu packages web)
>    #:use-module (guix build-system cmake)
> +  #:use-module (guix build-system qt)
>    #:use-module (guix build-system glib-or-gtk)
>    #:use-module (guix build-system gnu)
>    #:use-module (guix build-system meson)
> @@ -245,9 +248,109 @@ (define-public desmume
>       "DeSmuME is an emulator for the Nintendo DS handheld gaming
> console.")
>      (license license:gpl2)))
>  
> +(define-public citra
> +  (let ((version "0")
> +        (revision "1785")
> +        (commit "baecc18d8c5365af0dddb231bc8c0a9c03850bf6"))
You don't need to let-bind version.  Add a comment next to revision
explaining that we mean nightly revisions.
> +  (package
> +    (name "citra")
> +    (version (git-version version
> +                          (string-append "nightly-" revision)
> commit))
"nightly-" is not needed here.
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/citra-emu/citra-nightly")
> +             (commit
> +              (string-append "nightly-" revision))
> +             ;;some submodules can't be avoided
> +             ;;TODO devendor the rest
> +             (recursive? #t)))
Why not?
> +       (sha256
> +        (base32
> +         "1grkrrxs1497i51spgnwmgfkqgkm7gplylhcrk67agaklx65d5s9"))
> +       (file-name (git-file-name name version))
> +       (modules '((guix build utils)))
> +         (snippet
> +          '(begin
> +             ;; Remove as much external stuff as we can
> +             ;; f.e. some files in boost are still needed
We have a boost package.
> +             (for-each (lambda (dir)
> +                         (delete-file-recursively
> +                          (string-append "externals/" dir)))
> +                       '("android-ifaddrs"
> +                         "catch"
> +                         "libyuv"
> +                         "libressl"
> +                         "getopt"
> +                         "libusb"))
> +             ;; Clean up source.
> +             (for-each delete-file
> +                       (find-files "."
> ".*\\.(bin|dsy|exe|jar|rar)$"))
> +             #t))))
> +    (build-system qt-build-system)
> +    (arguments
> +     (list
> +      #:configure-flags
> +      #~(list
> +         "-DUSE_SYSTEM_BOOST=ON"
> +         "-DCITRA_USE_BUNDLED_FFMPEG=OFF"
> +         "-DCITRA_USE_BUNDLED_QT=OFF"
> +         "-DCITRA_USE_BUNDLED_SDL2=OFF"
> +         "-DCMAKE_BUILD_TYPE=Release"
> +         "-DCITRA_ENABLE_COMPATIBILITY_REPORTING=OFF"
> +         "-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF"
> +         "-DENABLE_QT_TRANSLATION=ON"
> +         "-DENABLE_WEB_SERVICE=ON"
> +         "-DENABLE_FFMPEG_AUDIO_DECODER=ON"
> +         "-DUSE_DISCORD_PRESENCE=ON")
Again, no cookies for proprietary software.
> +       #:phases
> +       #~(modify-phases %standard-phases
> +           (add-before 'configure 'delete-check
> +             (lambda _
> +               (substitute* "CMakeLists.txt"
> +                 (("check_submodules_present\\(\\)")""))))
> +           (add-after 'qt-wrap 'wrap-other-dependencies
> +             (lambda* (#:key outputs #:allow-other-keys)
> +               (for-each
> +                (lambda (bin)
> +                  (wrap-program bin)
> +                  `("GST_PLUGIN_SYSTEM_PATH" prefix
> +                    (,(getenv "GST_PLUGIN_SYSTEM_PATH"))))
> +                `(,(search-input-file outputs "bin/citra")
> +                  ,(search-input-file outputs "bin/citra-qt"))))))))
You can use find-files here and it'll probably be more natural.
> +    (native-inputs
> +     (list pkg-config doxygen catch2))
> +    (inputs
> +     (list qtbase-5
> +           qtmultimedia-5
> +           qttools-5
> +           qtwayland-5
> +           libpng
> +           libxkbcommon
> +           openssl
> +           libfdk
> +           ffmpeg
> +           pulseaudio
> +           curl
> +           rapidjson
> +           sdl2
> +           libusb
> +           boost
> +           gst-plugins-bad-minimal))
Inputs are best sorted.
> +    ;;gstreamer-plugins-bad-minimal needed for camera support
Use a line comment "; camera support".
Emacs adds proper distance with M-; 
> +    (propagated-inputs (list xdg-utils shared-mime-info))
> +    (home-page "https://citra-emu.org")
> +    (synopsis "Nintendo 3DS Emulator")
> +    (description "Citra is an experimental emulator/debugger for the
> Nintendo 3DS
> + written in C++.  It emulates a subset of the Nintendo 3DS'
> hardware.")
> +    (license license:gpl2+))))
Cheers
florhizome Nov. 1, 2022, 3:56 p.m. UTC | #2
>> +    (source
>> +     (origin
>> +       (method git-fetch)
>> +       (uri (git-reference
>> +             (url "https://github.com/citra-emu/citra-nightly")
>> +             (commit
>> +              (string-append "nightly-" revision))
>> +             ;;some submodules can't be avoided
>> +             ;;TODO devendor the rest
>> +             (recursive? #t)))
> Why not?
>> +       (sha256
>> +        (base32
>> +         "1grkrrxs1497i51spgnwmgfkqgkm7gplylhcrk67agaklx65d5s9"))
>> +       (file-name (git-file-name name version))
>> +       (modules '((guix build utils)))
>> +         (snippet
>> +          '(begin
>> +             ;; Remove as much external stuff as we can
>> +             ;; f.e. some files in boost are still needed
> We have a boost package.

What I mean by avoid: the rest of submodules we would need to replace in
place (which I mean by devendor). I have tried to add a build
phase doing so, but wasn't successful by now. It will be a
huge amount of work added anyways, which would take me a bigger amount
of time.
For some reason disabling the bundled version of boost still seems to
leave some links to the bundled boost in the build, so when I remove it,
the build fails. 

>> +         "-DUSE_DISCORD_PRESENCE=ON")
> Again, no cookies for proprietary software.

I don't see use to discuss this as I would like to get to get this done
and I don't need it.
v3 coming soon, I hope i get the changelog right this time...
Cheers.
diff mbox series

Patch

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 4d7710f8ea..be4e10bb9c 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -61,6 +61,7 @@  (define-module (gnu packages emulators)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages digest)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fltk)
@@ -74,6 +75,7 @@  (define-module (gnu packages emulators)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages libedit)
@@ -105,6 +107,7 @@  (define-module (gnu packages emulators)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages web)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system qt)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
@@ -245,9 +248,109 @@  (define-public desmume
      "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
     (license license:gpl2)))
 
+(define-public citra
+  (let ((version "0")
+        (revision "1785")
+        (commit "baecc18d8c5365af0dddb231bc8c0a9c03850bf6"))
+  (package
+    (name "citra")
+    (version (git-version version
+                          (string-append "nightly-" revision) commit))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/citra-emu/citra-nightly")
+             (commit
+              (string-append "nightly-" revision))
+             ;;some submodules can't be avoided
+             ;;TODO devendor the rest
+             (recursive? #t)))
+       (sha256
+        (base32
+         "1grkrrxs1497i51spgnwmgfkqgkm7gplylhcrk67agaklx65d5s9"))
+       (file-name (git-file-name name version))
+       (modules '((guix build utils)))
+         (snippet
+          '(begin
+             ;; Remove as much external stuff as we can
+             ;; f.e. some files in boost are still needed
+             (for-each (lambda (dir)
+                         (delete-file-recursively
+                          (string-append "externals/" dir)))
+                       '("android-ifaddrs"
+                         "catch"
+                         "libyuv"
+                         "libressl"
+                         "getopt"
+                         "libusb"))
+             ;; Clean up source.
+             (for-each delete-file
+                       (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
+             #t))))
+    (build-system qt-build-system)
+    (arguments
+     (list
+      #:configure-flags
+      #~(list
+         "-DUSE_SYSTEM_BOOST=ON"
+         "-DCITRA_USE_BUNDLED_FFMPEG=OFF"
+         "-DCITRA_USE_BUNDLED_QT=OFF"
+         "-DCITRA_USE_BUNDLED_SDL2=OFF"
+         "-DCMAKE_BUILD_TYPE=Release"
+         "-DCITRA_ENABLE_COMPATIBILITY_REPORTING=OFF"
+         "-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF"
+         "-DENABLE_QT_TRANSLATION=ON"
+         "-DENABLE_WEB_SERVICE=ON"
+         "-DENABLE_FFMPEG_AUDIO_DECODER=ON"
+         "-DUSE_DISCORD_PRESENCE=ON")
+       #:phases
+       #~(modify-phases %standard-phases
+           (add-before 'configure 'delete-check
+             (lambda _
+               (substitute* "CMakeLists.txt"
+                 (("check_submodules_present\\(\\)")""))))
+           (add-after 'qt-wrap 'wrap-other-dependencies
+             (lambda* (#:key outputs #:allow-other-keys)
+               (for-each
+                (lambda (bin)
+                  (wrap-program bin)
+                  `("GST_PLUGIN_SYSTEM_PATH" prefix
+                    (,(getenv "GST_PLUGIN_SYSTEM_PATH"))))
+                `(,(search-input-file outputs "bin/citra")
+                  ,(search-input-file outputs "bin/citra-qt"))))))))
+    (native-inputs
+     (list pkg-config doxygen catch2))
+    (inputs
+     (list qtbase-5
+           qtmultimedia-5
+           qttools-5
+           qtwayland-5
+           libpng
+           libxkbcommon
+           openssl
+           libfdk
+           ffmpeg
+           pulseaudio
+           curl
+           rapidjson
+           sdl2
+           libusb
+           boost
+           gst-plugins-bad-minimal))
+    ;;gstreamer-plugins-bad-minimal needed for camera support
+    (propagated-inputs (list xdg-utils shared-mime-info))
+    (home-page "https://citra-emu.org")
+    (synopsis "Nintendo 3DS Emulator")
+    (description "Citra is an experimental emulator/debugger for the Nintendo 3DS
+ written in C++.  It emulates a subset of the Nintendo 3DS' hardware.")
+    (license license:gpl2+))))
+
+
 ;; Building from recent Git because the official 5.0 release no longer builds.
 ;; Following commits and revision numbers of beta versions listed at
 ;; https://dolphin-emu.org/download/.
+
 (define-public dolphin-emu
   (let ((commit "a34823df61df65168aa40ef5e82e44defd4a0138")
         (revision "13178"))