all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#29099] [PATCH] gnu: Add kodi-cli.
@ 2017-11-01  6:48 Oleg Pykhalov
  2017-11-01 21:32 ` Marius Bakke
  0 siblings, 1 reply; 5+ messages in thread
From: Oleg Pykhalov @ 2017-11-01  6:48 UTC (permalink / raw)
  To: 29099


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1: [PATCH] gnu: Add kodi-cli. --]
[-- Type: text/x-patch, Size: 3275 bytes --]

From 741284b1619490859910fb402802ab10b31f0fd2 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
Date: Wed, 1 Nov 2017 09:39:05 +0300
Subject: [PATCH] gnu: Add kodi-cli.

* gnu/packages/kodi.scm (kodi-cli): New variable.
---
 gnu/packages/kodi.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/kodi.scm b/gnu/packages/kodi.scm
index c8a65af79..65621e152 100644
--- a/gnu/packages/kodi.scm
+++ b/gnu/packages/kodi.scm
@@ -25,11 +25,13 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages cdrom)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
@@ -426,3 +428,49 @@ plug-in system.")
                    license:public-domain          ;cpluff/examples
                    license:bsd-3                  ;misc, gtest
                    license:bsd-2)))))             ;xbmc/freebsd
+
+(define-public kodi-cli
+  (let ((commit "104dc23b2a993c8e6db8c46f4f8bec24b146549b") ; Add support for
+        (revision "1"))                                     ; `$HOME/.kodirc'.
+    (package
+      (name "kodi-cli")
+      (version (string-append "1.1-" revision "." (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference (url "https://github.com/nawar/kodi-cli")
+                                    (commit commit)))
+                (sha256
+                 (base32
+                  "1xjhasc5gngfxpr1dlzy6q24w0wpdfjx12p43fanjppxw4i49n5p"))
+                (file-name (string-append name "-" version "-checkout"))))
+      (build-system trivial-build-system)
+      (inputs `(("bash" ,bash)))
+      (propagated-inputs `(("curl" ,curl)))
+      (arguments
+       `(#:modules ((guix build utils))
+         #:builder
+         (begin
+           (use-modules (guix build utils))
+           (copy-recursively (assoc-ref %build-inputs "source") ".")
+           (substitute* "kodi-cli"
+             (("/bin/bash") (string-append (assoc-ref %build-inputs "bash")
+                                           "/bin/bash")))
+           (install-file "kodi-cli" (string-append %output "/bin")))))
+      (home-page "https://github.com/nawar/kodi-cli")
+      (synopsis "Bash script to send commands to Kodi using JSON RPC")
+      (description "@code{kodi-cli} provides the Bash script to send commands to
+Kodi using JSON RPC.
+
+Feautures:
+
+@itemize
+@item Play, pause, stop the current played video.
+@item Skip forward or backward in the current played video.
+@item Play or queue to the current list YouTube video.
+@item Interactive and noninteractive volume control.
+@item Interactive navigation.
+@item Send text.
+@item Toggle fullscreen.
+@item Update or clean Kodi libraries.
+@end itemize\n")
+      (license license:gpl2+))))
-- 
2.14.3


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#29099] [PATCH] gnu: Add kodi-cli.
  2017-11-01  6:48 [bug#29099] [PATCH] gnu: Add kodi-cli Oleg Pykhalov
@ 2017-11-01 21:32 ` Marius Bakke
  2017-11-02  9:14   ` Oleg Pykhalov
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2017-11-01 21:32 UTC (permalink / raw)
  To: Oleg Pykhalov, 29099

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

Hello Oleg!

Oleg Pykhalov <go.wigust@gmail.com> writes:

> From 741284b1619490859910fb402802ab10b31f0fd2 Mon Sep 17 00:00:00 2001
> From: Oleg Pykhalov <go.wigust@gmail.com>
> Date: Wed, 1 Nov 2017 09:39:05 +0300
> Subject: [PATCH] gnu: Add kodi-cli.
>
> * gnu/packages/kodi.scm (kodi-cli): New variable.

Cool!

[...]

> +(define-public kodi-cli
> +  (let ((commit "104dc23b2a993c8e6db8c46f4f8bec24b146549b") ; Add support for
> +        (revision "1"))                                     ; `$HOME/.kodirc'.
> +    (package
> +      (name "kodi-cli")
> +      (version (string-append "1.1-" revision "." (string-take commit 7)))
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference (url "https://github.com/nawar/kodi-cli")
> +                                    (commit commit)))
> +                (sha256
> +                 (base32
> +                  "1xjhasc5gngfxpr1dlzy6q24w0wpdfjx12p43fanjppxw4i49n5p"))
> +                (file-name (string-append name "-" version "-checkout"))))
> +      (build-system trivial-build-system)
> +      (inputs `(("bash" ,bash)))
> +      (propagated-inputs `(("curl" ,curl)))

