unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: phodina via Guix-patches via <guix-patches@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 59851@debbugs.gnu.org
Subject: [bug#59851] Add Moonlight
Date: Tue, 17 Jan 2023 08:07:14 +0000	[thread overview]
Message-ID: <RgzlT6EkYv29_6-nDwzgii-eatP9OURzDVFm124uxVtqFhcPqHKXjnvqaHCLA_WOi520VarFzwZrI35mAk5oAi10IW3-w4PdjABUwOXbCpg=@protonmail.com> (raw)
In-Reply-To: <87cz7e8nlw.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 82 bytes --]

Hi Maxim,

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

----
Petr

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v2-0003-gnu-Add-h264bitstream.patch --]
[-- Type: text/x-patch; name=v2-0003-gnu-Add-h264bitstream.patch, Size: 2148 bytes --]

From 48057e988fb42f08238d3c2d6572f28af2cadee8 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sat, 3 Dec 2022 10:34:03 +0100
Subject: [PATCH v2 3/6] gnu: Add h264bitstream.

* gnu/packages/video.scm (h264bitstream): New variable.

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index fc430b9196..b9189bbf5d 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -3992,6 +3992,39 @@ (define-public handbrake
     ;; Combination under GPLv2.  See LICENSE.
     (license license:gpl2)))
 
+(define-public h264bitstream
+  ;; Used as submodule in https://github.com/moonlight-stream/moonlight-qt
+  (let ((commit "34f3c58afa3c47b6cf0a49308a68cbf89c5e0bff")
+        (revision "1"))
+    (package
+      (name "h264bitstream")
+      (version commit)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/aizvorski/h264bitstream")
+                      (commit version)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0rrhzckz2a89q0chw2bfl4g89yiv9a0dcqcj80lcpdr3a1ix8q85"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:tests? #f ;no test suite
+             #:phases #~(modify-phases %standard-phases
+                          (add-after 'install 'fix-include-bs-h
+                            (lambda _
+                              (symlink (string-append #$output
+                                        "/include/h264bitstream/bs.h")
+                                       (string-append #$output "/include/bs.h")))))))
+      (native-inputs (list autoconf automake libtool pkg-config))
+      (inputs (list ffmpeg))
+      (synopsis "Library to read and write H.264 video bitstreams")
+      (description
+       "This package provides the GameStream code shared between Moonlight clients.")
+      (home-page "https://github.com/aizvorski/h264bitstream")
+      (license license:lgpl2.1+))))
+
 (define-public intel-vaapi-driver
   (package
     (name "intel-vaapi-driver")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: v2-0006-gnu-Add-moonlight-qt.patch --]
[-- Type: text/x-patch; name=v2-0006-gnu-Add-moonlight-qt.patch, Size: 3231 bytes --]

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)))))))
+    (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.")
+    (home-page "https://moonlight-stream.org")
+    (license license:gpl3+)))
+
 (define-public moonlight-common
   ;; Used as submodule in https://github.com/moonlight-stream/moonlight
   (let ((commit "8c55c086d596607041e4394fb62a1bc800b7f37c")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: v2-0005-gnu-Add-sdl-gamecontrollerdb.patch --]
[-- Type: text/x-patch; name=v2-0005-gnu-Add-sdl-gamecontrollerdb.patch, Size: 2140 bytes --]

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.

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 "")
+      (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 "")
+      (home-page "https://github.com/gabomdq/SDL_GameControllerDB")
+      (license license:zlib))))
+
 (define-public sdl-gfx
   (package
     (name "sdl-gfx")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: v2-0002-gnu-Add-enet-moonlight.patch --]
[-- Type: text/x-patch; name=v2-0002-gnu-Add-enet-moonlight.patch, Size: 2464 bytes --]

From 164ff47fa7668e962c0a0b9bc8ac2a3f4fbab527 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sat, 3 Dec 2022 10:32:43 +0100
Subject: [PATCH v2 2/6] gnu: Add enet-moonlight.

* gnu/packages/networking.scm (enet-moonlight): New variable.

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index a7b51ed1ff..b125753dae 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -2591,6 +2591,45 @@ (define-public enet
     (home-page "http://enet.bespin.org")
     (license license:expat)))
 
