[PATCH] gnu: Add ani-cli

  • Done
  • quality assurance status badge
Details
2 participants
  • Jaeme Sifat
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Jaeme Sifat
Severity
normal
Merged with
J
J
Jaeme Sifat wrote on 23 Oct 2023 07:10
(address . guix-patches@gnu.org)(name . Jaeme Sifat)(address . jaeme@runbox.com)
20231023051055.1470319-1-jaeme@runbox.com
Change-Id: I922b98d5a047760974a22499d7a299bdf932ef1a
---
gnu/packages/video.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (67 lines)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index b4dd7c27ae..e5166a3aa2 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -66,6 +66,7 @@
;;; Copyright © 2023 Ott Joon <oj@vern.cc>
;;; Copyright © 2023 Dominik Delgado Steuter <dds@disroot.org>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
+;;; Copyright © 2023 Jaeme Sifat <jaeme@runbox.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -116,6 +117,7 @@ (define-module (gnu packages video)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
+ #:use-module (gnu packages bittorrent)
#:use-module (gnu packages boost)
#:use-module (gnu packages cdrom)
#:use-module (gnu packages check)
@@ -194,6 +196,7 @@ (define-module (gnu packages video)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages ssh)
#:use-module (gnu packages swig)
+ #:use-module (gnu packages terminals)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages textutils)
#:use-module (gnu packages tls)
@@ -5721,3 +5724,34 @@ (define-public svtplay-dl
broadcasters including SVT Play, Sveriges Radio, TV4 Play, along with many
others.")
(license license:expat)))
+
+(define-public ani-cli
+ (package
+ (name "ani-cli")
+ (version "4.6")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pystardust/ani-cli")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1ni9pzjb5qh87iz7c8252bx79qadr1qx6jnkqvvjcqrchh7q473a"))))
+ (build-system copy-build-system)
+ (arguments
+ `(#:install-plan '(("ani-cli" "bin/")
+ ("ani-cli.1" "share/man/man1/"))))
+ (home-page "https://github.com/pystardust/ani-cli")
+ (synopsis "CLI to browse and watch anime")
+ (description
+ "ani-cli is a shell script command-line tool for browsing and watching
+anime using allanime as a source. It can stream at multiple resolutions and
+provides multiple interfaces such as rofi.")
+ (propagated-inputs (list mpv
+ yt-dlp
+ ffmpeg
+ fzf
+ curl
+ aria2))
+ (license license:gpl3)))

base-commit: 56742f79c0d41e7a642154d9f04b9a344c47a6dc
--
2.34.1
J
Revised Patch
(address . 66694@debbugs.gnu.org)
3fef0f08-1816-4abe-a06c-e858a2b74e58@runbox.com
I revised my patch to include gexps instead of inferior
propagated-inputs as was advised to me in the guix IRC room.
From a70882f584c9406f46325dced316e3ee95c73aee Mon Sep 17 00:00:00 2001
Message-Id: <a70882f584c9406f46325dced316e3ee95c73aee.1698352369.git.jaeme@runbox.com>
From: Jaeme Sifat <jaeme@runbox.com>
Date: Thu, 26 Oct 2023 16:27:45 -0400
Subject: [PATCH] gnu: Add ani-cli.

* gnu/packages/video.scm (ani-cli): New variable.

Signed-off-by: Jaeme Sifat <jaeme@runbox.com>
Change-Id: Id2512a6b22dd2a3bfe44aa525c6a72c9c5082653
---
gnu/packages/video.scm | 57 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)

Toggle diff (93 lines)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index b4dd7c27ae..70f4808723 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -66,6 +66,7 @@
;;; Copyright © 2023 Ott Joon <oj@vern.cc>
;;; Copyright © 2023 Dominik Delgado Steuter <dds@disroot.org>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
+;;; Copyright © 2023 Jaeme Sifat <jaeme@runbox.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -116,6 +117,7 @@ (define-module (gnu packages video)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
+ #:use-module (gnu packages bittorrent)
#:use-module (gnu packages boost)
#:use-module (gnu packages cdrom)
#:use-module (gnu packages check)
@@ -194,6 +196,7 @@ (define-module (gnu packages video)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages ssh)
#:use-module (gnu packages swig)
+ #:use-module (gnu packages terminals)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages textutils)
#:use-module (gnu packages tls)
@@ -209,6 +212,60 @@ (define-module (gnu packages video)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg))
+(define-public ani-cli
+ (package
+ (name "ani-cli")
+ (version "4.6")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pystardust/ani-cli")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1ni9pzjb5qh87iz7c8252bx79qadr1qx6jnkqvvjcqrchh7q473a"))))
+ (build-system copy-build-system)
+ (arguments
+ (list
+ #:install-plan #~'(("ani-cli" "bin/")
+ ("ani-cli.1" "share/man/man1/"))
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'install 'wrap
+ (lambda* (#:key inputs #:allow-other-keys)
+ (define (bin command)
+ (dirname (search-input-file inputs
+ (string-append "bin/"
+ command))))
+ (wrap-program (string-append #$output "/bin/ani-cli")
+ `("PATH" ":" prefix
+ ,(map bin
+ (list "aria2c"
+ "curl"
+ "ffmpeg"
+ "fzf"
+ "grep"
+ "mpv"
+ "sed"
+ "uname"
+ "yt-dlp")))))))))
+ (home-page "https://github.com/pystardust/ani-cli")
+ (synopsis "CLI to browse and watch anime")
+ (description
+ "ani-cli is a command-line interface (cli) to browse and watch anime
+(alone AND with friends). It provides an easy way to stream shows from
+allanime directly. There is different features such as episode browsing,
+history tracking, streaming at multiple resolutions and much more depending on
+what programs the user has installed.")
+ (inputs (list aria2
+ coreutils
+ curl
+ ffmpeg
+ fzf
+ mpv
+ yt-dlp))
+ (license license:gpl3)))
+
(define-public transcode
(package
(name "transcode")

base-commit: 33f5b747b4a0a508e1ffc94a5bf425cff707c6e3
--
2.34.1
J
(no subject)
(address . 66694@debbugs.gnu.org)
46f3e4e1-c5ee-45fd-941f-70424cd7a4a6@runbox.com
Revised description field.
From 4b2a7afbcb6821a307becdef2fb0ca4b29b85d3c Mon Sep 17 00:00:00 2001
Message-Id: <4b2a7afbcb6821a307becdef2fb0ca4b29b85d3c.1698364072.git.jaeme@runbox.com>
From: Jaeme Sifat <jaeme@runbox.com>
Date: Thu, 26 Oct 2023 16:27:45 -0400
Subject: [PATCH] gnu: Add ani-cli.

* gnu/packages/video.scm (ani-cli): New variable.

Signed-off-by: Jaeme Sifat <jaeme@runbox.com>
Change-Id: Id2512a6b22dd2a3bfe44aa525c6a72c9c5082653
---
gnu/packages/video.scm | 57 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)

Toggle diff (93 lines)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index b4dd7c27ae..e7b98ede8b 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -66,6 +66,7 @@
;;; Copyright © 2023 Ott Joon <oj@vern.cc>
;;; Copyright © 2023 Dominik Delgado Steuter <dds@disroot.org>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
+;;; Copyright © 2023 Jaeme Sifat <jaeme@runbox.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -116,6 +117,7 @@ (define-module (gnu packages video)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
+ #:use-module (gnu packages bittorrent)
#:use-module (gnu packages boost)
#:use-module (gnu packages cdrom)
#:use-module (gnu packages check)
@@ -194,6 +196,7 @@ (define-module (gnu packages video)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages ssh)
#:use-module (gnu packages swig)
+ #:use-module (gnu packages terminals)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages textutils)
#:use-module (gnu packages tls)
@@ -209,6 +212,60 @@ (define-module (gnu packages video)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg))
+(define-public ani-cli
+ (package
+ (name "ani-cli")
+ (version "4.6")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pystardust/ani-cli")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1ni9pzjb5qh87iz7c8252bx79qadr1qx6jnkqvvjcqrchh7q473a"))))
+ (build-system copy-build-system)
+ (arguments
+ (list
+ #:install-plan #~'(("ani-cli" "bin/")
+ ("ani-cli.1" "share/man/man1/"))
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'install 'wrap
+ (lambda* (#:key inputs #:allow-other-keys)
+ (define (bin command)
+ (dirname (search-input-file inputs
+ (string-append "bin/"
+ command))))
+ (wrap-program (string-append #$output "/bin/ani-cli")
+ `("PATH" ":" prefix
+ ,(map bin
+ (list "aria2c"
+ "curl"
+ "ffmpeg"
+ "fzf"
+ "grep"
+ "mpv"
+ "sed"
+ "uname"
+ "yt-dlp")))))))))
+ (home-page "https://github.com/pystardust/ani-cli")
+ (synopsis "CLI to browse and watch anime")
+ (description
+ "ani-cli is a command-line interface (CLI) to browse and watch anime. It
+provides an easy way to stream shows using allanime as a source. There are
+different features such as episode browsing, history tracking, streaming at
+multiple resolutions and much more depending on what programs the user has
+installed.")
+ (inputs (list aria2
+ coreutils
+ curl
+ ffmpeg
+ fzf
+ mpv
+ yt-dlp))
+ (license license:gpl3)))
+
(define-public transcode
(package
(name "transcode")

base-commit: 33f5b747b4a0a508e1ffc94a5bf425cff707c6e3
--
2.34.1
T
T
Tobias Geerinckx-Rice wrote on 28 Oct 2023 23:35
(address . control@debbugs.gnu.org)
53f34a671881e12f5e5e4d47502b5469@tobias.gr
merge 66694 66708
T
T
Tobias Geerinckx-Rice wrote on 29 Oct 2023 00:46
Re: [bug#66694] [PATCH] gnu: Add ani-cli
(address . 66694@debbugs.gnu.org)
878r7me3xe.fsf@nckx
Hi Jaeme,

Thanks for submitting this package! I've attached my revision
below.

We don't sign off on our own patches in Guix. Our Signed-off-by
does not have the same DCO meaning as it does for, e.g., Linux.
Ours is merely a stamp of approval by a committer.

+(define-public ani-cli
+ (package
+ (name "ani-cli")
+ (version "4.6")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
"1ni9pzjb5qh87iz7c8252bx79qadr1qx6jnkqvvjcqrchh7q473a"))))
+ (build-system copy-build-system)

So… uhm.

Apparently the copy-build-system doesn't acknowledge the existence
of cross compilation, like, at all?

This is a bug in Guix, not you, but here I switched to the
gnu-build-system to avoid it.

+ (wrap-program (string-append #$output
"/bin/ani-cli")
+ `("PATH" ":" prefix
+ ,(map bin
+ (list "aria2c"
+ "curl"
+ "ffmpeg"
+ "fzf"
+ "grep"
+ "mpv"
+ "sed"
+ "uname"
+ "yt-dlp")))))))))

