diff mbox series

[bug#59851] Add Moonlight

Message ID RgzlT6EkYv29_6-nDwzgii-eatP9OURzDVFm124uxVtqFhcPqHKXjnvqaHCLA_WOi520VarFzwZrI35mAk5oAi10IW3-w4PdjABUwOXbCpg=@protonmail.com
State New
Headers show
Series [bug#59851] Add Moonlight | expand

Commit Message

phodina Jan. 17, 2023, 8:07 a.m. UTC
Hi Maxim,

thanks for review. Here are the patches with the fixes.

----
Petr

Comments

Maxim Cournoyer Jan. 17, 2023, 4:29 p.m. UTC | #1
Hi Petr,

phodina <phodina@protonmail.com> writes:

> From a923f2a2e49a0a9851e43aec325fbaee1ee8b4cb Mon Sep 17 00:00:00 2001
> From: Petr Hodina <phodina@protonmail.com>
> Date: Mon, 5 Dec 2022 16:19:08 +0100
> Subject: [PATCH v2 5/6] gnu: Add sdl-gamecontrollerdb.
>
> * gnu/packages/sdl.scm (sdl-gamecontrollerdb): New variable.

Apologies, it looks like I forgot to review that one in the original
submission.

> diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
> index 0c419dfaca..90c04c98d9 100644
> --- a/gnu/packages/sdl.scm
> +++ b/gnu/packages/sdl.scm
> @@ -14,6 +14,7 @@
>  ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
>  ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
>  ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
> +;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -41,6 +42,7 @@ (define-module (gnu packages sdl)
>    #:use-module (guix download)
>    #:use-module (guix git-download)
>    #:use-module (guix utils)
> +  #:use-module (guix build-system copy)
>    #:use-module (guix build-system gnu)
>    #:use-module (guix build-system trivial)
>    #:use-module (gnu packages audio)
> @@ -199,6 +201,29 @@ (define-public libmikmod
>      (license license:lgpl2.1)
>      (home-page "http://mikmod.sourceforge.net/")))
>  
> +(define-public sdl-gamecontrollerdb
> +  (let ((commit "9bd061ec6282cd9f8ee0eff36112d98096183a82")
> +        (revision "1"))
> +    (package
> +      (name "sdl-gamecontrollerdb")
> +      (version "")
                  ^
Oops! :-)

> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "https://github.com/gabomdq/SDL_GameControllerDB")
> +                      (commit commit)))
> +                (sha256
> +                 (base32
> +                  "1dzch3c39n1kq8m5h8fpi7aqqv6k5jqwmlyagsh6fmyzwjviqgji"))))
> +      (build-system copy-build-system)
> +      (arguments
> +       '(#:install-plan '(("gamecontrollerdb.txt" "gamecontrollerdb.txt"))))
> +      (synopsis "Database of game controller mappings to be used with SDL2
> +	Game Controller")
> +      (description "")

                      ^
The synopsis and description need to be reworked here.

Otherwise, LGTM.
Maxim Cournoyer Jan. 17, 2023, 4:35 p.m. UTC | #2
Hi Petr,

phodina <phodina@protonmail.com> writes:

> From a18528bd178c177f50e73de4b89ccbf758ab1774 Mon Sep 17 00:00:00 2001
> From: Petr Hodina <phodina@protonmail.com>
> Date: Sat, 3 Dec 2022 10:36:38 +0100
> Subject: [PATCH v2 6/6] gnu: Add moonlight-qt.
>
> * gnu/packages/games.scm (moonlight-qt): New variable.
>
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index 5f5bd8795e..6600c1ee60 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -5841,6 +5841,66 @@ (define-public bambam
>  colors, pictures, and sounds.")
>      (license license:gpl3+)))
>  
> +(define-public moonlight-qt
> +  (package
> +    (name "moonlight-qt")
> +    (version "3.1.4")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/moonlight-stream/moonlight-qt")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "02y2rbiiawhj1dvgxdaz8k9kpz6zkv20zsk17fbqj8259m3g5xr5"))))
> +    (build-system qt-build-system)
> +    (arguments
> +     (list #:tests? #f ;no test suite
> +           #:phases #~(modify-phases %standard-phases
> +                        (replace 'configure
> +                          (lambda* _
> +                            (symlink (string-append #$(this-package-input
> +                                                       "sdl-gamecontrollerdb")
> +                                                    "/gamecontrollerdb.txt")
> +                             "app/SDL_GameControllerDB/gamecontrollerdb.txt")
> +                            (substitute* "moonlight-qt.pro"
> +                              (("moonlight-common-c \\\\")
> +                               "#moonlight-common-c \\")
> +                              (("qmdnsengine \\\\")
> +                               "#qmdnsengine \\")
> +                              (("app \\\\")
> +                               "app")
> +                              (("app.depends")
> +                               "INCLUDEPATH +=")
> +                              (("h264bitstream \\\\")
> +                               "#h264bitstream \\"))
> +                            (invoke "qmake"
> +                                    (string-append "PREFIX="
> +                                                   #$output)))))))

The above could benefit from a comment explaining what this is about
(mostly unbundling libraries, it seems).

> +    (native-inputs (list pkg-config qttools-5))
> +    (inputs (list ffmpeg
> +                  h264bitstream
> +                  libva
> +                  libvdpau
> +                  moonlight-common
> +                  openssl
> +                  opus
> +                  qmdnsengine
> +                  qtbase-5
> +                  qtdeclarative-5
> +                  qtquickcontrols2-5
> +                  qtsvg-5
> +                  sdl2
> +                  sdl2-ttf
> +                  sdl-gamecontrollerdb))
> +    (synopsis "GameStream client")
> +    (description
> +     "Moonlight is an open source implementation of NVIDIA's GameStream, as
> +used by the NVIDIA Shield.")

There's no need to use 'open source' or similar adjective in Guix, as
this is already implied for the whole collection of software offered.

Thank you, and apologies for sending my comments in multiple small
chunks.
Maxim Cournoyer March 21, 2023, 2:07 p.m. UTC | #3
Hello Petr,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Hi Petr,
>
> phodina <phodina@protonmail.com> writes:
>
>> From a18528bd178c177f50e73de4b89ccbf758ab1774 Mon Sep 17 00:00:00 2001
>> From: Petr Hodina <phodina@protonmail.com>
>> Date: Sat, 3 Dec 2022 10:36:38 +0100
>> Subject: [PATCH v2 6/6] gnu: Add moonlight-qt.
>>
>> * gnu/packages/games.scm (moonlight-qt): New variable.
>>
>> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
>> index 5f5bd8795e..6600c1ee60 100644
>> --- a/gnu/packages/games.scm
>> +++ b/gnu/packages/games.scm
>> @@ -5841,6 +5841,66 @@ (define-public bambam
>>  colors, pictures, and sounds.")
>>      (license license:gpl3+)))
>>  
>> +(define-public moonlight-qt
>> +  (package
>> +    (name "moonlight-qt")
>> +    (version "3.1.4")
>> +    (source (origin
>> +              (method git-fetch)
>> +              (uri (git-reference
>> +                    (url "https://github.com/moonlight-stream/moonlight-qt")
>> +                    (commit (string-append "v" version))))
>> +              (file-name (git-file-name name version))
>> +              (sha256
>> +               (base32
>> +                "02y2rbiiawhj1dvgxdaz8k9kpz6zkv20zsk17fbqj8259m3g5xr5"))))
>> +    (build-system qt-build-system)
>> +    (arguments
>> +     (list #:tests? #f ;no test suite
>> +           #:phases #~(modify-phases %standard-phases
>> +                        (replace 'configure
>> +                          (lambda* _
>> +                            (symlink (string-append #$(this-package-input
>> +                                                       "sdl-gamecontrollerdb")
>> +                                                    "/gamecontrollerdb.txt")
>> +                             "app/SDL_GameControllerDB/gamecontrollerdb.txt")
>> +                            (substitute* "moonlight-qt.pro"
>> +                              (("moonlight-common-c \\\\")
>> +                               "#moonlight-common-c \\")
>> +                              (("qmdnsengine \\\\")
>> +                               "#qmdnsengine \\")
>> +                              (("app \\\\")
>> +                               "app")
>> +                              (("app.depends")
>> +                               "INCLUDEPATH +=")
>> +                              (("h264bitstream \\\\")
>> +                               "#h264bitstream \\"))
>> +                            (invoke "qmake"
>> +                                    (string-append "PREFIX="
>> +                                                   #$output)))))))
>
> The above could benefit from a comment explaining what this is about
> (mostly unbundling libraries, it seems).
>
>> +    (native-inputs (list pkg-config qttools-5))
>> +    (inputs (list ffmpeg
>> +                  h264bitstream
>> +                  libva
>> +                  libvdpau
>> +                  moonlight-common
>> +                  openssl
>> +                  opus
>> +                  qmdnsengine
>> +                  qtbase-5
>> +                  qtdeclarative-5
>> +                  qtquickcontrols2-5
>> +                  qtsvg-5
>> +                  sdl2
>> +                  sdl2-ttf
>> +                  sdl-gamecontrollerdb))
>> +    (synopsis "GameStream client")
>> +    (description
>> +     "Moonlight is an open source implementation of NVIDIA's GameStream, as
>> +used by the NVIDIA Shield.")
>
> There's no need to use 'open source' or similar adjective in Guix, as
> this is already implied for the whole collection of software offered.
>
> Thank you, and apologies for sending my comments in multiple small
> chunks.

Gentle ping.  See the thread for the full review comments.
Oleg Pykhalov Jan. 21, 2024, 1:22 p.m. UTC | #4
Hello Maxim and Petr,

Thank you for packaging this tool!  The patch series modified according
to Maxim suggestions and pushed to master, if you don't mind.

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

[…]

> Gentle ping.  See the thread for the full review comments.

Also:

The ‘sdl2-gamecontrollerdb’ input is used instead of
‘sdl-gamecontrollerdb’ (the same thing but newer source commit).

Added to ‘version’ package fields ‘git-commit’ with respectful upstream
versions.

Pushed as f649f820535312c031b3392721cf23ed06ae310b to master.


Petr, if you have a package recipe for the Sunshine (a FOSS streaming
server compatible with Moonlight), I would happy to add it, too.


Thanks,
Oleg.
diff mbox series

Patch

From 0f7b7aeff35661dee6bb9d204845730d2618f3b9 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sat, 3 Dec 2022 10:30:01 +0100
Subject: [PATCH v2 1/6] gnu: Add qmdnsengine.

* gnu/packages/qt.scm (qmdnsengine): New variable.

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 6406fd5c49..28225167f0 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -123,6 +123,32 @@  (define-module (gnu packages qt)
   #:use-module (gnu packages xml)
   #:use-module (srfi srfi-1))
 
+(define-public qmdnsengine
+  ;; Used as submodule in https://github.com/moonlight-stream/moonlight-qt
+  (let ((commit "b7a5a9f225d5e14b39f9fd1f905c4f505cf2ee99")
+        (revision "1"))
+    (package
+      (name "qmdnsengine")
+      (version commit)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/cgutman/qmdnsengine")
+                      (commit version)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1f5v5n9w4aszcdjxmw81cwmd26ssywvfiyr8x0vbyamp4kqd8mww"))))
+      (build-system cmake-build-system)
+      (arguments
+       '(#:configure-flags (list "-DBUILD_TESTS=ON")))
+      (inputs (list qtbase-5))
+      (synopsis "Multicast DNS library for Qt application")
+      (description "This package provides multicast DNS library for Qt
+  applications.")
+      (home-page "https://github.com/moonlight-stream/moonlight-common-c")
+      (license license:expat))))
+
 (define-public qite
   (let ((commit "75fb3b6bbd5c6a5a8fc35e08a6efbfb588ed546a")
         (revision "74"))
-- 
2.38.1