There is only one reference to `curl` in the script, can you try to
substitute it with the absolute path and make it a regular input?  It's
good to avoid propagation when we can.

> +      (arguments
> +       `(#:modules ((guix build utils))
> +         #:builder
> +         (begin
> +           (use-modules (guix build utils))
> +           (copy-recursively (assoc-ref %build-inputs "source") ".")
> +           (substitute* "kodi-cli"
> +             (("/bin/bash") (string-append (assoc-ref %build-inputs "bash")
> +                                           "/bin/bash")))
> +           (install-file "kodi-cli" (string-append %output "/bin")))))

(install-file ...) has an unspecified return value, so please return #t here.

> +      (home-page "https://github.com/nawar/kodi-cli")
> +      (synopsis "Bash script to send commands to Kodi using JSON RPC")

Maybe just "Control Kodi from the command line".

> +      (description "@code{kodi-cli} provides the Bash script to send commands to
> +Kodi using JSON RPC.

Similarly, this sentence can be reduced to something like
"@code{kodi-cli} is a tool for sending commands to a Kodi server using
JSON-RPC.".  Bash is an boring implementation detail IMO. :-)

> +
> +Feautures:
      ^ Stray 'u' character.

> +
> +@itemize
> +@item Play, pause, stop the current played video.

"currently playing"

> +@item Skip forward or backward in the current played video.

Same here.  Maybe it should be "currently playing item", since I assume
this works for music as well.

> +@item Play or queue to the current list YouTube video.

"List of YouTube videos"?

> +@item Interactive and noninteractive volume control.
> +@item Interactive navigation.
> +@item Send text.

What does this mean?  Arbitrary commands, or text notifications?

> +@item Toggle fullscreen.
> +@item Update or clean Kodi libraries.
> +@end itemize\n")
> +      (license license:gpl2+))))

LGTM with some cosmetic improvements.  And welcome!

By the way, if you use Kodi from Guix, feel free to update the 18
snapshot if you can.  My media PC died a while back, and I didn't get a
replacement yet, so I have not been able to maintain the Kodi package.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#29099] [PATCH] gnu: Add kodi-cli.
  2017-11-01 21:32 ` Marius Bakke
@ 2017-11-02  9:14   ` Oleg Pykhalov
  2017-11-02 20:00     ` Marius Bakke
  0 siblings, 1 reply; 5+ messages in thread
From: Oleg Pykhalov @ 2017-11-02  9:14 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 29099


[-- Attachment #1.1: Type: text/plain, Size: 3283 bytes --]

Hello Marius,

Thank you for review!

Marius Bakke <mbakke@fastmail.com> writes:

>> +(define-public kodi-cli
>> +  (let ((commit "104dc23b2a993c8e6db8c46f4f8bec24b146549b") ; Add support for
>> +        (revision "1"))                                     ; `$HOME/.kodirc'.
>> +    (package
>> +      (name "kodi-cli")
>> +      (version (string-append "1.1-" revision "." (string-take commit 7)))
>> +      (source (origin
>> +                (method git-fetch)
>> +                (uri (git-reference (url "https://github.com/nawar/kodi-cli")
>> +                                    (commit commit)))
>> +                (sha256
>> +                 (base32
>> +                  "1xjhasc5gngfxpr1dlzy6q24w0wpdfjx12p43fanjppxw4i49n5p"))
>> +                (file-name (string-append name "-" version "-checkout"))))
>> +      (build-system trivial-build-system)
>> +      (inputs `(("bash" ,bash)))
>> +      (propagated-inputs `(("curl" ,curl)))
>
> There is only one reference to `curl` in the script, can you try to
> substitute it with the absolute path and make it a regular input?  It's
> good to avoid propagation when we can.

Done.  I also added input mps-youtube and did the same.

>> +      (arguments
>> +       `(#:modules ((guix build utils))
>> +         #:builder
>> +         (begin
>> +           (use-modules (guix build utils))
>> +           (copy-recursively (assoc-ref %build-inputs "source") ".")
>> +           (substitute* "kodi-cli"
>> +             (("/bin/bash") (string-append (assoc-ref %build-inputs "bash")
>> +                                           "/bin/bash")))
>> +           (install-file "kodi-cli" (string-append %output "/bin")))))
>
> (install-file ...) has an unspecified return value, so please return #t here.

Done.

>> +      (home-page "https://github.com/nawar/kodi-cli")
>> +      (synopsis "Bash script to send commands to Kodi using JSON RPC")
>
> Maybe just "Control Kodi from the command line".

Done.

>> +      (description "@code{kodi-cli} provides the Bash script to send commands to
>> +Kodi using JSON RPC.
>
> Similarly, this sentence can be reduced to something like
> "@code{kodi-cli} is a tool for sending commands to a Kodi server using
> JSON-RPC.".  Bash is an boring implementation detail IMO. :-)

Done.

>> +
>> +Feautures:
>       ^ Stray 'u' character.

Done.

>> +
>> +@itemize
>> +@item Play, pause, stop the current played video.
>
> "currently playing"

Done.

>> +@item Skip forward or backward in the current played video.
>
> Same here.  Maybe it should be "currently playing item", since I assume
> this works for music as well.

Done.

>> +@item Play or queue to the current list YouTube video.
>
> "List of YouTube videos"?

Done.

>> +@item Interactive and noninteractive volume control.
>> +@item Interactive navigation.
>> +@item Send text.
>
> What does this mean?  Arbitrary commands, or text notifications?

From my experience this allows you do the following:

1. Open Videos.
2. Add videos…
3. Select <none>.
4. Enter path by sending a command via 'kodi-cli -t PATH'.

Maybe call this item of the feature list as
“Send text to the Kodi keyboard”?


New patch is attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-kodi-cli.patch --]
[-- Type: text/x-patch, Size: 3738 bytes --]

From 82691aa8ec24ebad702867e006014f34eaceeb93 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
Date: Wed, 1 Nov 2017 09:39:05 +0300
Subject: [PATCH] gnu: Add kodi-cli.

* gnu/packages/kodi.scm (kodi-cli): New variable.
---
 gnu/packages/kodi.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/kodi.scm b/gnu/packages/kodi.scm
index c8a65af79..8c49f720a 100644
--- a/gnu/packages/kodi.scm
+++ b/gnu/packages/kodi.scm
@@ -25,11 +25,13 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages cdrom)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
@@ -426,3 +428,60 @@ plug-in system.")
                    license:public-domain          ;cpluff/examples
                    license:bsd-3                  ;misc, gtest
                    license:bsd-2)))))             ;xbmc/freebsd