+(define-public enet-moonlight
+  (let ((commit "4cde9cc3dcc5c30775a80da1de87f39f98672a31")
+        (revision "1"))
+    (package
+      (inherit enet)
+      (name "enet")
+      (version commit)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/cgutman/enet")
+                      (commit version)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "07sr32jy989ja23fwg8bvrq2slgm7bhfw6v3xq7yczbw86c1dndv"))))
+      (build-system cmake-build-system)
+      (arguments
+       (list #:tests? #f ;no test suite
+             #:phases #~(modify-phases %standard-phases
+                          (add-after 'unpack 'build-share-lib
+                            (lambda* _
+                              ;;  -DBUILD_SHARED_LIBS=ON not working
+                              (substitute* "CMakeLists.txt"
+                                (("STATIC")
+                                 "SHARED"))))
+                          (replace 'install
+                            (lambda* (#:key outputs source #:allow-other-keys)
+                              (let* ((include (string-append #$output
+                                                             "/include"))
+                                     (lib (string-append #$output "/lib")))
+                                (mkdir-p include)
+                                (mkdir-p lib)
+                                (copy-recursively (string-append source
+                                                                 "/include")
+                                                  include)
+                                (install-file "libenet.so" lib)))))))
+      (native-inputs (list pkg-config)))))
+
 (define-public sslh
   (package
     (name "sslh")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: v2-0004-gnu-Add-moonlight-common.patch --]
[-- Type: text/x-patch; name=v2-0004-gnu-Add-moonlight-common.patch, Size: 2759 bytes --]

From 5c467ecfd2a4628ed776288b213968a0f4e0dedc Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sat, 3 Dec 2022 10:35:36 +0100
Subject: [PATCH v2 4/6] gnu: Add moonlight-common.

* gnu/packages/games.scm (moonlight-common): New variable.

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index a0b21b3bdd..5f5bd8795e 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -5841,6 +5841,50 @@ (define-public bambam
 colors, pictures, and sounds.")
     (license license:gpl3+)))
 
+(define-public moonlight-common
+  ;; Used as submodule in https://github.com/moonlight-stream/moonlight
+  (let ((commit "8c55c086d596607041e4394fb62a1bc800b7f37c")
+        (revision "1"))
+    (package
+      (name "moonlight-common")
+      (version commit)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url
+                       "https://github.com/moonlight-stream/moonlight-common-c")
+                      (commit version)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0pqm0a2p2sqvazv5gak6gl7d405kaaq6r13l7yhycm0myayqavrp"))))
+      (build-system cmake-build-system)
+      (arguments
+       (list #:tests? #f
+             #:phases #~(modify-phases %standard-phases
+                          (add-after 'unpack 'use-system-enet-package
+                            (lambda _
+                              (substitute* "CMakeLists.txt"
+                                (("add_subdirectory\\(enet\\)")
+                                 ""))))
+                          (replace 'install
+                            (lambda* (#:key outputs source #:allow-other-keys)
+                              (let* ((include (string-append #$output
+                                                             "/include"))
+                                     (lib (string-append #$output "/lib")))
+                                (mkdir-p include)
+                                (mkdir-p lib)
+                                (install-file (string-append source
+                                               "/src/Limelight.h") include)
+                                (install-file "libmoonlight-common-c.so" lib)))))))
+      (native-inputs (list pkg-config))
+      (inputs (list enet-moonlight openssl qtbase-5))
+      (synopsis "GameStream protocol core implementation")
+      (description
+       "This package provides the GameStream core code for the protocol.")
+      (home-page "https://github.com/moonlight-stream/moonlight-common-c")
+      (license license:gpl3+))))
+
 (define-public mrrescue
   (package
     (name "mrrescue")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: v2-0001-gnu-Add-qmdnsengine.patch --]
[-- Type: text/x-patch; name=v2-0001-gnu-Add-qmdnsengine.patch, Size: 1697 bytes --]

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


  reply	other threads:[~2023-01-17  8:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06  3:17 [bug#59851] Add Moonlight phodina via Guix-patches via
2023-01-16 15:03 ` Maxim Cournoyer
2023-01-16 15:04 ` Maxim Cournoyer
2023-01-16 15:59 ` Maxim Cournoyer
2023-01-16 16:05 ` Maxim Cournoyer
2023-01-16 16:11 ` Maxim Cournoyer
2023-01-16 16:12 ` Maxim Cournoyer
2023-01-17  8:07   ` phodina via Guix-patches via [this message]
2023-01-17 16:29     ` Maxim Cournoyer
2023-01-17 16:35     ` Maxim Cournoyer
2023-03-21 14:07       ` Maxim Cournoyer
2024-01-21 13:22         ` bug#59851: " Oleg Pykhalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='RgzlT6EkYv29_6-nDwzgii-eatP9OURzDVFm124uxVtqFhcPqHKXjnvqaHCLA_WOi520VarFzwZrI35mAk5oAi10IW3-w4PdjABUwOXbCpg=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=59851@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=phodina@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).