diff mbox series

[bug#58499] gnu: add citra (stable version)

Message ID a0c965b31ab5fa2735b02ed3102dde5c72165d5f.1665673001.git.florhizome@posteo.net
State New
Headers show
Series [bug#58499] gnu: add citra (stable version) | 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. 13, 2022, 2:59 p.m. UTC
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(+)


base-commit: 86ec52f66735b122b9035eba56516fd16f3be958
prerequisite-patch-id: 253e1cc8278ab9981294f4e483c7b29a466672d9

Comments

Liliana Marie Prikler Oct. 17, 2022, 8:37 a.m. UTC | #1
Am Donnerstag, dem 13.10.2022 um 14:59 +0000 schrieb
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. :)
Missing ChangeLog.  Title should be: "gnu: Add citra."

> ---
Notes not meant for the commit log go below this line.

>  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.  
> +    (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.
> +             (commit
> +              (string-append "nightly-" version))
> +             (recursive? #t)))
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.
> +               "-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.
> +       #:tests? #f
Why?
> +       #: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.
> +    (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."
> +    (license license:gpl3+)))
Should be gpl2+.


Cheers

[1]
https://github.com/citra-emu/citra/blob/47c4f31c8db86b043a1802a65f1df08aeec8e772/CMakeModules/GenerateSCMRev.cmake#L22
florhizome Oct. 20, 2022, 9:49 p.m. UTC | #2
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:
> 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.

> 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.


>> +               "-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. 

>> +    (license license:gpl3+)))
> Should be gpl2+.
>
To me it looks like gpl2 only, am I overlooking something?


Cheers, florhizome
Liliana Marie Prikler Oct. 21, 2022, 6:30 a.m. UTC | #3
Hi,

Am Donnerstag, dem 20.10.2022 um 21:49 +0000 schrieb florhizome:
> 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.
> 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.

> > 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.

> > > +               "-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
diff mbox series

Patch

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"))