I added "tput" to this list. While the script appears to be
usable without it, it spits out ugly errors and might misbehave.

+ (synopsis "CLI to browse and watch anime")
+ (description
+ "ani-cli is a command-line interface (CLI) to browse and
watch anime. It
+provides an easy way to stream shows using allanime as a source.
There are
+different features such as episode browsing, history tracking,
streaming at
+multiple resolutions and much more depending on what programs the
user has
+installed.")

I took the liberty of rewriting this a bit, including my previous
@uref suggestion.

+ (inputs (list aria2
+ coreutils
+ curl
+ ffmpeg
+ fzf
+ mpv
+ yt-dlp))

Besides ncurses for tput, I added grep and sed for the wrapper.
This will matter when the package cross-builds: you don't want the
script calling the build-time ‘native’ grep at run time.

I also added bash-minimal at ‘guix lint’'s suggestion.

We conventionally put fields in this order:

source
build-system
arguments
native-inputs
inputs
propagated-inputs
home-page
synopsis
description
license

This is not a hard rule and you'll find variants, but I moved the
inputs to their conventional location above the Metadata Zone.

+ (license license:gpl3)))

As noted in #guix, I changed this to GPL3+ due to the ‘or (at your
option) any later version’ wording.

Here's a random Deep Guix Thing that I'm too tired to explain
further: because this script invokes curl, and to avoid
propagating curl, I added a copy of one of our curl package's
native-search-paths. This makes the script work inside a --pure
guix shell, as long as you include nss-certs.