+
+(define-public kodi-cli
+  (let ((commit "104dc23b2a993c8e6db8c46f4f8bec24b146549b") ; Add support for
+        (revision "1"))                                     ; `$HOME/.kodirc'.
+    (package
+      (name "kodi-cli")
+      (version (string-append "1.1-" revision "." (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference (url "https://github.com/nawar/kodi-cli")
+                                    (commit commit)))
+                (sha256
+                 (base32
+                  "1xjhasc5gngfxpr1dlzy6q24w0wpdfjx12p43fanjppxw4i49n5p"))
+                (file-name (string-append name "-" version "-checkout"))))
+      (build-system trivial-build-system)
+      (inputs
+       `(("bash"        ,bash)
+         ("curl"        ,curl)
+         ("mps-youtube" ,mps-youtube)))
+      (arguments
+       `(#:modules ((guix build utils))
+         #:builder
+         (begin
+           (use-modules (guix build utils))
+           (copy-recursively (assoc-ref %build-inputs "source") ".")
+           (substitute* "kodi-cli"
+             (("/bin/bash") (string-append (assoc-ref %build-inputs "bash")
+                                           "/bin/bash"))
+             (("output=\\$\\((curl)" all curl)
+              (string-append "output=$("
+                             (assoc-ref %build-inputs "curl")
+                             "/bin/" curl))
+             (("play_youtube `(mpsyt)" all mpsyt)
+              (string-append "play_youtube `"
+                             (assoc-ref %build-inputs "mps-youtube")
+                             "/bin/" mpsyt)))
+           (install-file "kodi-cli" (string-append %output "/bin"))
+           #t)))
+      (home-page "https://github.com/nawar/kodi-cli")
+      (synopsis "Control Kodi from the command line")
+      (description "@code{kodi-cli} is a tool for sending commands to a Kodi
+server using JSON RPC.
+
+Features:
+
+@itemize
+@item Play, pause, stop the current playing item.
+@item Skip forward or backward in the current playing item.
+@item Play or queue to the current list YouTube videos.
+@item Interactive and noninteractive volume control.
+@item Interactive navigation.
+@item Send text.
+@item Toggle fullscreen.
+@item Update or clean Kodi libraries.
+@end itemize\n")
+      (license license:gpl2+))))
-- 
2.14.3


