[PATCH] gnu: add citra (stable version)

  • Open
  • quality assurance status badge
Details
3 participants
  • florhizome
  • Liliana Marie Prikler
  • Liliana Marie Prikler
Owner
unassigned
Submitted by
florhizome
Severity
normal
F
F
florhizome wrote on 13 Oct 2022 16:59
(address . guix-patches@gnu.org)(name . florhizome)(address . florhizome@posteo.net)
a0c965b31ab5fa2735b02ed3102dde5c72165d5f.1665673001.git.florhizome@posteo.net
From: florhizome <florhizome@posteo.net>

This adds the citra emulator for nintendo 3ds games - the nightly repo marks the stable version. NixOs does some things for compatibility checks that we don't but it works fine so far. :)

---
gnu/packages/emulators.scm | 60 ++++++++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)

Toggle diff (100 lines)
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 38795b703c..3121a71484 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,66 @@ (define-public desmume
"DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
(license license:gpl2)))
+(define-public citra
+ (package
+ (name "citra")
+ (version "1785")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/citra-emu/citra-nightly")
+ (commit
+ (string-append "nightly-" version))
+ (recursive? #t)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1grkrrxs1497i51spgnwmgfkqgkm7gplylhcrk67agaklx65d5s9"))))
+ (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")
+ #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'delete-check
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ (("check_submodules_present\\(\\)")"")))))))
+ (native-inputs
+ (list pkg-config doxygen))
+ (inputs
+ (list qtbase-5 qtmultimedia-5 qttools-5
+ qtwayland libpng libxkbcommon
+ openssl
+ ffmpeg pulseaudio curl rapidjson
+ sdl2 libusb boost))
+ ;;gstreamer-plugins-bad needed for camera support
+ (propagated-inputs (list gst-plugins-bad xdg-utils shared-mime-info))
+ (home-page "https://citra-emu.org")
+ (synopsis "Nintendo 3DS Emulator")
+ (description "Citra is an experimental open-source Nintendo 3DS
+ emulator/debugger written in C++. It is written with portability in
+ mind, with builds actively maintained for Windows, Linux and macOS.
+ The \"nightly\" version marks the stable release.")
+ (license license:gpl3+)))
+
;; 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"))

base-commit: 86ec52f66735b122b9035eba56516fd16f3be958
prerequisite-patch-id: 253e1cc8278ab9981294f4e483c7b29a466672d9
--
2.38.0
L
L
Liliana Marie Prikler wrote on 17 Oct 2022 10:37
697c4dd0589e00f9be2ec09fd7f798326efb0c4f.camel@ist.tugraz.at
Am Donnerstag, dem 13.10.2022 um 14:59 +0000 schrieb
florhizome@posteo.net:
Toggle quote (5 lines)
> From: florhizome <florhizome@posteo.net>
>
> This adds the citra emulator for nintendo 3ds games - the nightly
> repo marks the stable version. NixOs does some things for
> compatibility checks that we don't but it works fine so far. :)
Missing ChangeLog. Title should be: "gnu: Add citra."

Toggle quote (1 lines)
> ---
Notes not meant for the commit log go below this line.

Toggle quote (41 lines)
>  gnu/packages/emulators.scm | 60
> ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 60 insertions(+)
>
> diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
> index 38795b703c..3121a71484 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,66 @@ (define-public desmume
>       "DeSmuME is an emulator for the Nintendo DS handheld gaming
> console.")
>      (license license:gpl2)))
>  
> +(define-public citra
> +  (package
> +    (name "citra")
> +    (version "1785")
I'd prefer a let-bound revision/commit pair, since this is very much
experimental software. Citra seems to be using a build version base of
"0" [cf. 1], so we can do the same.
Toggle quote (5 lines)
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/citra-emu/citra-nightly")
Even if using nightly revisions, I think we might want to prefer the
main repository.
Toggle quote (3 lines)
> +             (commit
> +              (string-append "nightly-" version))
> +             (recursive? #t)))
Recursive checkouts are discouraged. Wherefore do you need one?
Toggle quote (12 lines)
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32
> +         "1grkrrxs1497i51spgnwmgfkqgkm7gplylhcrk67agaklx65d5s9"))))
> +    (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"
Don't forget to actually unbundle all of the above.
Toggle quote (7 lines)
> +               "-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")
Don't enable features for the profit of proprietary software.
Toggle quote (1 lines)
> +       #:tests? #f
Why?
Toggle quote (17 lines)
> +       #:phases
> +       #~(modify-phases %standard-phases
> +           (add-before 'configure 'delete-check
> +             (lambda _
> +               (substitute* "CMakeLists.txt"
> +                 (("check_submodules_present\\(\\)")"")))))))
> +    (native-inputs
> +     (list pkg-config doxygen))
> +    (inputs
> +     (list qtbase-5 qtmultimedia-5 qttools-5
> +           qtwayland libpng libxkbcommon
> +           openssl
> +           ffmpeg pulseaudio curl rapidjson
> +           sdl2 libusb boost))
> +    ;;gstreamer-plugins-bad needed for camera support
> +    (propagated-inputs (list gst-plugins-bad xdg-utils shared-mime-
> info))
For the gst-plugins, check if you can isolate a minimum set of them.
Also, use wrappers rather than propagation.
Toggle quote (7 lines)
> +    (home-page "https://citra-emu.org")
> +    (synopsis "Nintendo 3DS Emulator")
> +    (description "Citra is an experimental open-source Nintendo 3DS
> + emulator/debugger written in C++.  It is written with portability
> in
> + mind, with builds actively maintained for Windows, Linux and macOS.
> + The \"nightly\" version marks the stable release.")
"Citra is an experimental emulator/debugger for the Nintendo 3DS
written in C++. It emulates a subset of the Nintendo 3DS' hardware."
Toggle quote (1 lines)
> +    (license license:gpl3+)))
L
L
Liliana Marie Prikler wrote on 21 Oct 2022 08:30
18dc275e4963d46187812c23dd0de83b5425aa91.camel@ist.tugraz.at
Hi,

