Subject: bug#49539: closed (Re: bug#49539: [PATCH] gnu: Add nginx-rtmp-module.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 29 Jul 2021 19:49:02 +0000

Your bug report

#49539: [PATCH] gnu: Add nginx-rtmp-module.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
49539: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=49539
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#49539: [PATCH] gnu: Add nginx-rtmp-module.
From: Ludovic Courtès <[email-masked]>
To: Jack Hill <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Thu, 29 Jul 2021 21:48:23 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Jack Hill <[email-masked]> skribis:

> * gnu/packages/web.scm (nginx-rtmp-module): New variable.

Applied.  Thank you and thanks to Sarah for reviewing!

Ludo’.

Subject: [PATCH] gnu: Add nginx-rtmp-module.
From: Jack Hill <[email-masked]>
To: [email-masked]
Date: Mon, 12 Jul 2021 16:39:20 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/web.scm (nginx-rtmp-module): New variable.
---
 gnu/packages/web.scm | 61 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 2cc8619b19..ad51bfdf55 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -50,6 +50,7 @@
 ;;; Copyright © 2021 Stefan Reichör <[email-masked]>
 ;;; Copyright © 2021 la snesne <[email-masked]>
 ;;; Copyright © 2021 Matthew James Kraai <[email-masked]>
+;;; Copyright © 2021 Jack Hill <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -771,6 +772,66 @@ documentation.")
     (description "This NGINX module provides a scripting support with Lua
 programming language.")))
 
+(define-public nginx-rtmp-module
+  (package
+    (inherit nginx)
+    (name "nginx-rtmp-module")
+    (version "1.2.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/arut/nginx-rtmp-module")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0y45bswk213yhkc2v1xca2rnsxrhx8v6azxz9pvi71vvxcggqv6h"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("nginx-sources" ,(package-source nginx))
+       ,@(package-inputs nginx)))
+    (arguments
+     (substitute-keyword-arguments
+         `(#:configure-flags '("--add-dynamic-module=.")
+           #:make-flags '("modules")
+           #:modules ((guix build utils)
+                      (guix build gnu-build-system))
+           ,@(package-arguments nginx))
+       ((#:phases phases)
+        `(modify-phases ,phases
+           ;; The LICENSE file will be overwritten with the one from nginx
+           ;; when unpacking the nginx source, so copy this one to its own
+           ;; file.
+           (add-after 'unpack 'preserve-license-file
+             (lambda _ (copy-file "LICENSE" "LICENSE.rtmp")))
+           (add-after 'preserve-license-file 'unpack-nginx-sources
+             (lambda* (#:key inputs native-inputs #:allow-other-keys)
+               (begin
+                 ;; The nginx source code is part of the module’s source.
+                 (format #t "decompressing nginx source code~%")
+                 (let ((tar (assoc-ref inputs "tar"))
+                       (nginx-srcs (assoc-ref inputs "nginx-sources")))
+                   (invoke (string-append tar "/bin/tar")
+                           "xvf" nginx-srcs "--strip-components=1"))
+                 #t)))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((modules-dir (string-append (assoc-ref outputs "out")
+                                                 "/etc/nginx/modules")))
+                 (install-file "objs/ngx_rtmp_module.so" modules-dir)
+                 #t)))
+           (delete 'fix-root-dirs)
+           (delete 'install-man-page)))))
+    (home-page "https://github.com/arut/nginx-rtmp-module")
+    (synopsis "NGINX module for audo and video streaming with RTMP")
+    (description "This NGINX module provides streaming with the @acronym{RTMP,
+Real-Time Messaging Protocol}, @acronym{DASH, Dynamic Adaptive Streaming over HTTP},
+and @acronym{HLS, HTTP Live Streaming} protocols.  It allows NGINX to accept
+incoming RTMP streams for recording or redistribution.  It also supports
+on-demand streaming from a file on disk and pulling from an upstream RTMP
+steam.  Remote control of the module is possible over HTTP.")
+    (license license:bsd-2)))
+
 (define-public lighttpd
   (package
     (name "lighttpd")
-- 
2.32.0