[-- Attachment #1.3: Type: text/plain, Size: 499 bytes --]


>> +@item Toggle fullscreen.
>> +@item Update or clean Kodi libraries.
>> +@end itemize\n")
>> +      (license license:gpl2+))))
>
> LGTM with some cosmetic improvements.  And welcome!
>
> By the way, if you use Kodi from Guix, feel free to update the 18
> snapshot if you can.  My media PC died a while back, and I didn't get a
> replacement yet, so I have not been able to maintain the Kodi package.

OK.  I do, but not much.  Primarily use it on a “media tablet”.  :-)

Oleg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#29099] [PATCH] gnu: Add kodi-cli.
  2017-11-02  9:14   ` Oleg Pykhalov
@ 2017-11-02 20:00     ` Marius Bakke
  2017-11-03  3:57       ` Oleg Pykhalov
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2017-11-02 20:00 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: 29099

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

Oleg Pykhalov <go.wigust@gmail.com> writes:

> Hello Marius,
>
> Thank you for review!
>
> Marius Bakke <mbakke@fastmail.com> writes:
>
>>> +(define-public kodi-cli
>>> +  (let ((commit "104dc23b2a993c8e6db8c46f4f8bec24b146549b") ; Add support for
>>> +        (revision "1"))                                     ; `$HOME/.kodirc'.
>>> +    (package
>>> +      (name "kodi-cli")
>>> +      (version (string-append "1.1-" revision "." (string-take commit 7)))
>>> +      (source (origin
>>> +                (method git-fetch)
>>> +                (uri (git-reference (url "https://github.com/nawar/kodi-cli")
>>> +                                    (commit commit)))
>>> +                (sha256
>>> +                 (base32
>>> +                  "1xjhasc5gngfxpr1dlzy6q24w0wpdfjx12p43fanjppxw4i49n5p"))
>>> +                (file-name (string-append name "-" version "-checkout"))))
>>> +      (build-system trivial-build-system)
>>> +      (inputs `(("bash" ,bash)))
>>> +      (propagated-inputs `(("curl" ,curl)))
>>
>> There is only one reference to `curl` in the script, can you try to
>> substitute it with the absolute path and make it a regular input?  It's
>> good to avoid propagation when we can.
>
> Done.  I also added input mps-youtube and did the same.

Excellent.

>>> +@item Interactive and noninteractive volume control.
>>> +@item Interactive navigation.
>>> +@item Send text.
>>
>> What does this mean?  Arbitrary commands, or text notifications?
>
> From my experience this allows you do the following:
>
> 1. Open Videos.
> 2. Add videos…
> 3. Select <none>.
> 4. Enter path by sending a command via 'kodi-cli -t PATH'.
>
> Maybe call this item of the feature list as
> “Send text to the Kodi keyboard”?

"Send text to the Kodi keyboard" is much better, thanks!

> New patch is attached.

[...]

> +      (arguments
> +       `(#:modules ((guix build utils))
> +         #:builder
> +         (begin
> +           (use-modules (guix build utils))
> +           (copy-recursively (assoc-ref %build-inputs "source") ".")
> +           (substitute* "kodi-cli"
> +             (("/bin/bash") (string-append (assoc-ref %build-inputs "bash")
> +                                           "/bin/bash"))
> +             (("output=\\$\\((curl)" all curl)
> +              (string-append "output=$("
> +                             (assoc-ref %build-inputs "curl")
> +                             "/bin/" curl))
> +             (("play_youtube `(mpsyt)" all mpsyt)
> +              (string-append "play_youtube `"
> +                             (assoc-ref %build-inputs "mps-youtube")
> +                             "/bin/" mpsyt)))