I do wonder: just how legal is this script, and the one Web site
to which it's tightly bound?

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCZT2Vng0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15dCoA/RZoCZWngoXGkCQWvbzZQ1o5YjnIyO3W/XdwO1am
qSBBAP4ptJ0Tsv6rhAVnpNqKIFD5lHsy8YT6jxvmNkgPD7OOBA==
=4YLM
-----END PGP SIGNATURE-----

J
Re: [bug#66694] Revision
(address . 66694@debbugs.gnu.org)(address . me@tobias.gr)
c90f6525-fcce-4006-be25-d65c84e6cdfc@runbox.com
Hello T,


T wrote:

> We don't sign off on our own patches in Guix. Our Signed-off-by does
not have the same DCO meaning as it does for, e.g., Linux. Ours is
merely a stamp of approval by a committer.

I see, I do wish I knew that earlier before sending my other patches.
Maybe that should be written somewhere in the Contributing section of
the Guix manual because I have my ~/.gitconfig automatically add the
signed-off line to all my commits. Thank you for mentioning that.


T wrote:

> Apparently the copy-build-system doesn't acknowledge the existence of
cross compilation, like, at all?

That not surprisingly went over my head. Can you tell me how you
discovered that? I would like to know.


T wrote:

> ...you don't want the  script calling the build-time ‘native’ grep at
run time.

Noted (still learning lots').


T wrote:

> I also added bash-minimal at ‘guix lint’'s suggestion.

I also saw that suggestion but I didn't add it since I already had
coreutils which in my mind eclipsed bash-minimal.


T wrote:

> we conventionally put fields in this order:

Duly Noted.


T wrote:

> Here's a random Deep Guix Thing that I'm too tired to explain further:

I remember reading about 'search-native-paths' in a Guix blog, I'm glad
the --pure situation is cleared up.


T wrote:

> I do wonder: just how legal is this script, and the one Web site to
which it's tightly bound?

other third-party packagers: Debian, Ubuntu, Gentoo as well as nixpkgs
have this script in their repositories. In addition, disclaimer.md
posits that ani-cli can be thought of as a browser/wrapper rather than
being a direct source for copyrighted content. We don't know when the
website(s) will stop working but we can assume that the script will be
updated as well as it's fairly active and popular in the GNU/Linux
world. But to offer a more principled rebuttal, yt-dlp also has this
similar issue of relying on a nonfree, non-federated network service
(google videos/YouTube). However, one of the niches of yt-dlp is that it
offers a way for users to stream/download videos hosted on YouTube
without having to load the proprietary JS through their web browser.
This package could serve a similar purpose to guix users as it's much
safer to stream content directly rather than having to connect to and
load the website (if it is possible at all with GNU Icecat) via web
browser.


On a side note, this is my first time interacting with a mailing
list/submitting patches. I have a lot of growing pains to get through.


Thanks,

Jaeme
J
J
Jaeme Sifat wrote on 14 Nov 2023 19:00
Update on ani-cli?
(address . 66694@debbugs.gnu.org)(address . me@tobias.gr)
9c626928-898b-4c29-a716-f51eb4f9dddd@runbox.com
Hi,

There hasn't been any activity on this issue for a while now and my
patch hasn't been merged yet.

Respond Soon,

Jaeme
J
J
Jaeme Sifat wrote on 28 Nov 2023 15:27
(no subject)
(address . control@debbugs.gnu.org)
8538929f-5400-45c5-a4c7-fd07086fc761@runbox.com
close 66694
?