Am Donnerstag, dem 20.10.2022 um 21:49 +0000 schrieb florhizome:
Toggle quote (20 lines)
> On 2022-10-17, 10:37 +0200, Liliana Marie Prikler
> <liliana.prikler@ist.tugraz.at> wrote:
> > I'd prefer a let-bound revision/commit pair, since this is very
> > much
> > experimental software.  Citra seems to be using a build version
> > base of
> > "0" [cf. 1], so we can do the same. 
> > > +    (source
> > > +     (origin
> > > +       (method git-fetch)
> > > +       (uri (git-reference
> > > +             (url "https://github.com/citra-emu/citra-nightly")
> > Even if using nightly revisions, I think we might want to prefer
> > the main repository.
>
> After reading their repo-policy
> The main repo is for development, the nightly one picks out stable
> features, the experimental/canary one adds more unstable ones. By
> going with "main" we basically skip any stability guarantees, that
> the devs are trying to give.
Okay, in that case it makes sense to use nightly.
Toggle quote (3 lines)
> For me personally, the version numbers are very helpful, since they
> make it easier to track dependency changes.
> The patch I am preparing will use 0 as main version, though.
Therefore I suggest (git-version "0" revision commit) where revision is
the nightly version number.

Toggle quote (18 lines)
> > Recursive checkouts are discouraged.  Wherefore do you need one?
> > > +       (file-name (git-file-name name version))
> > > +       (sha256
> > > +        (base32
> > > +        
> > > "1grkrrxs1497i51spgnwmgfkqgkm7gplylhcrk67agaklx65d5s9"))))
> > > +    (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"
> > Don't forget to actually unbundle all of the above.
>
> Actually ffmpeg and sdl are not bundled in our version,
> but later versions will bundle sdl again.
You could try something cheeky like 
(when (file-exists? "ffmpeg") (delete-recursively "ffmpeg"))
in the snippet with an appropriate comment.

Toggle quote (11 lines)
> > > +               "-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")
> > Don't enable features for the profit of proprietary software.
>
> As far as I understand, there are other programs, and free
> alternatives other then discord using its status protocol.
Which ones?

As far as I'm aware, XMPP is a completely free alternative to the
entire protocol ;)

Cheers
F
F
florhizome wrote on 20 Oct 2022 23:49
874jvymahw.fsf@posteo.net
Hi Liliana!
thx for the revision! I also have yuzu in the pipeline,
which is by the same/similar team, which makes this even more rewarding.
The next patch will remove all submodules that I was able to
remove. More could be done by replacing the rest under external/ with.
symlinks, I guess. Also, tests seem to work under x86, and using only
gst-plugins-bad-minimal in a wrapper seems to be enough to make the
camera work.
This leaves us with the repo/versioning and the discord issue.
On 2022-10-17, 10:37 +0200, Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> wrote:
Toggle quote (10 lines)
> I'd prefer a let-bound revision/commit pair, since this is very much
> experimental software. Citra seems to be using a build version base of
> "0" [cf. 1], so we can do the same.
>> +    (source
>> +     (origin
>> +       (method git-fetch)
>> +       (uri (git-reference
>> +             (url "https://github.com/citra-emu/citra-nightly")
> Even if using nightly revisions, I think we might want to prefer the
> main repository.
After reading their repo-policy
The main repo is for development, the nightly one picks out stable
features, the experimental/canary one adds more unstable ones. By going with
"main" we basically skip any stability guarantees, that the devs are trying
to give.
For me personally, the version numbers are very helpful, since they make it easier
to track dependency changes.
The patch I am preparing will use 0 as main version, though.
Toggle quote (14 lines)
> Recursive checkouts are discouraged. Wherefore do you need one?
>> +       (file-name (git-file-name name version))
>> +       (sha256
>> +        (base32
>> +         "1grkrrxs1497i51spgnwmgfkqgkm7gplylhcrk67agaklx65d5s9"))))
>> +    (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"
> Don't forget to actually unbundle all of the above.
Actually ffmpeg and sdl are not bundled in our version,
but later versions will bundle sdl again.
Toggle quote (8 lines)
>> +               "-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")
> Don't enable features for the profit of proprietary software.
As far as I understand, there are other programs, and free alternatives
other then discord using its status protocol.
Toggle quote (3 lines)
>> +    (license license:gpl3+)))
> Should be gpl2+.
>
To me it looks like gpl2 only, am I overlooking something?
Cheers, florhizome
F
F
florhizome wrote on 20 Oct 2022 23:55
[PATCH v2] gnu: Add citra
(address . 58499@debbugs.gnu.org)(name . florhizome)(address . florhizome@posteo.net)
ac9f5d3c6c36fc50e4fe796d154a36456da2f26e.1666302902.git.florhizome@posteo.net
From: florhizome <florhizome@posteo.net>

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

Toggle diff (142 lines)
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"))

base-commit: 00ff6f7c399670a76efffb91276dea2633cc130c
--
2.38.0
L
L
Liliana Marie Prikler wrote on 22 Oct 2022 19:29
2ef97487fd7ffa3c1519822483068acebac4855a.camel@gmail.com
Am Donnerstag, dem 20.10.2022 um 21:55 +0000 schrieb
florhizome@posteo.net:
Toggle quote (3 lines)
> From: florhizome <florhizome@posteo.net>
>
> * gnu: Add citra.
Missing ChangeLog.
Toggle quote (42 lines)
> ---
>  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.
Toggle quote (5 lines)
> +  (package
> +    (name "citra")
> +    (version (git-version version
> +                          (string-append "nightly-" revision)
> commit))
"nightly-" is not needed here.
Toggle quote (10 lines)
> +    (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?
Toggle quote (9 lines)
> +       (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.
Toggle quote (30 lines)
> +             (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.
Toggle quote (15 lines)
> +       #: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.
Toggle quote (19 lines)
> +    (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.
Toggle quote (1 lines)
> +    ;;gstreamer-plugins-bad-minimal needed for camera support
Use a line comment "; camera support".
Emacs adds proper distance with M-;
Toggle quote (8 lines)
> +    (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
F
F
Florian wrote on 1 Nov 2022 16:56
874jvik6sb.fsf@posteo.net
Toggle quote (21 lines)
>> +    (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.
Toggle quote (2 lines)
>> +         "-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.
F
F
florhizome wrote on 1 Nov 2022 18:58
[PATCH v3] gnu: Add citra
(address . 58499@debbugs.gnu.org)(name . florhizome)(address . florhizome@posteo.net)
b9344989ac3a6b9b2660c4d5a6f9a975c5e7759e.1667325314.git.florhizome@posteo.net
From: florhizome <florhizome@posteo.net>

* gnu/packages/emulators.scm (citra): New variable.
---
gnu/packages/emulators.scm | 100 +++++++++++++++++++++++++++++++++++++
1 file changed, 100 insertions(+)

Toggle diff (137 lines)
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 4d7710f8ea..3ea3bfe327 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,106 @@ (define-public desmume
"DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
(license license:gpl2)))
+(define-public citra
+ ;; we use the 'nightly' revision, picking stable features
+ (let ((revision "1785")
+ (commit "baecc18d8c5365af0dddb231bc8c0a9c03850bf6"))
+ (package
+ (name "citra")
+ (version (git-version "0" 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"
+ "discord-rpc"
+ "getopt"
+ "libyuv"
+ "libressl"
+ "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"
+ "-DCITRA_ENABLE_COMPATIBILITY_REPORTING=OFF"
+ "-DCMAKE_BUILD_TYPE=Release"
+ "-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF"
+ "-DENABLE_FFMPEG_AUDIO_DECODER=ON"
+ "-DENABLE_QT_TRANSLATION=ON"
+ "-DENABLE_WEB_SERVICE=ON")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'delete-check
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ (("check_submodules_present\\(\\)")""))))
+ (add-after 'qt-wrap 'wrap-gst-plugins
+ (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 catch2 doxygen pkg-config))
+ (inputs
+ (list boost
+ curl
+ ffmpeg
+ gst-plugins-bad-minimal ;camera-support
+ libfdk
+ libpng
+ libusb
+ libxkbcommon
+ openssl
+ pulseaudio
+ qtbase-5
+ qtmultimedia-5
+ qttools-5
+ qtwayland-5
+ sdl2))
+ (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"))
--
2.38.0
L
L
Liliana Marie Prikler wrote on 2 Nov 2022 09:04
48041a0b4689a15eb06e1061bc7b76afbefc4ea7.camel@gmail.com
Am Dienstag, dem 01.11.2022 um 17:58 +0000 schrieb
florhizome@posteo.net:
Toggle quote (45 lines)
> From: florhizome <florhizome@posteo.net>
>
> * gnu/packages/emulators.scm (citra): New variable.
> ---
>  gnu/packages/emulators.scm | 100
> +++++++++++++++++++++++++++++++++++++
>  1 file changed, 100 insertions(+)
>
> diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
> index 4d7710f8ea..3ea3bfe327 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,106 @@ (define-public desmume
>       "DeSmuME is an emulator for the Nintendo DS handheld gaming
> console.")
>      (license license:gpl2)))
>  
> +(define-public citra
> +  ;; we use the 'nightly' revision, picking stable features
> +  (let ((revision "1785")
> +        (commit "baecc18d8c5365af0dddb231bc8c0a9c03850bf6"))
Note that the latest citra revision is now 1802. Feel free to bump it
during review.
Toggle quote (13 lines)
> +  (package
> +    (name "citra")
> +    (version (git-version "0" 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)))
For those submodules that can't be avoided, the "unpack after unpack"
pattern is still preferable to recursive checkouts; the latter can pull
in new vendored modules sneakily.

For instance, the first package that fails the build because it's
missing is cryptopp [1]. They vendor version 8.5 while the latest is
8.7. I think packaging cryptopp and trying to unvendor it makes sense.
Even if not completely unvendored (i.e. we still pull in the source
instead of the built package, as is e.g. done for armips in ppsspp),
I'd prefer the origin to be explicit.
Toggle quote (39 lines)
> +       (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"
> +                         "discord-rpc"
> +                         "getopt"
> +                         "libyuv"
> +                         "libressl"
> +                         "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"
> +         "-DCITRA_ENABLE_COMPATIBILITY_REPORTING=OFF"
> +         "-DCMAKE_BUILD_TYPE=Release"
> +         "-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF"
> +         "-DENABLE_FFMPEG_AUDIO_DECODER=ON"
> +         "-DENABLE_QT_TRANSLATION=ON"
> +         "-DENABLE_WEB_SERVICE=ON")
The web service should be disabled, we don't let our software phone
home.
Toggle quote (6 lines)
> +       #:phases
> +       #~(modify-phases %standard-phases
> +           (add-before 'configure 'delete-check
> +             (lambda _
> +               (substitute* "CMakeLists.txt"
> +                 (("check_submodules_present\\(\\)")""))))
Instead of 'delete-check, I'd name this 'patch-cmake. 'delete-check
implies that we're disabling checks, which we don't.
Toggle quote (27 lines)
> +           (add-after 'qt-wrap 'wrap-gst-plugins
> +             (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 catch2 doxygen pkg-config))
> +    (inputs
> +     (list boost
> +           curl
> +           ffmpeg
> +           gst-plugins-bad-minimal      ;camera-support
> +           libfdk
> +           libpng
> +           libusb
> +           libxkbcommon
> +           openssl
> +           pulseaudio
> +           qtbase-5
> +           qtmultimedia-5
> +           qttools-5
> +           qtwayland-5
> +           sdl2))
There seem to be more missing inputs, for instance json-modern-cxx
which has nlohmann::json (somewhat related, I do think that it's a
silly package name and we should rename it for searchability's sake).
Toggle quote (5 lines)
> +    (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
I'd write out "and" instead of the slash.
Toggle quote (5 lines)
> + written in C++.  It emulates a subset of the Nintendo 3DS'
> hardware.")
> +    (license license:gpl2+))))
> +
> +
Gratuitous newline.
Toggle quote (5 lines)
>  ;; 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/.
> +
Gratuitous newline.
Toggle quote (4 lines)
>  (define-public dolphin-emu
>    (let ((commit "a34823df61df65168aa40ef5e82e44defd4a0138")
>          (revision "13178"))

?