FYI, you could also use (which "curl") etc from (guix build utils) here,
but I usually prefer this form.

[...]

> +@itemize
> +@item Play, pause, stop the current playing item.
> +@item Skip forward or backward in the current playing item.

These should be "currently playing".

> +@item Play or queue to the current list YouTube videos.

"... current list of YouTube videos."

(note the "of")

LGTM otherwise.  Don't forget to add a copyright line for yourself.

Thanks!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#29099] [PATCH] gnu: Add kodi-cli.
  2017-11-02 20:00     ` Marius Bakke
@ 2017-11-03  3:57       ` Oleg Pykhalov
  0 siblings, 0 replies; 5+ messages in thread
From: Oleg Pykhalov @ 2017-11-03  3:57 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 29099, 29099-done

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

Marius Bakke <mbakke@fastmail.com> writes:

[...]

>> Maybe call this item of the feature list as
>> “Send text to the Kodi keyboard”?
>
> "Send text to the Kodi keyboard" is much better, thanks!
>
>> +      (arguments
>> +       `(#:modules ((guix build utils))
>> +         #:builder
>> +         (begin
>> +           (use-modules (guix build utils))
>> +           (copy-recursively (assoc-ref %build-inputs "source") ".")
>> +           (substitute* "kodi-cli"
>> +             (("/bin/bash") (string-append (assoc-ref %build-inputs "bash")
>> +                                           "/bin/bash"))
>> +             (("output=\\$\\((curl)" all curl)
>> +              (string-append "output=$("
>> +                             (assoc-ref %build-inputs "curl")
>> +                             "/bin/" curl))
>> +             (("play_youtube `(mpsyt)" all mpsyt)
>> +              (string-append "play_youtube `"
>> +                             (assoc-ref %build-inputs "mps-youtube")
>> +                             "/bin/" mpsyt)))
>
> FYI, you could also use (which "curl") etc from (guix build utils) here,
> but I usually prefer this form.

Thanks for notice.  I prefer a form used in attached patch, too.

>> +@itemize
>> +@item Play, pause, stop the current playing item.
>> +@item Skip forward or backward in the current playing item.
>
> These should be "currently playing".

Done.

>> +@item Play or queue to the current list YouTube videos.
>
> "... current list of YouTube videos."
>
> (note the "of")

Done.

> LGTM otherwise.  Don't forget to add a copyright line for yourself.

OK.  I think it's fine to merge it now.


Pushed as 72df48dbad95c3bc70a2962f496420ce3363d0de

Oleg,
Thanks.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-03  3:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01  6:48 [bug#29099] [PATCH] gnu: Add kodi-cli Oleg Pykhalov
2017-11-01 21:32 ` Marius Bakke
2017-11-02  9:14   ` Oleg Pykhalov
2017-11-02 20:00     ` Marius Bakke
2017-11-03  3:57       ` Oleg Pykhalov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.