From unknown Wed Jun 18 23:16:09 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#49238 <49238@debbugs.gnu.org> To: bug#49238 <49238@debbugs.gnu.org> Subject: Status: Ytfzf Reply-To: bug#49238 <49238@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:16:09 +0000 retitle 49238 Ytfzf reassign 49238 guix-patches submitter 49238 Raghav Gururajan severity 49238 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 27 01:44:44 2021 Received: (at submit) by debbugs.gnu.org; 27 Jun 2021 05:44:44 +0000 Received: from localhost ([127.0.0.1]:48868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxNb2-0000rR-HP for submit@debbugs.gnu.org; Sun, 27 Jun 2021 01:44:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:47908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxNb1-0000rK-6g for submit@debbugs.gnu.org; Sun, 27 Jun 2021 01:44:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxNaz-0005H2-Pi for guix-patches@gnu.org; Sun, 27 Jun 2021 01:44:42 -0400 Received: from out0.migadu.com ([2001:41d0:2:267::]:45048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxNaw-0005SK-4k for guix-patches@gnu.org; Sun, 27 Jun 2021 01:44:41 -0400 To: guix-patches@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1624772669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=yBK7uRIuH63O+NiS4K4PR8Uj5a4l2JmINjNKH86AECY=; b=jwJiA+3usK9xfzMz9t9gWdBQyXo8Ru96yK+IeHuJSin0nNhiG8niWM7q6aREiBxPC8J11J ukPAXsv1Vh/yFNBtN8n8NilQ/m0RIBZ13iljwIMOKhRZjrAR///LsYVSTxpUiyUCkJGaod o6/cyjXKH8ILDOTsLGxy1Hl2beAHbcs9c+Ro1tuvv/48NZEh5EIq0HC11egqYcjL3a8n5b eOONi6QITtpvDwjdjuNegOwxnuceUGKGYIcz8Y/x76bnuECkE09jhVXog9kJe5ODJaI6xw WhqqH4lKfIcT4ybcCmiBOI9EGWd18XemnftBd6GFcbl7PoUVIKu6nWz55z1/xw== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Raghav Gururajan Subject: Ytfzf Message-ID: Date: Sun, 27 Jun 2021 01:44:26 -0400 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lCCh5eRSyCnmQUqBmDf2VtBd3qqznug90" X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name Received-SPF: pass client-ip=2001:41d0:2:267::; envelope-from=rg@raghavgururajan.name; helo=out0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: jgart@dismail.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lCCh5eRSyCnmQUqBmDf2VtBd3qqznug90 Content-Type: multipart/mixed; boundary="0gtLXDcP4ZS0WXAS7G2rzYqvOO997nyaA"; protected-headers="v1" From: Raghav Gururajan To: guix-patches@gnu.org Cc: jgart@dismail.de Message-ID: Subject: Ytfzf --0gtLXDcP4ZS0WXAS7G2rzYqvOO997nyaA Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: quoted-printable Hello Guix! This is the patch-series to package Ytfzf, which is a joint effort by=20 Jorge (jgart) and I, as a part of LibreMiami. The Ytfzf app is being placed in image-viewer.scm, as placing it in=20 video.scm causes conflict somewhere while importing image-viewer.scm. Regards, RG. --0gtLXDcP4ZS0WXAS7G2rzYqvOO997nyaA-- --lCCh5eRSyCnmQUqBmDf2VtBd3qqznug90 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTNLV6qqYzLN9qR1rBfWBZkf4vlUQUCYNgQOgUDAAAAAAAKCRBfWBZkf4vlUasN AP9RE5yg5vieTjOt/CMlnB+EAY8J/lnupB1Wm3eOGNmZ9gEA8HZlEfm97Zv3pxP4Q6Q3sFWHHIU8 GgYfPw8Syu7bpAs= =6wTr -----END PGP SIGNATURE----- --lCCh5eRSyCnmQUqBmDf2VtBd3qqznug90-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 27 01:48:10 2021 Received: (at 49238) by debbugs.gnu.org; 27 Jun 2021 05:48:10 +0000 Received: from localhost ([127.0.0.1]:48876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxNeH-0000xr-VX for submit@debbugs.gnu.org; Sun, 27 Jun 2021 01:48:10 -0400 Received: from out2.migadu.com ([188.165.223.204]:59686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxNeF-0000xi-Vi for 49238@debbugs.gnu.org; Sun, 27 Jun 2021 01:48:04 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1624772882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=63KLb7NOCx6zfECsIvcFgFGBpJ90vMtMYET+9KU0sl0=; b=CoGh60bX9QzF95yXEPoAWmjp8PEuPXLUf1MSwixuKFsyWEBsyTrXrb0ihahptbkW6uD4DC VTk2CZDBmXkGCNX9KB4DA175m/Ja8ahyDxj6w+lUqV17SgfViTQcy1WxmJ3doSU3nv8iZ1 2D+1sPGg7yEvVFNndjjz7Vh30Ve69+NF/X47jTJs8+hNHY9tV0WNGtNdsXW6eaPUJ5blpK ogBVVnLDRezsVqa7ZQjD20ny9abzeA3MuMD1bnQGH1D7cZyUEQxCQrpu1KqEa1xWzQyR28 7iyrZRFYxFprpBqwrB51D7pSfJFYFlF3fEBv6qXqtWOi+2wpYimJmpco/ErKvQ== From: Raghav Gururajan To: 49238@debbugs.gnu.org Subject: [PATCH v1 1/2] gnu: Add python-ueberzug. Date: Sun, 27 Jun 2021 01:47:36 -0400 Message-Id: <20210627054737.7972-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: LibreMiami * gnu/packages/python-xyz.scm (python-ueberzug): New variable. Co-authored-by: Raghav Gururajan Co-authored-by: jgart --- gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insert [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [188.165.223.204 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 49238 Cc: Raghav Gururajan , jgart@dismail.de, LibreMiami X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) From: LibreMiami * gnu/packages/python-xyz.scm (python-ueberzug): New variable. Co-authored-by: Raghav Gururajan Co-authored-by: jgart --- gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 7dae6607a0..41761d8b7a 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -101,6 +101,7 @@ ;;; Copyright © 2021 LibreMiami ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Raghav Gururajan +;;; Copyright © 2021 jgart ;;; Copyright © 2021 Danial Behzadi ;;; ;;; This file is part of GNU Guix. @@ -221,6 +222,42 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26)) +(define-public python-ueberzug + (package + (name "python-ueberzug") + (version "18.1.9") + (source + (origin + (method url-fetch) + (uri (pypi-uri "ueberzug" version)) + (sha256 + (base32 + "1hxd45dnwa9yv908acarr98n2drmar66wzq9z2qd3irj24srzr3w")))) + (build-system python-build-system) + (inputs + `(("libx11" ,libx11) + ("libxext" ,libxext))) + (propagated-inputs + `(("python-attrs" ,python-attrs) + ("python-docopt" ,python-docopt) + ("python-pillow" ,python-pillow) + ("python-xlib" ,python-xlib))) + (home-page "https://github.com/seebye/ueberzug") + (synopsis "Command line util to display images in combination with X11") + (description "Überzug is a command line util which allows to draw images on +terminals by using child windows. The advantages of using Überzug are: +@itemize +@item No race conditions as a new window is created to display images. +@item Expose events will be processed, so images will be redrawn on switch +workspaces. +@item Tmux support (excluding multi pane windows). +@item Terminals without the WINDOWID environment variable are supported. +@item Chars are used as position - and size unit. +@item No memory leak (/ unlimited cache). +@end itemize") + (license license:gpl3+))) + + (define-public python-fire (package (name "python-fire") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 27 01:48:16 2021 Received: (at 49238) by debbugs.gnu.org; 27 Jun 2021 05:48:16 +0000 Received: from localhost ([127.0.0.1]:48878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxNeM-0000y3-4d for submit@debbugs.gnu.org; Sun, 27 Jun 2021 01:48:16 -0400 Received: from out2.migadu.com ([188.165.223.204]:59699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxNeH-0000xk-3W for 49238@debbugs.gnu.org; Sun, 27 Jun 2021 01:48:07 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1624772883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6l5WP1f9yk3D8vk1H0N6ZKE7r6ywA8moSj4W7XXX3ZI=; b=l34X5ktL7IxTvBnILNSoj0lKlJj/6zn1VR8mtgIaTmfk6f2MroRPwFSWvlhEpKZvPCiIxN /au1IgUIPUDeM8Fxg5/VhYOgMfO0OppFJ5mAwZ3S8xiwoljNAH3Db02l9EY3896wgiwmr/ 9jW4XIilwGW/Nrq5wpHkd6Zmo1i0iPjE6YeBF0hToStC+Tu2CsuwtSXhLMxJhVMGY2TuUA TFcv7CXSq71y+tW9Zd9Y0gqU625ft+AWHpIAUkmcDjFbbF537w08HP097UtPkTTNyY660Z QKchMrXz7Iz7o4PW8idyotV4C/rB0B2xlsVhfLrgcFhukgA9c9V+goUwpBGGnQ== From: Raghav Gururajan To: 49238@debbugs.gnu.org Subject: [PATCH v1 2/2] gnu: Add ytfzf. Date: Sun, 27 Jun 2021 01:47:37 -0400 Message-Id: <20210627054737.7972-2-rg@raghavgururajan.name> In-Reply-To: <20210627054737.7972-1-rg@raghavgururajan.name> References: <20210627054737.7972-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: LibreMiami * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: Raghav Gururajan Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 102 ++++++ gnu/packages/patches/ytfzf-progra [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [188.165.223.204 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 49238 Cc: Raghav Gururajan , jgart@dismail.de, LibreMiami X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) From: LibreMiami * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: Raghav Gururajan Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 102 ++++++ gnu/packages/patches/ytfzf-programs.patch | 372 ++++++++++++++++++++++ gnu/packages/patches/ytfzf-updates.patch | 41 +++ 4 files changed, 517 insertions(+) create mode 100644 gnu/packages/patches/ytfzf-programs.patch create mode 100644 gnu/packages/patches/ytfzf-updates.patch diff --git a/gnu/local.mk b/gnu/local.mk index f507fe566f..d494663f8e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1856,6 +1856,8 @@ dist_patch_DATA = \ %D%/packages/patches/xsane-support-ipv6.patch \ %D%/packages/patches/xsane-tighten-default-umask.patch \ %D%/packages/patches/yggdrasil-extra-config.patch \ + %D%/packages/patches/ytfzf-programs.patch \ + %D%/packages/patches/ytfzf-updates.patch \ %D%/packages/patches/ytnef-CVE-2021-3403.patch \ %D%/packages/patches/ytnef-CVE-2021-3404.patch \ %D%/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch \ diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm index f01b6a614a..ccbbb3bc2d 100644 --- a/gnu/packages/image-viewers.scm +++ b/gnu/packages/image-viewers.scm @@ -18,6 +18,8 @@ ;;; Copyright © 2021 Rovanion Luckey ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Stefan Reichör +;;; Copyright © 2021 Raghav Gururajan +;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. ;;; @@ -46,6 +48,7 @@ #:use-module (guix build-system python) #:use-module (gnu packages autotools) #:use-module (gnu packages algebra) + #:use-module (gnu packages base) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -64,6 +67,7 @@ #:use-module (gnu packages image-processing) #:use-module (gnu packages imagemagick) #:use-module (gnu packages maths) + #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages photo) @@ -71,10 +75,108 @@ #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) + #:use-module (gnu packages suckless) + #:use-module (gnu packages terminals) + #:use-module (gnu packages video) + #:use-module (gnu packages web) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) #:use-module (gnu packages)) +(define-public ytfzf + (package + (name "ytfzf") + (version "1.2.0") + (home-page "https://github.com/pystardust/ytfzf") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url home-page) + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "00d416qb4109pm77ikhnmds8qng90ni2jan9kdnxz7b6sh5f61nz")) + (patches + (search-patches + ;; Prerequisite for 'patch phase. + "ytfzf-programs.patch" + ;; Disables self-update. + "ytfzf-updates.patch")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no test suite + #:modules + ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Use correct $PREFIX path. + (substitute* "Makefile" + (("/usr/bin") + (format #f "~a/bin" + (assoc-ref outputs "out")))) + ;; Use absolute path to referenced programs. + (substitute* "ytfzf" + (("guix-catimg") + (format #f "~a/bin/catimg" + (assoc-ref inputs "catimg"))) + (("guix-chafa") + (format #f "~a/bin/chafa" + (assoc-ref inputs "chafa"))) + (("guix-curl") + (format #f "~a/bin/curl" + (assoc-ref inputs "curl"))) + (("guix-dmenu") + (format #f "~a/bin/dmenu" + (assoc-ref inputs "dmenu"))) + (("guix-fzf") + (format #f "~a/bin/fzf" + (assoc-ref inputs "fzf"))) + (("guix-jp2a") + (format #f "~a/bin/jp2a" + (assoc-ref inputs "jp2a"))) + (("guix-jq") + (format #f "~a/bin/jq" + (assoc-ref inputs "jq"))) + (("guix-mpv") + (format #f "~a/bin/mpv" + (assoc-ref inputs "mpv"))) + (("guix-notify-send") + (format #f "~a/bin/notify-send" + (assoc-ref inputs "libnotify"))) + (("guix-tput") + (format #f "~a/bin/tput" + (assoc-ref inputs "ncurses"))) + (("guix-ueberzug") + (format #f "~a/bin/ueberzug" + (assoc-ref inputs "python-ueberzug"))) + (("guix-youtube-dl") + (format #f "~a/bin/youtube-dl" + (assoc-ref inputs "youtube-dl")))))) + (delete 'configure)))) ;no configure script + (inputs + `(("catimg" ,catimg) + ("chafa" ,chafa) + ("curl" ,curl) + ("dmenu" ,dmenu) + ("fzf" ,fzf) + ("jp2a" ,jp2a) + ("jq" ,jq) + ("libnotify" ,libnotify) + ("mpv" ,mpv) + ("ncurses" ,ncurses) + ("python-ueberzug" ,python-ueberzug) + ("youtube-dl" ,youtube-dl))) + (synopsis "Find and watch PeerTube or YouTube videos from the terminal") + (description "@code{ytfzf} is a POSIX script that helps you find PeerTube or +YouTube videos without requiring API and opens/downloads them using mpv/ytdl.") + (license license:gpl3+))) + (define-public feh (package (name "feh") diff --git a/gnu/packages/patches/ytfzf-programs.patch b/gnu/packages/patches/ytfzf-programs.patch new file mode 100644 index 0000000000..f744c19aeb --- /dev/null +++ b/gnu/packages/patches/ytfzf-programs.patch @@ -0,0 +1,372 @@ +From a5ed861c4d1ee0902650eb6aa68c5ffa17e7fa48 Mon Sep 17 00:00:00 2001 +From: LibreMiami +Date: Sat, 26 Jun 2021 20:23:11 -0400 +Subject: [PATCH 1/2] Modify the strings of referenced programs. + +Prefix the strings of referenced programs with the string "guix-", so that they +can be easily substituted with absolute paths using a custom-phase. +--- + ytfzf | 110 +++++++++++++++++++++++++++++----------------------------- + 1 file changed, 55 insertions(+), 55 deletions(-) + +diff --git a/ytfzf b/ytfzf +index f4d2e0d..28e320b 100755 +--- a/ytfzf ++++ b/ytfzf +@@ -49,19 +49,19 @@ cache_dir=${YTFZF_CACHE-${cache_dir-$HOME/.cache/ytfzf}} + #video type preference (mp4/1080p, mp4/720p, etc..) + video_pref=${YTFZF_PREF-${video_pref-}} + #the menu to use instead of fzf when -D is specified +-external_menu=${YTFZF_EXTMENU-${external_menu-dmenu -i -l 30 -p Search:}} ++external_menu=${YTFZF_EXTMENU-${external_menu-guix-dmenu -i -l 30 -p Search:}} + #number of columns (characters on a line) the external menu can have + #necessary for formatting text for external menus + external_menu_len=${YTFZF_EXTMENU_LEN-${external_menu_len-220}} + #player settings (players need to support streaming with youtube-dl) + #player to use for watching the video +-video_player=${YTFZF_PLAYER-${video_player-mpv}} ++video_player=${YTFZF_PLAYER-${video_player-guix-mpv}} + #if YTFZF_PREF is specified, use this player instead +-video_player_format=${YTFZF_PLAYER_FORMAT-${video_player_format-mpv --ytdl-format=}} ++video_player_format=${YTFZF_PLAYER_FORMAT-${video_player_format-guix-mpv --ytdl-format=}} + #player to use for audio only +-audio_player=${YTFZF_AUDIO_PLAYER-${audio_player-mpv --no-video}} ++audio_player=${YTFZF_AUDIO_PLAYER-${audio_player-guix-mpv --no-video}} + #the command to use for displaying thumbnails +-thumb_disp_method=${YTFZF_THUMB_DISP_METHOD-${thumb_disp_method-ueberzug}} ++thumb_disp_method=${YTFZF_THUMB_DISP_METHOD-${thumb_disp_method-guix-ueberzug}} + #Storing the argument and location for autogenerated subtitles + [ -z "$YTFZF_SUBT_NAME" ] && YTFZF_SUBT_NAME="" + #Stores the language for the auto genereated subtitles +@@ -177,12 +177,12 @@ dep_ck () { + done + unset Dep + } +-dep_ck "jq" "youtube-dl" "curl" ++dep_ck "guix-jq" "guix-youtube-dl" "guix-curl" + + + #only check for mpv if $YTFZF_PLAYER is set to it + #don't check $YTFZF_PLAYER as it could be multiple commands +-[ "$video_player" = "mpv" ] && dep_ck "mpv" ++[ "$video_player" = "guix-mpv" ] && dep_ck "guix-mpv" + + ############################ + # Help Texts # +@@ -326,8 +326,8 @@ print_info () { + } + + print_error () { +- [ $ext_menu_notifs -eq 1 ] && notify-send "error" "$*" || printf "\033[31m$*\033[0m" >&2 +- [ $ext_menu_notifs -eq 1 ] && notify-send "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" || printf "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" >&2 ++ [ $ext_menu_notifs -eq 1 ] && guix-notify-send "error" "$*" || printf "\033[31m$*\033[0m" >&2 ++ [ $ext_menu_notifs -eq 1 ] && guix-notify-send "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" || printf "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" >&2 + } + + ############################ +@@ -398,8 +398,8 @@ format_fzf () { + format_menu () { + if [ "$is_ext_menu" -eq 0 ]; then + #dep_ck fzf here because it is only necessary to use here +- dep_ck "fzf" +- menu_command='column -t -s "$tab_space" | fzf -m --bind change:top --tabstop=1 --layout=reverse --delimiter="$tab_space" --nth=1,2 --expect="$shortcuts" $FZF_DEFAULT_OPTS' ++ dep_ck "guix-fzf" ++ menu_command='column -t -s "$tab_space" | guix-fzf -m --bind change:top --tabstop=1 --layout=reverse --delimiter="$tab_space" --nth=1,2 --expect="$shortcuts" $FZF_DEFAULT_OPTS' + format_fzf + else + # Dmenu doesn't render tabs so removing it +@@ -462,7 +462,7 @@ WIDTH=$FZF_PREVIEW_COLUMNS + HEIGHT=$FZF_PREVIEW_LINES + start_ueberzug () { + [ -e $FIFO ] || { mkfifo "$FIFO" || exit 1 ; } +- ueberzug layer --parser json --silent < "$FIFO" & ++ guix-ueberzug layer --parser json --silent < "$FIFO" & + exec 3>"$FIFO" + } + stop_ueberzug () { +@@ -476,12 +476,12 @@ preview_img () { + shorturl=${args##*${tab_space}|} + shorturl="${shorturl%% *}" + +- json_obj=$(printf "%s" "$videos_json" | jq '.[]|select( .videoID == "'"$shorturl"'")') ++ json_obj=$(printf "%s" "$videos_json" | guix-jq '.[]|select( .videoID == "'"$shorturl"'")') + + + IFS=$tab_space read -r title channel duration views date description <<-EOF + $( +- printf "%s" "$json_obj" | jq -r \ ++ printf "%s" "$json_obj" | guix-jq -r \ + ' + [.title,.channel,.duration,.views,.date,.description]|@tsv + ' +@@ -530,31 +530,31 @@ preview_img () { + } > "$FIFO" ;; + catimg) + printf "\n" +- catimg -w "$((thumb_width * 2))" "$IMAGE" ;; ++ guix-catimg -w "$((thumb_width * 2))" "$IMAGE" ;; + jp2a) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=24 "$IMAGE" ;; ++ guix-jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=24 "$IMAGE" ;; + jp2a-8) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=8 "$IMAGE" ;; ++ guix-jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=8 "$IMAGE" ;; + jp2a-4) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=4 "$IMAGE" ;; ++ guix-jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=4 "$IMAGE" ;; + jp2a-gray|jp2a-grey) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" "$IMAGE" ;; ++ guix-jp2a --size="${thumb_width}x$((thumb_height / 2))" "$IMAGE" ;; + chafa) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" "$IMAGE" ;; ++ guix-chafa --size="${thumb_width}x${thumb_height}" "$IMAGE" ;; + chafa-gray|chafa-grey) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=2 "$IMAGE" ;; ++ guix-chafa --size="${thumb_width}x${thumb_height}" --colors=2 "$IMAGE" ;; + chafa-4) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=16 "$IMAGE" ;; ++ guix-chafa --size="${thumb_width}x${thumb_height}" --colors=16 "$IMAGE" ;; + chafa-8) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=256 "$IMAGE" ;; ++ guix-chafa --size="${thumb_width}x${thumb_height}" --colors=256 "$IMAGE" ;; + custom) + if ! function_exists "handle_display_img"; then + printf "\033[031mERROR[#07]: \033[0m\033[1mhandle_display_img\033[0m is not defined" >&2 +@@ -585,17 +585,17 @@ download_thumbnails () { + if [ "$thumbnail_quality" -eq 1 ]; then + image_download () { + # higher quality images +- curl -s "$Url" -G --data-urlencode "sqp=" > "$thumb_dir/$Name.png" ++ guix-curl -s "$Url" -G --data-urlencode "sqp=" > "$thumb_dir/$Name.png" + } + else + image_download () { +- curl -s "$Url" > "$thumb_dir/$Name.png" ++ guix-curl -s "$Url" > "$thumb_dir/$Name.png" + } + fi + + print_info "Downloading Thumbnails...\n" + thumb_urls=$(printf "%s" "$*" |\ +- jq -r '.[]|[.thumbs,.videoID]|@tsv' ) ++ guix-jq -r '.[]|[.thumbs,.videoID]|@tsv' ) + + while IFS=$tab_space read -r Url Name; do + sleep 0.001 +@@ -668,7 +668,7 @@ get_yt_html () { + link=$1 + query=$2 + printf "%s" "$( +- curl "$link" -s \ ++ guix-curl "$link" -s \ + -G --data-urlencode "search_query=$query" \ + -G --data-urlencode "sp=$sp" \ + -H 'Authority: www.youtube.com' \ +@@ -684,7 +684,7 @@ get_video_data () { + # outputs tab and pipe separated fields: title, channel, view count, video length, video upload date, and the video id/url + # from the videos_json + printf "%s" "$*" |\ +- jq -r '.[]| "\(.title)'"$tab_space"'|\(.channel)'"$tab_space"'|\(.views)'"$tab_space"'|\(.duration)'"$tab_space"'|\(.date)'"$tab_space"'|\(.videoID)"' ++ guix-jq -r '.[]| "\(.title)'"$tab_space"'|\(.channel)'"$tab_space"'|\(.views)'"$tab_space"'|\(.duration)'"$tab_space"'|\(.date)'"$tab_space"'|\(.videoID)"' + } + + scrape_channel () { +@@ -723,7 +723,7 @@ scrape_channel () { + + #gets a list of videos + videos_json=$(printf "%s" "$yt_json" |\ +- jq '[ .contents | ..|.gridVideoRenderer? | ++ guix-jq '[ .contents | ..|.gridVideoRenderer? | + select(. !=null) | + { + title: .title.runs[0].text, +@@ -736,7 +736,7 @@ scrape_channel () { + } + ]') + +- videos_json=$(printf "%s" "$videos_json" | jq '.[0:'$sub_link_count']') ++ videos_json=$(printf "%s" "$videos_json" | guix-jq '.[0:'$sub_link_count']') + printf "%s\n" "$videos_json" >> "$tmp_video_json_file" + #checks if it's empty in case it was defined in a config function eg: on_get_search + [ -z "$videos_data" ] && videos_data=$(get_video_data "$videos_json") +@@ -768,11 +768,11 @@ get_trending_url_data () { + scrape_pt () { + #gets a list of videos + pt_json=$( +- curl \ ++ guix-curl \ + -s "https://sepiasearch.org/api/v1/search/videos" \ + -G --data-urlencode "search=$*") + videos_json=$(printf "%s" "$pt_json" |\ +- jq '[ .data | .[] | ++ guix-jq '[ .data | .[] | + { + title: .name, + channel: .channel.displayName, +@@ -829,7 +829,7 @@ scrape_yt () { + fi + + #gets a list of videos +- videos_json=$(printf "%s" "$yt_json" | jq '[ .contents| ++ videos_json=$(printf "%s" "$yt_json" | guix-jq '[ .contents| + ..|.videoRenderer? | + select(. !=null) | + { +@@ -844,7 +844,7 @@ scrape_yt () { + } + ]') + +- playlist_json=$(printf "%s" "$yt_json" | jq '[ .contents| ++ playlist_json=$(printf "%s" "$yt_json" | guix-jq '[ .contents| + ..|.playlistRenderer? | + select(. !=null) | + { +@@ -919,16 +919,16 @@ user_selection () { + + #show thumbnail menu + elif [ "$show_thumbnails" -eq 1 ] ; then +- dep_ck "ueberzug" "fzf" ++ dep_ck "guix-ueberzug" "guix-fzf" + export YTFZF_THUMB_DISP_METHOD="$thumb_disp_method" +- [ "$thumb_disp_method" = "ueberzug" ] && start_ueberzug ++ [ "$thumb_disp_method" = "guix-ueberzug" ] && start_ueberzug + #thumbnails only work in fzf, use fzf +- menu_command="fzf -m --tabstop=1 --bind change:top --delimiter=\"$tab_space\" \ ++ menu_command="guix-fzf -m --tabstop=1 --bind change:top --delimiter=\"$tab_space\" \ + --nth=1,2 --expect='$shortcuts' $FZF_DEFAULT_OPTS \ + --layout=reverse --preview \"sh $0 -U {}\" \ + --preview-window \"$PREVIEW_SIDE:50%:noborder:wrap\"" + selected_data=$( title_len=200 video_menu "$videos_data" ) +- [ "$thumb_disp_method" = "ueberzug" ] && stop_ueberzug ++ [ "$thumb_disp_method" = "guix-ueberzug" ] && stop_ueberzug + # Deletes thumbnails if no video is selected + [ -z "$selected_data" ] && clean_up + #show regular menu +@@ -988,7 +988,7 @@ format_user_selection () { + 11) selected_urls=$selected_urls$new_line'https://www.youtube.com/watch?v='$surl ;; + 34) selected_urls=$selected_urls$new_line'https://www.youtube.com/playlist?list='$surl ;; + 36) +- selected_urls=$selected_urls$new_line"$(printf "%s" "$videos_json" | jq '.[].url' | grep -F "$surl" | tr -d '"')" ;; ++ selected_urls=$selected_urls$new_line"$(printf "%s" "$videos_json" | guix-jq '.[].url' | grep -F "$surl" | tr -d '"')" ;; + *) continue ;; + esac + refined_selected_data=$refined_selected_data$new_line$(printf '%s' "$videos_data" | grep "|$surl" ) +@@ -1014,7 +1014,7 @@ print_data () { + get_video_format () { + # select format if flag given + [ $show_format -eq 0 ] && return +- formats=$(youtube-dl -F "$(printf "$selected_urls")") ++ formats=$(guix-youtube-dl -F "$(printf "$selected_urls")") + line_number=$(printf "$formats" | grep -n '.*extension resolution.*' | cut -d: -f1) + quality=$(printf "$formats \n1 2 xAudio" | awk -v lineno=$line_number 'FNR > lineno {print $3}' | sort -n | awk -F"x" '{print $2 "p"}' | uniq | sed -e "s/Audiop/Audio/" -e "/^p$/d" | eval "$menu_command" | sed "s/p//g") + [ -z "$quality" ] && exit; +@@ -1026,9 +1026,9 @@ get_video_format () { + get_sub_lang () { + if [ $auto_caption -eq 1 ]; then + #Gets the auto generated subs and stores them in a file +- sub_list=$(youtube-dl --list-subs --write-auto-sub "$selected_urls" | sed '/Available subtitles/,$d' | awk '{print $1}' | sed '1d;2d;3d') ++ sub_list=$(guix-youtube-dl --list-subs --write-auto-sub "$selected_urls" | sed '/Available subtitles/,$d' | awk '{print $1}' | sed '1d;2d;3d') + if [ -n "$sub_list" ]; then +- [ -n "$selected_sub" ] || selected_sub=$(printf "$sub_list" | eval "$menu_command") && youtube-dl --sub-lang $selected_sub --write-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NAME="--sub-file=/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated subs not available." ++ [ -n "$selected_sub" ] || selected_sub=$(printf "$sub_list" | eval "$menu_command") && guix-youtube-dl --sub-lang $selected_sub --write-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NAME="--sub-file=/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated subs not available." + fi + unset sub_list + fi +@@ -1064,9 +1064,9 @@ open_player () { + fi + elif [ $is_download -eq 1 ]; then + if [ -z "$video_pref" ]; then +- youtube-dl "$@" "$YTFZF_SUBT_NAME" ++ guix-youtube-dl "$@" "$YTFZF_SUBT_NAME" + else +- youtube-dl -f "$video_pref" "$@" $YTFZF_SUBT_NAME || video_pref= open_player "$@" ++ guix-youtube-dl -f "$video_pref" "$@" $YTFZF_SUBT_NAME || video_pref= open_player "$@" + fi + fi + } +@@ -1200,7 +1200,7 @@ search_history_menu () { + #when using an external menu, the search history will be done there + choice=$( printf "%s\n" "$search_history" | eval "$external_menu" ) + else +- choice="$( printf "%s\n" "$search_history" | fzf --prompt="$search_history_prompt" --print-query --no-multi -d '\t' --with-nth=2.. --expect='alt-enter' --bind='tab:replace-query' )" ++ choice="$( printf "%s\n" "$search_history" | guix-fzf --prompt="$search_history_prompt" --print-query --no-multi -d '\t' --with-nth=2.. --expect='alt-enter' --bind='tab:replace-query' )" + fi + + # first line is the fzf query (what the user types in fzf) +@@ -1244,7 +1244,7 @@ search_history_menu () { + + #if downloading, say Downloading not currently playing + [ $is_download -eq 1 ] && title="Downloading" || title="Currently playing" +- notify-send "$title" "$message" -i "$video_thumb" ++ guix-notify-send "$title" "$message" -i "$video_thumb" + + unset message video_thumb title + } +@@ -1262,7 +1262,7 @@ EOF + update_ytfzf () { + branch="$1" + updatefile="/tmp/ytfzf-update" +- curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile" ++ guix-curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile" + + if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh'; then + chmod 755 "$updatefile" +@@ -1346,10 +1346,10 @@ create_subs () { + : > "$config_dir/subscriptions" + + # check how many subscriptions there are in the file +- sublength=$( jq '. | length' < "$yt_sub_import_file" ) ++ sublength=$( guix-jq '. | length' < "$yt_sub_import_file" ) + + for i in $(seq $((sublength - 1))); do +- channelInfo=$(jq --argjson index ${i} '[ "https://www.youtube.com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "#" + .[$index].snippet.title ]' < "$yt_sub_import_file") ++ channelInfo=$(guix-jq --argjson index ${i} '[ "https://www.youtube.com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "#" + .[$index].snippet.title ]' < "$yt_sub_import_file") + printf "%s\n" "$(printf "%s" "$channelInfo" | tr -d '[]"\n,')" >> "$subscriptions_file" + done + exit +@@ -1486,8 +1486,8 @@ parse_opt () { + exit ;; + version) + printf "\033[1mytfzf:\033[0m %s\n" "$YTFZF_VERSION" +- printf "\033[1myoutube-dl:\033[0m %s\n" "$(youtube-dl --version)" +- command -v "fzf" 1>/dev/null && printf "\033[1mfzf:\033[0m %s\n" "$(fzf --version)" ++ printf "\033[1myoutube-dl:\033[0m %s\n" "$(guix-youtube-dl --version)" ++ command -v "guix-fzf" 1>/dev/null && printf "\033[1mfzf:\033[0m %s\n" "$(guix-fzf --version)" + exit ;; + + subt) +@@ -1559,19 +1559,19 @@ done + shift $((OPTIND-1)) + + #only apply to ext_menu since they dont have a terminal to print to +-[ $is_ext_menu -eq 1 ] && command -v notify-send 1>/dev/null 2>&1 && ext_menu_notifs=1 || ext_menu_notifs=0 ++[ $is_ext_menu -eq 1 ] && command -v guix-notify-send 1>/dev/null 2>&1 && ext_menu_notifs=1 || ext_menu_notifs=0 + + #used for thumbnail previews in ueberzug + if [ $is_ext_menu -eq 0 ]; then +- export TTY_LINES=$(tput lines) +- export TTY_COLS=$(tput cols) ++ export TTY_LINES=$(guix-tput lines) ++ export TTY_COLS=$(guix-tput cols) + fi + + #if both are true, it defaults to using fzf, and if fzf isnt installed it will throw an error + #so print this error instead and set $show_thumbnails to 0 + if [ $is_ext_menu -eq 1 ] && [ $show_thumbnails -eq 1 ]; then + [ $ext_menu_notifs -eq 1 ] &&\ +- notify-send "warning" "Currently thumbnails do not work in external menus" ||\ ++ guix-notify-send "warning" "Currently thumbnails do not work in external menus" ||\ + printf "\033[33mWARNING: Currently thumbnails do not work in external menus\033[0m\n" >&2 + show_thumbnails=0 + fi +-- +2.32.0 + diff --git a/gnu/packages/patches/ytfzf-updates.patch b/gnu/packages/patches/ytfzf-updates.patch new file mode 100644 index 0000000000..9811bd64be --- /dev/null +++ b/gnu/packages/patches/ytfzf-updates.patch @@ -0,0 +1,41 @@ +From b39ea2784c7616ca1e00bc605bf84b1360f4125f Mon Sep 17 00:00:00 2001 +From: LibreMiami +Date: Sat, 26 Jun 2021 20:34:39 -0400 +Subject: [PATCH 2/2] Disable updates within the application. + +--- + ytfzf | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) + +diff --git a/ytfzf b/ytfzf +index 28e320b..69a6f8e 100755 +--- a/ytfzf ++++ b/ytfzf +@@ -1260,22 +1260,8 @@ EOF + } + + update_ytfzf () { +- branch="$1" +- updatefile="/tmp/ytfzf-update" +- guix-curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile" +- +- if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh'; then +- chmod 755 "$updatefile" +- [ "$(uname)" = "Darwin" ] && prefix="/usr/local/bin" || prefix="/usr/bin" +- function_exists "sudo" && doasroot="sudo" || doasroot="doas" +- $doasroot cp "$updatefile" "$prefix/ytfzf" +- unset prefix doasroot +- else +- printf "%bFailed to update ytfzf. Try again later.%b" "$c_red" "$c_reset" +- fi +- +- rm "$updatefile" +- exit 0 ++ printf "%bUpdates have to be installed with Guix.%b\n" "$c_red" "$c_reset" ++ exit 1 + } + + #gives a value to sort by (this will give the unix time the video was uploaded) +-- +2.32.0 + -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 29 15:06:40 2021 Received: (at 49238) by debbugs.gnu.org; 29 Jun 2021 19:06:40 +0000 Received: from localhost ([127.0.0.1]:55416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyJ4B-0005T3-P8 for submit@debbugs.gnu.org; Tue, 29 Jun 2021 15:06:40 -0400 Received: from out0.migadu.com ([94.23.1.103]:37238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyJ49-0005St-CU for 49238@debbugs.gnu.org; Tue, 29 Jun 2021 15:06:38 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1624993595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SS6mRWwlF5qrCkD/Rd4rI8eUiqFiCJBe14wp4AwLyLI=; b=K1nF/Qi4gQNyA9cMGfu3bZ84FFZFqARHPgZO9qQpwTia3DSPnFT1Rs+qwDb8TiVQfmFM3M 2gT/nwVScWPF9n5sVRM35olctAPR6edRmP0uhIC30vps3XZ1jBu9Y7NmJDxF6UwGiaQiXw dz3WLcbI1wsqo99uRVj7M6LF4xI3uN5jeVF3AyBx8dUBThXma2AG08lzd6NcowHttSBkOj AO/yyZf3SaIF9um2a79QgSn6KIILjOeZRR+EWy1gUjFuJDINlHCajxZuelxwftyxnC1EIS uHHS++zKJmsLy0+Kd8ZOmJvD/ATXfQOZF78fsoZcqwONyyDqKsT7dQXKwnVQCw== From: Raghav Gururajan To: 49238@debbugs.gnu.org Subject: [PATCH v2 1/2] gnu: Add python-ueberzug. Date: Tue, 29 Jun 2021 15:06:16 -0400 Message-Id: <20210629190617.3116-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: LibreMiami * gnu/packages/python-xyz.scm (python-ueberzug): New variable. Co-authored-by: Raghav Gururajan Co-authored-by: jgart --- gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insert [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [94.23.1.103 listed in list.dnswl.org] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 49238 Cc: Raghav Gururajan , jgart , LibreMiami X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) From: LibreMiami * gnu/packages/python-xyz.scm (python-ueberzug): New variable. Co-authored-by: Raghav Gururajan Co-authored-by: jgart --- gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 1aa53b7825..f0fbe91b73 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -101,6 +101,7 @@ ;;; Copyright © 2021 LibreMiami ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Raghav Gururajan +;;; Copyright © 2021 jgart ;;; Copyright © 2021 Danial Behzadi ;;; ;;; This file is part of GNU Guix. @@ -221,6 +222,42 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26)) +(define-public python-ueberzug + (package + (name "python-ueberzug") + (version "18.1.9") + (source + (origin + (method url-fetch) + (uri (pypi-uri "ueberzug" version)) + (sha256 + (base32 + "1hxd45dnwa9yv908acarr98n2drmar66wzq9z2qd3irj24srzr3w")))) + (build-system python-build-system) + (inputs + `(("libx11" ,libx11) + ("libxext" ,libxext))) + (propagated-inputs + `(("python-attrs" ,python-attrs) + ("python-docopt" ,python-docopt) + ("python-pillow" ,python-pillow) + ("python-xlib" ,python-xlib))) + (home-page "https://github.com/seebye/ueberzug") + (synopsis "Command line util to display images in combination with X11") + (description "Überzug is a command line util which allows to draw images on +terminals by using child windows. The advantages of using Überzug are: +@itemize +@item No race conditions as a new window is created to display images. +@item Expose events will be processed, so images will be redrawn on switch +workspaces. +@item Tmux support (excluding multi pane windows). +@item Terminals without the WINDOWID environment variable are supported. +@item Chars are used as position - and size unit. +@item No memory leak (/ unlimited cache). +@end itemize") + (license license:gpl3+))) + + (define-public python-fire (package (name "python-fire") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 29 15:06:48 2021 Received: (at 49238) by debbugs.gnu.org; 29 Jun 2021 19:06:48 +0000 Received: from localhost ([127.0.0.1]:55418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyJ4G-0005TN-3Y for submit@debbugs.gnu.org; Tue, 29 Jun 2021 15:06:48 -0400 Received: from out0.migadu.com ([94.23.1.103]:37246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyJ49-0005Sv-HH for 49238@debbugs.gnu.org; Tue, 29 Jun 2021 15:06:39 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1624993596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f4JkvLVGBhKE5gUZbxpFKR4GcsrEMXOiSXE9L3zRpuk=; b=iv/pG9npbK2tdlQrpTet+U1cNO/iZwCiHvc4cddSTSW//F+leAvrLGT/71ph1cfCfjsyL+ xpLKihMtN4dbt04FxHIkiPjGf5lMhUTkdund9M3EGrDHmnriaAzbnszYU+Cbmk9rxGnLvG Wl1vLr9m2JV+RBazsiq3cnBaSuOi6fqA0vsPj213TjswMnN1ezXFH6DtmANMolsTat7021 2ij4EfOrvrX42BBZsmdeb9npQgBNLYol/MJKpR0h1O+Y0vvhVIXErZO3+Lb+Hg+Yu4lwts rSPGpCw0dU5N36RH42dTE2QXOo8wiJcN1rHwE9FC1ABbsur9rNTT1IyuA/FBbQ== From: Raghav Gururajan To: 49238@debbugs.gnu.org Subject: [PATCH v2 2/2] gnu: Add ytfzf. Date: Tue, 29 Jun 2021 15:06:17 -0400 Message-Id: <20210629190617.3116-2-rg@raghavgururajan.name> In-Reply-To: <20210629190617.3116-1-rg@raghavgururajan.name> References: <20210629190617.3116-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: LibreMiami * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: Raghav Gururajan Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 102 ++++++ gnu/packages/patches/ytfzf-progra [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [94.23.1.103 listed in list.dnswl.org] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 49238 Cc: Raghav Gururajan , jgart , LibreMiami X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) From: LibreMiami * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: Raghav Gururajan Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 102 ++++++ gnu/packages/patches/ytfzf-programs.patch | 372 ++++++++++++++++++++++ gnu/packages/patches/ytfzf-updates.patch | 41 +++ 4 files changed, 517 insertions(+) create mode 100644 gnu/packages/patches/ytfzf-programs.patch create mode 100644 gnu/packages/patches/ytfzf-updates.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6b9202cba1..919a0d4a34 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1858,6 +1858,8 @@ dist_patch_DATA = \ %D%/packages/patches/xsane-support-ipv6.patch \ %D%/packages/patches/xsane-tighten-default-umask.patch \ %D%/packages/patches/yggdrasil-extra-config.patch \ + %D%/packages/patches/ytfzf-programs.patch \ + %D%/packages/patches/ytfzf-updates.patch \ %D%/packages/patches/ytnef-CVE-2021-3403.patch \ %D%/packages/patches/ytnef-CVE-2021-3404.patch \ %D%/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch \ diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm index f01b6a614a..e6c8cfbe8c 100644 --- a/gnu/packages/image-viewers.scm +++ b/gnu/packages/image-viewers.scm @@ -18,6 +18,8 @@ ;;; Copyright © 2021 Rovanion Luckey ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Stefan Reichör +;;; Copyright © 2021 Raghav Gururajan +;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. ;;; @@ -46,6 +48,7 @@ #:use-module (guix build-system python) #:use-module (gnu packages autotools) #:use-module (gnu packages algebra) + #:use-module (gnu packages base) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -64,6 +67,7 @@ #:use-module (gnu packages image-processing) #:use-module (gnu packages imagemagick) #:use-module (gnu packages maths) + #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages photo) @@ -71,10 +75,108 @@ #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) + #:use-module (gnu packages suckless) + #:use-module (gnu packages terminals) + #:use-module (gnu packages video) + #:use-module (gnu packages web) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) #:use-module (gnu packages)) +(define-public ytfzf + (package + (name "ytfzf") + (version "1.2.0") + (home-page "https://github.com/pystardust/ytfzf") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url home-page) + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "00d416qb4109pm77ikhnmds8qng90ni2jan9kdnxz7b6sh5f61nz")) + (patches + (search-patches + ;; Pre-requisite for 'patch' phase. + "ytfzf-programs.patch" + ;; Disables self-update. + "ytfzf-updates.patch")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no test suite + #:modules + ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Use correct $PREFIX path. + (substitute* "Makefile" + (("/usr/bin") + (format #f "~a/bin" + (assoc-ref outputs "out")))) + ;; Use absolute path to referenced programs. + (substitute* "ytfzf" + (("@catimg@") + (format #f "~a/bin/catimg" + (assoc-ref inputs "catimg"))) + (("@chafa@") + (format #f "~a/bin/chafa" + (assoc-ref inputs "chafa"))) + (("@curl@") + (format #f "~a/bin/curl" + (assoc-ref inputs "curl"))) + (("@dmenu@") + (format #f "~a/bin/dmenu" + (assoc-ref inputs "dmenu"))) + (("@fzf@") + (format #f "~a/bin/fzf" + (assoc-ref inputs "fzf"))) + (("@jp2a@") + (format #f "~a/bin/jp2a" + (assoc-ref inputs "jp2a"))) + (("@jq@") + (format #f "~a/bin/jq" + (assoc-ref inputs "jq"))) + (("@mpv@") + (format #f "~a/bin/mpv" + (assoc-ref inputs "mpv"))) + (("@notify-send@") + (format #f "~a/bin/notify-send" + (assoc-ref inputs "libnotify"))) + (("@tput@") + (format #f "~a/bin/tput" + (assoc-ref inputs "ncurses"))) + (("@ueberzug@") + (format #f "~a/bin/ueberzug" + (assoc-ref inputs "python-ueberzug"))) + (("@youtube-dl@") + (format #f "~a/bin/youtube-dl" + (assoc-ref inputs "youtube-dl")))))) + (delete 'configure)))) ;no configure script + (inputs + `(("catimg" ,catimg) + ("chafa" ,chafa) + ("curl" ,curl) + ("dmenu" ,dmenu) + ("fzf" ,fzf) + ("jp2a" ,jp2a) + ("jq" ,jq) + ("libnotify" ,libnotify) + ("mpv" ,mpv) + ("ncurses" ,ncurses) + ("python-ueberzug" ,python-ueberzug) + ("youtube-dl" ,youtube-dl))) + (synopsis "Find and watch PeerTube or YouTube videos from the terminal") + (description "@code{ytfzf} is a POSIX script that helps you find PeerTube or +YouTube videos without requiring API and opens/downloads them using mpv/ytdl.") + (license license:gpl3+))) + (define-public feh (package (name "feh") diff --git a/gnu/packages/patches/ytfzf-programs.patch b/gnu/packages/patches/ytfzf-programs.patch new file mode 100644 index 0000000000..efcd70823a --- /dev/null +++ b/gnu/packages/patches/ytfzf-programs.patch @@ -0,0 +1,372 @@ +From 8a796549d756a40a174954d2858d4c5042e3808f Mon Sep 17 00:00:00 2001 +From: LibreMiami +Date: Sat, 26 Jun 2021 20:23:11 -0400 +Subject: [PATCH 1/2] Modify the strings of referenced programs. + +Pattern the strings of referenced programs, so that they can be easily +substituted with absolute paths using a custom-phase. +--- + ytfzf | 110 +++++++++++++++++++++++++++++----------------------------- + 1 file changed, 55 insertions(+), 55 deletions(-) + +diff --git a/ytfzf b/ytfzf +index f4d2e0d..2d917df 100755 +--- a/ytfzf ++++ b/ytfzf +@@ -49,19 +49,19 @@ cache_dir=${YTFZF_CACHE-${cache_dir-$HOME/.cache/ytfzf}} + #video type preference (mp4/1080p, mp4/720p, etc..) + video_pref=${YTFZF_PREF-${video_pref-}} + #the menu to use instead of fzf when -D is specified +-external_menu=${YTFZF_EXTMENU-${external_menu-dmenu -i -l 30 -p Search:}} ++external_menu=${YTFZF_EXTMENU-${external_menu-@dmenu@ -i -l 30 -p Search:}} + #number of columns (characters on a line) the external menu can have + #necessary for formatting text for external menus + external_menu_len=${YTFZF_EXTMENU_LEN-${external_menu_len-220}} + #player settings (players need to support streaming with youtube-dl) + #player to use for watching the video +-video_player=${YTFZF_PLAYER-${video_player-mpv}} ++video_player=${YTFZF_PLAYER-${video_player-@mpv@}} + #if YTFZF_PREF is specified, use this player instead +-video_player_format=${YTFZF_PLAYER_FORMAT-${video_player_format-mpv --ytdl-format=}} ++video_player_format=${YTFZF_PLAYER_FORMAT-${video_player_format-@mpv@ --ytdl-format=}} + #player to use for audio only +-audio_player=${YTFZF_AUDIO_PLAYER-${audio_player-mpv --no-video}} ++audio_player=${YTFZF_AUDIO_PLAYER-${audio_player-@mpv@ --no-video}} + #the command to use for displaying thumbnails +-thumb_disp_method=${YTFZF_THUMB_DISP_METHOD-${thumb_disp_method-ueberzug}} ++thumb_disp_method=${YTFZF_THUMB_DISP_METHOD-${thumb_disp_method-@ueberzug@}} + #Storing the argument and location for autogenerated subtitles + [ -z "$YTFZF_SUBT_NAME" ] && YTFZF_SUBT_NAME="" + #Stores the language for the auto genereated subtitles +@@ -177,12 +177,12 @@ dep_ck () { + done + unset Dep + } +-dep_ck "jq" "youtube-dl" "curl" ++dep_ck "@jq@" "@youtube-dl@" "@curl@" + + + #only check for mpv if $YTFZF_PLAYER is set to it + #don't check $YTFZF_PLAYER as it could be multiple commands +-[ "$video_player" = "mpv" ] && dep_ck "mpv" ++[ "$video_player" = "@mpv@" ] && dep_ck "@mpv@" + + ############################ + # Help Texts # +@@ -326,8 +326,8 @@ print_info () { + } + + print_error () { +- [ $ext_menu_notifs -eq 1 ] && notify-send "error" "$*" || printf "\033[31m$*\033[0m" >&2 +- [ $ext_menu_notifs -eq 1 ] && notify-send "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" || printf "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" >&2 ++ [ $ext_menu_notifs -eq 1 ] && @notify-send@ "error" "$*" || printf "\033[31m$*\033[0m" >&2 ++ [ $ext_menu_notifs -eq 1 ] && @notify-send@ "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" || printf "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" >&2 + } + + ############################ +@@ -398,8 +398,8 @@ format_fzf () { + format_menu () { + if [ "$is_ext_menu" -eq 0 ]; then + #dep_ck fzf here because it is only necessary to use here +- dep_ck "fzf" +- menu_command='column -t -s "$tab_space" | fzf -m --bind change:top --tabstop=1 --layout=reverse --delimiter="$tab_space" --nth=1,2 --expect="$shortcuts" $FZF_DEFAULT_OPTS' ++ dep_ck "@fzf@" ++ menu_command='column -t -s "$tab_space" | @fzf@ -m --bind change:top --tabstop=1 --layout=reverse --delimiter="$tab_space" --nth=1,2 --expect="$shortcuts" $FZF_DEFAULT_OPTS' + format_fzf + else + # Dmenu doesn't render tabs so removing it +@@ -462,7 +462,7 @@ WIDTH=$FZF_PREVIEW_COLUMNS + HEIGHT=$FZF_PREVIEW_LINES + start_ueberzug () { + [ -e $FIFO ] || { mkfifo "$FIFO" || exit 1 ; } +- ueberzug layer --parser json --silent < "$FIFO" & ++ @ueberzug@ layer --parser json --silent < "$FIFO" & + exec 3>"$FIFO" + } + stop_ueberzug () { +@@ -476,12 +476,12 @@ preview_img () { + shorturl=${args##*${tab_space}|} + shorturl="${shorturl%% *}" + +- json_obj=$(printf "%s" "$videos_json" | jq '.[]|select( .videoID == "'"$shorturl"'")') ++ json_obj=$(printf "%s" "$videos_json" | @jq@ '.[]|select( .videoID == "'"$shorturl"'")') + + + IFS=$tab_space read -r title channel duration views date description <<-EOF + $( +- printf "%s" "$json_obj" | jq -r \ ++ printf "%s" "$json_obj" | @jq@ -r \ + ' + [.title,.channel,.duration,.views,.date,.description]|@tsv + ' +@@ -530,31 +530,31 @@ preview_img () { + } > "$FIFO" ;; + catimg) + printf "\n" +- catimg -w "$((thumb_width * 2))" "$IMAGE" ;; ++ @catimg@ -w "$((thumb_width * 2))" "$IMAGE" ;; + jp2a) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=24 "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=24 "$IMAGE" ;; + jp2a-8) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=8 "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=8 "$IMAGE" ;; + jp2a-4) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=4 "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=4 "$IMAGE" ;; + jp2a-gray|jp2a-grey) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" "$IMAGE" ;; + chafa) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" "$IMAGE" ;; + chafa-gray|chafa-grey) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=2 "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" --colors=2 "$IMAGE" ;; + chafa-4) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=16 "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" --colors=16 "$IMAGE" ;; + chafa-8) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=256 "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" --colors=256 "$IMAGE" ;; + custom) + if ! function_exists "handle_display_img"; then + printf "\033[031mERROR[#07]: \033[0m\033[1mhandle_display_img\033[0m is not defined" >&2 +@@ -585,17 +585,17 @@ download_thumbnails () { + if [ "$thumbnail_quality" -eq 1 ]; then + image_download () { + # higher quality images +- curl -s "$Url" -G --data-urlencode "sqp=" > "$thumb_dir/$Name.png" ++ @curl@ -s "$Url" -G --data-urlencode "sqp=" > "$thumb_dir/$Name.png" + } + else + image_download () { +- curl -s "$Url" > "$thumb_dir/$Name.png" ++ @curl@ -s "$Url" > "$thumb_dir/$Name.png" + } + fi + + print_info "Downloading Thumbnails...\n" + thumb_urls=$(printf "%s" "$*" |\ +- jq -r '.[]|[.thumbs,.videoID]|@tsv' ) ++ @jq@ -r '.[]|[.thumbs,.videoID]|@tsv' ) + + while IFS=$tab_space read -r Url Name; do + sleep 0.001 +@@ -668,7 +668,7 @@ get_yt_html () { + link=$1 + query=$2 + printf "%s" "$( +- curl "$link" -s \ ++ @curl@ "$link" -s \ + -G --data-urlencode "search_query=$query" \ + -G --data-urlencode "sp=$sp" \ + -H 'Authority: www.youtube.com' \ +@@ -684,7 +684,7 @@ get_video_data () { + # outputs tab and pipe separated fields: title, channel, view count, video length, video upload date, and the video id/url + # from the videos_json + printf "%s" "$*" |\ +- jq -r '.[]| "\(.title)'"$tab_space"'|\(.channel)'"$tab_space"'|\(.views)'"$tab_space"'|\(.duration)'"$tab_space"'|\(.date)'"$tab_space"'|\(.videoID)"' ++ @jq@ -r '.[]| "\(.title)'"$tab_space"'|\(.channel)'"$tab_space"'|\(.views)'"$tab_space"'|\(.duration)'"$tab_space"'|\(.date)'"$tab_space"'|\(.videoID)"' + } + + scrape_channel () { +@@ -723,7 +723,7 @@ scrape_channel () { + + #gets a list of videos + videos_json=$(printf "%s" "$yt_json" |\ +- jq '[ .contents | ..|.gridVideoRenderer? | ++ @jq@ '[ .contents | ..|.gridVideoRenderer? | + select(. !=null) | + { + title: .title.runs[0].text, +@@ -736,7 +736,7 @@ scrape_channel () { + } + ]') + +- videos_json=$(printf "%s" "$videos_json" | jq '.[0:'$sub_link_count']') ++ videos_json=$(printf "%s" "$videos_json" | @jq@ '.[0:'$sub_link_count']') + printf "%s\n" "$videos_json" >> "$tmp_video_json_file" + #checks if it's empty in case it was defined in a config function eg: on_get_search + [ -z "$videos_data" ] && videos_data=$(get_video_data "$videos_json") +@@ -768,11 +768,11 @@ get_trending_url_data () { + scrape_pt () { + #gets a list of videos + pt_json=$( +- curl \ ++ @curl@ \ + -s "https://sepiasearch.org/api/v1/search/videos" \ + -G --data-urlencode "search=$*") + videos_json=$(printf "%s" "$pt_json" |\ +- jq '[ .data | .[] | ++ @jq@ '[ .data | .[] | + { + title: .name, + channel: .channel.displayName, +@@ -829,7 +829,7 @@ scrape_yt () { + fi + + #gets a list of videos +- videos_json=$(printf "%s" "$yt_json" | jq '[ .contents| ++ videos_json=$(printf "%s" "$yt_json" | @jq@ '[ .contents| + ..|.videoRenderer? | + select(. !=null) | + { +@@ -844,7 +844,7 @@ scrape_yt () { + } + ]') + +- playlist_json=$(printf "%s" "$yt_json" | jq '[ .contents| ++ playlist_json=$(printf "%s" "$yt_json" | @jq@ '[ .contents| + ..|.playlistRenderer? | + select(. !=null) | + { +@@ -919,16 +919,16 @@ user_selection () { + + #show thumbnail menu + elif [ "$show_thumbnails" -eq 1 ] ; then +- dep_ck "ueberzug" "fzf" ++ dep_ck "@ueberzug@" "@fzf@" + export YTFZF_THUMB_DISP_METHOD="$thumb_disp_method" +- [ "$thumb_disp_method" = "ueberzug" ] && start_ueberzug ++ [ "$thumb_disp_method" = "@ueberzug@" ] && start_ueberzug + #thumbnails only work in fzf, use fzf +- menu_command="fzf -m --tabstop=1 --bind change:top --delimiter=\"$tab_space\" \ ++ menu_command="@fzf@ -m --tabstop=1 --bind change:top --delimiter=\"$tab_space\" \ + --nth=1,2 --expect='$shortcuts' $FZF_DEFAULT_OPTS \ + --layout=reverse --preview \"sh $0 -U {}\" \ + --preview-window \"$PREVIEW_SIDE:50%:noborder:wrap\"" + selected_data=$( title_len=200 video_menu "$videos_data" ) +- [ "$thumb_disp_method" = "ueberzug" ] && stop_ueberzug ++ [ "$thumb_disp_method" = "@ueberzug@" ] && stop_ueberzug + # Deletes thumbnails if no video is selected + [ -z "$selected_data" ] && clean_up + #show regular menu +@@ -988,7 +988,7 @@ format_user_selection () { + 11) selected_urls=$selected_urls$new_line'https://www.youtube.com/watch?v='$surl ;; + 34) selected_urls=$selected_urls$new_line'https://www.youtube.com/playlist?list='$surl ;; + 36) +- selected_urls=$selected_urls$new_line"$(printf "%s" "$videos_json" | jq '.[].url' | grep -F "$surl" | tr -d '"')" ;; ++ selected_urls=$selected_urls$new_line"$(printf "%s" "$videos_json" | @jq@ '.[].url' | grep -F "$surl" | tr -d '"')" ;; + *) continue ;; + esac + refined_selected_data=$refined_selected_data$new_line$(printf '%s' "$videos_data" | grep "|$surl" ) +@@ -1014,7 +1014,7 @@ print_data () { + get_video_format () { + # select format if flag given + [ $show_format -eq 0 ] && return +- formats=$(youtube-dl -F "$(printf "$selected_urls")") ++ formats=$(@youtube-dl@ -F "$(printf "$selected_urls")") + line_number=$(printf "$formats" | grep -n '.*extension resolution.*' | cut -d: -f1) + quality=$(printf "$formats \n1 2 xAudio" | awk -v lineno=$line_number 'FNR > lineno {print $3}' | sort -n | awk -F"x" '{print $2 "p"}' | uniq | sed -e "s/Audiop/Audio/" -e "/^p$/d" | eval "$menu_command" | sed "s/p//g") + [ -z "$quality" ] && exit; +@@ -1026,9 +1026,9 @@ get_video_format () { + get_sub_lang () { + if [ $auto_caption -eq 1 ]; then + #Gets the auto generated subs and stores them in a file +- sub_list=$(youtube-dl --list-subs --write-auto-sub "$selected_urls" | sed '/Available subtitles/,$d' | awk '{print $1}' | sed '1d;2d;3d') ++ sub_list=$(@youtube-dl@ --list-subs --write-auto-sub "$selected_urls" | sed '/Available subtitles/,$d' | awk '{print $1}' | sed '1d;2d;3d') + if [ -n "$sub_list" ]; then +- [ -n "$selected_sub" ] || selected_sub=$(printf "$sub_list" | eval "$menu_command") && youtube-dl --sub-lang $selected_sub --write-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NAME="--sub-file=/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated subs not available." ++ [ -n "$selected_sub" ] || selected_sub=$(printf "$sub_list" | eval "$menu_command") && @youtube-dl@ --sub-lang $selected_sub --write-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NAME="--sub-file=/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated subs not available." + fi + unset sub_list + fi +@@ -1064,9 +1064,9 @@ open_player () { + fi + elif [ $is_download -eq 1 ]; then + if [ -z "$video_pref" ]; then +- youtube-dl "$@" "$YTFZF_SUBT_NAME" ++ @youtube-dl@ "$@" "$YTFZF_SUBT_NAME" + else +- youtube-dl -f "$video_pref" "$@" $YTFZF_SUBT_NAME || video_pref= open_player "$@" ++ @youtube-dl@ -f "$video_pref" "$@" $YTFZF_SUBT_NAME || video_pref= open_player "$@" + fi + fi + } +@@ -1200,7 +1200,7 @@ search_history_menu () { + #when using an external menu, the search history will be done there + choice=$( printf "%s\n" "$search_history" | eval "$external_menu" ) + else +- choice="$( printf "%s\n" "$search_history" | fzf --prompt="$search_history_prompt" --print-query --no-multi -d '\t' --with-nth=2.. --expect='alt-enter' --bind='tab:replace-query' )" ++ choice="$( printf "%s\n" "$search_history" | @fzf@ --prompt="$search_history_prompt" --print-query --no-multi -d '\t' --with-nth=2.. --expect='alt-enter' --bind='tab:replace-query' )" + fi + + # first line is the fzf query (what the user types in fzf) +@@ -1244,7 +1244,7 @@ search_history_menu () { + + #if downloading, say Downloading not currently playing + [ $is_download -eq 1 ] && title="Downloading" || title="Currently playing" +- notify-send "$title" "$message" -i "$video_thumb" ++ @notify-send@ "$title" "$message" -i "$video_thumb" + + unset message video_thumb title + } +@@ -1262,7 +1262,7 @@ EOF + update_ytfzf () { + branch="$1" + updatefile="/tmp/ytfzf-update" +- curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile" ++ @curl@ -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile" + + if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh'; then + chmod 755 "$updatefile" +@@ -1346,10 +1346,10 @@ create_subs () { + : > "$config_dir/subscriptions" + + # check how many subscriptions there are in the file +- sublength=$( jq '. | length' < "$yt_sub_import_file" ) ++ sublength=$( @jq@ '. | length' < "$yt_sub_import_file" ) + + for i in $(seq $((sublength - 1))); do +- channelInfo=$(jq --argjson index ${i} '[ "https://www.youtube.com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "#" + .[$index].snippet.title ]' < "$yt_sub_import_file") ++ channelInfo=$(@jq@ --argjson index ${i} '[ "https://www.youtube.com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "#" + .[$index].snippet.title ]' < "$yt_sub_import_file") + printf "%s\n" "$(printf "%s" "$channelInfo" | tr -d '[]"\n,')" >> "$subscriptions_file" + done + exit +@@ -1486,8 +1486,8 @@ parse_opt () { + exit ;; + version) + printf "\033[1mytfzf:\033[0m %s\n" "$YTFZF_VERSION" +- printf "\033[1myoutube-dl:\033[0m %s\n" "$(youtube-dl --version)" +- command -v "fzf" 1>/dev/null && printf "\033[1mfzf:\033[0m %s\n" "$(fzf --version)" ++ printf "\033[1myoutube-dl:\033[0m %s\n" "$(@youtube-dl@ --version)" ++ command -v "@fzf@" 1>/dev/null && printf "\033[1mfzf:\033[0m %s\n" "$(@fzf@ --version)" + exit ;; + + subt) +@@ -1559,19 +1559,19 @@ done + shift $((OPTIND-1)) + + #only apply to ext_menu since they dont have a terminal to print to +-[ $is_ext_menu -eq 1 ] && command -v notify-send 1>/dev/null 2>&1 && ext_menu_notifs=1 || ext_menu_notifs=0 ++[ $is_ext_menu -eq 1 ] && command -v @notify-send@ 1>/dev/null 2>&1 && ext_menu_notifs=1 || ext_menu_notifs=0 + + #used for thumbnail previews in ueberzug + if [ $is_ext_menu -eq 0 ]; then +- export TTY_LINES=$(tput lines) +- export TTY_COLS=$(tput cols) ++ export TTY_LINES=$(@tput@ lines) ++ export TTY_COLS=$(@tput@ cols) + fi + + #if both are true, it defaults to using fzf, and if fzf isnt installed it will throw an error + #so print this error instead and set $show_thumbnails to 0 + if [ $is_ext_menu -eq 1 ] && [ $show_thumbnails -eq 1 ]; then + [ $ext_menu_notifs -eq 1 ] &&\ +- notify-send "warning" "Currently thumbnails do not work in external menus" ||\ ++ @notify-send@ "warning" "Currently thumbnails do not work in external menus" ||\ + printf "\033[33mWARNING: Currently thumbnails do not work in external menus\033[0m\n" >&2 + show_thumbnails=0 + fi +-- +2.32.0 + diff --git a/gnu/packages/patches/ytfzf-updates.patch b/gnu/packages/patches/ytfzf-updates.patch new file mode 100644 index 0000000000..3cdc12b015 --- /dev/null +++ b/gnu/packages/patches/ytfzf-updates.patch @@ -0,0 +1,41 @@ +From 374bd725ad5e52931d9ffeb1563ba31eb298aa5c Mon Sep 17 00:00:00 2001 +From: LibreMiami +Date: Sat, 26 Jun 2021 20:34:39 -0400 +Subject: [PATCH 2/2] Disable updates within the application. + +--- + ytfzf | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) + +diff --git a/ytfzf b/ytfzf +index 2d917df..7b0b227 100755 +--- a/ytfzf ++++ b/ytfzf +@@ -1260,22 +1260,8 @@ EOF + } + + update_ytfzf () { +- branch="$1" +- updatefile="/tmp/ytfzf-update" +- @curl@ -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile" +- +- if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh'; then +- chmod 755 "$updatefile" +- [ "$(uname)" = "Darwin" ] && prefix="/usr/local/bin" || prefix="/usr/bin" +- function_exists "sudo" && doasroot="sudo" || doasroot="doas" +- $doasroot cp "$updatefile" "$prefix/ytfzf" +- unset prefix doasroot +- else +- printf "%bFailed to update ytfzf. Try again later.%b" "$c_red" "$c_reset" +- fi +- +- rm "$updatefile" +- exit 0 ++ printf "%bUpdates have to be installed with Guix.%b\n" "$c_red" "$c_reset" ++ exit 1 + } + + #gives a value to sort by (this will give the unix time the video was uploaded) +-- +2.32.0 + -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 15:38:32 2021 Received: (at 49238) by debbugs.gnu.org; 30 Jun 2021 19:38:32 +0000 Received: from localhost ([127.0.0.1]:58778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyg2Z-0003Aa-K9 for submit@debbugs.gnu.org; Wed, 30 Jun 2021 15:38:32 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:53970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyg2X-0003AN-5W for 49238@debbugs.gnu.org; Wed, 30 Jun 2021 15:38:30 -0400 Received: from [172.20.10.4] ([5.23.251.255]) by laurent.telenet-ops.be with bizsmtp id PXeR2500Q5XNd5901XeSBp; Wed, 30 Jun 2021 21:38:27 +0200 Message-ID: <2e6b08035ebeddd60faa283e0a183d8d76e0f709.camel@telenet.be> Subject: Re: [bug#49238] [PATCH v1 2/2] gnu: Add ytfzf. From: Maxime Devos To: Raghav Gururajan , 49238@debbugs.gnu.org Date: Wed, 30 Jun 2021 21:38:15 +0200 In-Reply-To: <20210627054737.7972-2-rg@raghavgururajan.name> References: <20210627054737.7972-1-rg@raghavgururajan.name> <20210627054737.7972-2-rg@raghavgururajan.name> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-3k3J7tmvdyVjZTdf6nmg" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1625081907; bh=uQ9HA65u7Jm16DZnrtBU1rl06UGStGlojAALOdYwwjQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=rQP13kg0e79OJfw0QSFczk/bIGB554egzXZ/HXHrff3L+opcC1tLtcAabEq2mWMgs LT1hwUjEnraUKub09B+xek7Q5TwRQnh3v+RSn7NUdtUU9/6bxeg77g9FfJl3Oa/828 TjI2tHI9eWxxRiPSICqkdvFWbjnW7b0/EzEpbWQSbhekrat15z3hn6HtsJsrDS+2+r f6fCADdL289GcVJxXMoD73J7FbkMme1Eo5tEMzKtT/zDPcqUZNDAf3pSUgEnrGqm22 h1DEPGMhyZTyHw99BFS8EA3cwz/JK3KnW/aQJburjtv7+GaDdKladM4CYnx09Z1Pa5 Ic6K02vtxCgTQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49238 Cc: jgart@dismail.de, LibreMiami X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-3k3J7tmvdyVjZTdf6nmg Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Raghav Gururajan via Guix-patches via schreef op zo 27-06-2021 om 01:47 [-0= 400]: > + (patches > + (search-patches > + ;; Prerequisite for 'patch phase. > + "ytfzf-programs.patch" That's a neat trick to avoid fragile (substitute* ...). However, as I understand it, the origin is meant to be usable as source code (think install dependencies && guix build && tar xzf = stuff.tgz && ./configure && make && try it out), such that "guix build --source=3Dtransitive stuff" would give all the source code for building stuff (in the sense of =E2=80=98Corresponding Sour= ce=E2=80=99 of the GPL), and "guix-mpv", 'guix-jq" ... don't exist anywhere. I don't know if that has been spelled out somewhere though. I'd suggest adding "patch" to 'native-inputs', adding the patch to 'inputs' or 'native-inputs' (doesn't really matter which) and doing (invoke "patch" OPTIONS "blabla.patch") before the substitute*. Actually, myself I'm not convinced because you could consider the package definition itself to be part of the =E2=80=98corresponding sour= ce=E2=80=99. > + (substitute* "ytfzf" > + (("guix-catimg") > + (format #f "~a/bin/catimg" > + (assoc-ref inputs "catimg"))) I'm wondering if (string-append (assoc-ref inputs "catimg") "/bin/catimg") would be better, as 'string-append' is less complex than 'format' and "format" doesn't seem to provide any additional value here. Now about the patch: > + ############################ > + # Help Texts # > +@@ -326,8 +326,8 @@ print_info () { > + } > +=20 > + print_error () { > +- [ $ext_menu_notifs -eq 1 ] && notify-send "error" "$*" || printf "\= 033[31m$*\033[0m" >&2 > +- [ $ext_menu_notifs -eq 1 ] && notify-send "Check for new versions a= nd report at: https://github.com/pystardust/ytfzf\n" || printf "Check for n= ew versions and report at: https://github.com/pystardust/ytfzf\n" >&2 > ++ [ $ext_menu_notifs -eq 1 ] && guix-notify-send "error" "$*" || prin= tf "\033[31m$*\033[0m" >&2 > ++ [ $ext_menu_notifs -eq 1 ] && guix-notify-send "Check for new versi= ons and report at: https://github.com/pystardust/ytfzf\n" || printf "Check = for new versions and report at: https://github.com/pystardust/ytfzf\n" >&2 Maybe tell people to report issues at bug-guix@gnu.org or #guix? Dunno > + } > +=20 > + ############################ > +@@ -398,8 +398,8 @@ format_fzf () { > + format_menu () { > + if [ "$is_ext_menu" -eq 0 ]; then > + #dep_ck fzf here because it is only necessary to use here > +- dep_ck "fzf" > +- menu_command=3D'column -t -s "$tab_space" | fzf -m --bind change:top = --tabstop=3D1 --layout=3Dreverse --delimiter=3D"$tab_space" --nth=3D1,2 --e= xpect=3D"$shortcuts" $FZF_DEFAULT_OPTS' > ++ dep_ck "guix-fzf" > ++ menu_command=3D'column -t -s "$tab_space" | guix-fzf -m --bind change= :top --tabstop=3D1 --layout=3Dreverse --delimiter=3D"$tab_space" --nth=3D1,= 2 --expect=3D"$shortcuts" $FZF_DEFAULT_OPTS' > + format_fzf Don't forget to patch 'column'. > + else > + # Dmenu doesn't render tabs so removing it > +@@ -462,7 +462,7 @@ WIDTH=3D$FZF_PREVIEW_COLUMNS > + HEIGHT=3D$FZF_PREVIEW_LINES > + start_ueberzug () { > + [ -e $FIFO ] || { mkfifo "$FIFO" || exit 1 ; } > +- ueberzug layer --parser json --silent < "$FIFO" & > ++ guix-ueberzug layer --parser json --silent < "$FIFO" & > + exec 3>"$FIFO" > + } > + stop_ueberzug () { Don't forget to patch "mkfifo". > +@@ -585,17 +585,17 @@ download_thumbnails () { > + if [ "$thumbnail_quality" -eq 1 ]; then > + image_download () { > + # higher quality images > +- curl -s "$Url" -G --data-urlencode "sqp=3D" > "$thumb_dir/$Name.png" > ++ guix-curl -s "$Url" -G --data-urlencode "sqp=3D" > "$thumb_dir/$Name= .png" > + } > + else > + image_download () { > +- curl -s "$Url" > "$thumb_dir/$Name.png" > ++ guix-curl -s "$Url" > "$thumb_dir/$Name.png" > + } > + fi > +=20 > + print_info "Downloading Thumbnails...\n" > + thumb_urls=3D$(printf "%s" "$*" |\ > +- jq -r '.[]|[.thumbs,.videoID]|@tsv' ) > ++ guix-jq -r '.[]|[.thumbs,.videoID]|@tsv' ) > +=20 > + while IFS=3D$tab_space read -r Url Name; do > + sleep 0.001 >=20 Don't forget patching 'sleep'. It is not shell a built-in (try "type sleep" and "type [" in a terminal"). > +@@ -988,7 +988,7 @@ format_user_selection () { > + 11) selected_urls=3D$selected_urls$new_line'https://www.youtube.com/= watch?v=3D'$surl ;; > + 34) selected_urls=3D$selected_urls$new_line'https://www.youtube.com/= playlist?list=3D'$surl ;; > + 36) > +- selected_urls=3D$selected_urls$new_line"$(printf "%s" "$videos_j= son" | jq '.[].url' | grep -F "$surl" | tr -d '"')" ;; > ++ selected_urls=3D$selected_urls$new_line"$(printf "%s" "$videos_j= son" | guix-jq '.[].url' | grep -F "$surl" | tr -d '"') Don't forget patching 'grep' and 'tr'. > " ;; > + *) continue ;; > + esac > + refined_selected_data=3D$refined_selected_data$new_line$(printf '%s' = "$videos_data" | grep "|$surl" ) > +@@ -1014,7 +1014,7 @@ print_data () { > + get_video_format () { > + # select format if flag given > + [ $show_format -eq 0 ] && return > +- formats=3D$(youtube-dl -F "$(printf "$selected_urls")")=20 > ++ formats=3D$(guix-youtube-dl -F "$(printf "$selected_urls")") > + line_number=3D$(printf "$formats" | grep -n '.*extension resol= ution.*' | cut -d: -f1) Don't forget 'grep -> guix-grep' and 'cut -> guix-cut' > + quality=3D$(printf "$formats \n1 2 xAudio" | awk -v lineno=3D$l= ine_number 'FNR > lineno {print $3}' | sort -n | awk -F"x" '{print $2 "p"}= ' | uniq | sed -e "s/Audiop/Audio/" -e "/^p$/d" | eval "$menu_command" | se= d "s/p//g") Don't forget 'awk -> guix-awk' and 'sort -> guix-sort' and 'uniq -> 'guix-u= niq' > + [ -z "$quality" ] && exit; > +@@ -1026,9 +1026,9 @@ get_video_format () { > + get_sub_lang () { > + if [ $auto_caption -eq 1 ]; then > + #Gets the auto generated subs and stores them in a file > +- sub_list=3D$(youtube-dl --list-subs --write-auto-sub "$selecte= d_urls" | sed '/Available subtitles/,$d' | awk '{print $1}' | sed '1d;2d;3d= ') > ++ sub_list=3D$(guix-youtube-dl --list-subs --write-auto-sub "$se= lected_urls" | sed '/Available subtitles/,$d' | awk '{print $1}' | sed '1d;= 2d;3d') Don't forget 'sed -> guix-sed' and 'awk -> guix-awk' > + if [ -n "$sub_list" ]; then > +- [ -n "$selected_sub" ] || selected_sub=3D$(printf "$sub_li= st" | eval "$menu_command") && youtube-dl --sub-lang $selected_sub --wri= te-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NA= ME=3D"--sub-file=3D/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated = subs not available." > ++ [ -n "$selected_sub" ] || selected_sub=3D$(printf "$sub_li= st" | eval "$menu_command") && guix-youtube-dl --sub-lang $selected_sub = --write-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SU= BT_NAME=3D"--sub-file=3D/tmp/ytfzf.$selected_sub.vtt" || printf "Auto gener= ated subs not available." FWIW, writing to "/tmp/ytfzf" seems to be a potential security problem and bad behaviour on multiple-user systems. What would happen if /tmp/ytfzf is a symlink to /etc/passwd an ytfzf is run as root (yes, running as root is not recommended)? Would that brick the sys= tem? What if /tmp/ytfzf is a symlink to ~/.profile? Would that brick the login? What if multiple users run ytfzf concurrently? Would they overwrite eaech other subtitles? Would a different user be able to see what the other is downloading? A relatively easy fix would be to write to, say, $HOME/.cache/ytzf-subs instead (not sure what the proper directory would be), which is completely under the user's control. > +@@ -1262,7 +1262,7 @@ EOF > + update_ytfzf () { > + branch=3D"$1" > + updatefile=3D"/tmp/ytfzf-update" > +- curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/yt= fzf" -o "$updatefile" > ++ guix-curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$bran= ch/ytfzf" -o "$updatefile" > +=20 > + if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh'; then FWIW, as update-ytfzf will be more-or-less deleted in the next patch, don't forget to patch 'sed' and 'grep' > + chmod 755 "$updatefile" > +@@ -1346,10 +1346,10 @@ create_subs () { > + : > "$config_dir/subscriptions" > +=20 > + # check how many subscriptions there are in the file > +- sublength=3D$( jq '. | length' < "$yt_sub_import_file" ) > ++ sublength=3D$( guix-jq '. | length' < "$yt_sub_import_file" ) > +=20 > + for i in $(seq $((sublength - 1))); do > +- channelInfo=3D$(jq --argjson index ${i} '[ "https://www.youtube= .com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "#" + = .[$index].snippet.title ]' < "$yt_sub_import_file") > ++ channelInfo=3D$(guix-jq --argjson index ${i} '[ "https://www.yo= utube.com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "= #" + .[$index].snippet.title ]' < "$yt_sub_import_file") > + printf "%s\n" "$(printf "%s" "$channelInfo" | tr -d '[]"\n,')" >> "$su= bscriptions_file" And don't forget 'tr'. Greetings, Maxime. --=-3k3J7tmvdyVjZTdf6nmg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYNzIJxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sGhAQCvUVFHLCt2pS3dHJEpwT32gKmK HIPKE4mpUD2IHEHmfgEAl2fZ2hOy2P4qgHH4jIzQ0WHiC+6h7hDLGUCzMAuqPAc= =Se7m -----END PGP SIGNATURE----- --=-3k3J7tmvdyVjZTdf6nmg-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 07:14:35 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 11:14:36 +0000 Received: from localhost ([127.0.0.1]:44248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0MYd-0000AP-J6 for submit@debbugs.gnu.org; Mon, 05 Jul 2021 07:14:35 -0400 Received: from out1.migadu.com ([91.121.223.63]:58657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0MYZ-0000A9-NQ for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 07:14:33 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1625483669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0NYftBhdwMWQRjhTZ9JRrAOOiwsvEKyP0xPGOsxYjw=; b=lv2xkjy6Jledi+rpE3z+TuUar44e6w+0gYUHXbLMaDsWS5Ekglu/5W/81vKeKunOv+k2sw Dv0JvbEP2fK7pL0YfS/qHqBx2y8MqiSyyeTssZLnQ9UDscPHpQd9YmVb8oZGY18NZ5MES9 HljEwB3m3zRiwqkmgaSgXTjYQt3ECRC0GagPIVC8P7/gdZinb1hMmQBRDCyOhHGn8vH9Ej pEBvdihsMVxqk7ES9NrUa0wgSSQU6X4j1uA9MdrvdMdgYzG/qLwJw5CU5OyjSQfybpY5zM QvyAgrNSBW/YPyY5qnnxiTDhItdq8yoLTED892YDlOjiCyQhGG/4jaY/g6Rrfw== From: Raghav Gururajan To: 49238@debbugs.gnu.org Subject: [PATCH v3 1/2] gnu: Add python-ueberzug. Date: Mon, 5 Jul 2021 07:14:24 -0400 Message-Id: <20210705111425.14479-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/python-xyz.scm (python-ueberzug): New variable. Co-authored-by: jgart --- gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [91.121.223.63 listed in list.dnswl.org] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 49238 Cc: Raghav Gururajan , jgart X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) * gnu/packages/python-xyz.scm (python-ueberzug): New variable. Co-authored-by: jgart --- gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index b74b3b808f..aa2406287d 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -101,6 +101,7 @@ ;;; Copyright © 2021 LibreMiami ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Raghav Gururajan +;;; Copyright © 2021 jgart ;;; Copyright © 2021 Danial Behzadi ;;; ;;; This file is part of GNU Guix. @@ -221,6 +222,41 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26)) +(define-public python-ueberzug + (package + (name "python-ueberzug") + (version "18.1.9") + (source + (origin + (method url-fetch) + (uri (pypi-uri "ueberzug" version)) + (sha256 + (base32 + "1hxd45dnwa9yv908acarr98n2drmar66wzq9z2qd3irj24srzr3w")))) + (build-system python-build-system) + (inputs + `(("libx11" ,libx11) + ("libxext" ,libxext))) + (propagated-inputs + `(("python-attrs" ,python-attrs) + ("python-docopt" ,python-docopt) + ("python-pillow" ,python-pillow) + ("python-xlib" ,python-xlib))) + (home-page "https://github.com/seebye/ueberzug") + (synopsis "Command line util to display images in combination with X11") + (description "Überzug is a command line util which allows to draw images on +terminals by using child windows. The advantages of using Überzug are: +@itemize +@item No race conditions as a new window is created to display images. +@item Expose events will be processed, so images will be redrawn on switch +workspaces. +@item Tmux support (excluding multi pane windows). +@item Terminals without the WINDOWID environment variable are supported. +@item Chars are used as position - and size unit. +@item No memory leak (/ unlimited cache). +@end itemize") + (license license:gpl3+))) + (define-public python-fire (package (name "python-fire") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 07:14:42 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 11:14:42 +0000 Received: from localhost ([127.0.0.1]:44250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0MYf-0000AY-Tq for submit@debbugs.gnu.org; Mon, 05 Jul 2021 07:14:42 -0400 Received: from out1.migadu.com ([91.121.223.63]:58666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0MYZ-0000AB-VC for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 07:14:34 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1625483671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vQTde8xR7eO2J85oKV501DmxZHmkXlZUBlInQ/N1QrM=; b=jrLlzoPLpw6ka00G0wTGXe1ne5etMA0bJB0bdO2Kp5FDrDXtvhRV2byKbmg7gXKQtmWTTD 1P/WoqwY2Sq9I+Cblb3YmapEUuvNT2+NBjc2jpRrU8VUR4yz9cps2DSv5kKmYdZuLMcRXY DKQ/i6KZYFShZKo62XppL+PABIfBj8gjWTOTgU8nvx0bMCVNBIlTuKR6EY8Se4vk2CQzVy 6jb7V6Bk86uLHYQ1hd+KNDAvLDeouQExoVK+MrYpiKhWWv6gkqc0Axr3bKl7kdSj2sWv4I aaBwtj3PNXVgWvV/x1FhTGqnbQvpx2Qnv5pPqMmkEr0Le14P6vwVv0coUnrSEg== From: Raghav Gururajan To: 49238@debbugs.gnu.org Subject: [PATCH v3 2/2] gnu: Add ytfzf. Date: Mon, 5 Jul 2021 07:14:25 -0400 Message-Id: <20210705111425.14479-2-rg@raghavgururajan.name> In-Reply-To: <20210705111425.14479-1-rg@raghavgururajan.name> References: <20210705111425.14479-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 3.1 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 160 ++++++ gnu/packages/patches/ytfzf-programs.patch | 650 ++++++++++++++++++++++ gnu/packages/patches/ [...] Content analysis details: (3.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [91.121.223.63 listed in list.dnswl.org] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 LOTS_OF_MONEY Huge... sums of money 1.8 MONEY_NOHTML Lots of money in plain text 0.0 T_MONEY_PERCENT X% of a lot of money for you X-Debbugs-Envelope-To: 49238 Cc: Raghav Gururajan , jgart X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 160 ++++++ gnu/packages/patches/ytfzf-programs.patch | 650 ++++++++++++++++++++++ gnu/packages/patches/ [...] Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 LOTS_OF_MONEY Huge... sums of money 1.8 MONEY_NOHTML Lots of money in plain text -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 T_MONEY_PERCENT X% of a lot of money for you * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 160 ++++++ gnu/packages/patches/ytfzf-programs.patch | 650 ++++++++++++++++++++++ gnu/packages/patches/ytfzf-updates.patch | 44 ++ 4 files changed, 856 insertions(+) create mode 100644 gnu/packages/patches/ytfzf-programs.patch create mode 100644 gnu/packages/patches/ytfzf-updates.patch diff --git a/gnu/local.mk b/gnu/local.mk index beaf99bf71..66687b420c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1858,6 +1858,8 @@ dist_patch_DATA = \ %D%/packages/patches/xsane-support-ipv6.patch \ %D%/packages/patches/xsane-tighten-default-umask.patch \ %D%/packages/patches/yggdrasil-extra-config.patch \ + %D%/packages/patches/ytfzf-programs.patch \ + %D%/packages/patches/ytfzf-updates.patch \ %D%/packages/patches/ytnef-CVE-2021-3403.patch \ %D%/packages/patches/ytnef-CVE-2021-3404.patch \ %D%/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch \ diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm index f01b6a614a..caa4974974 100644 --- a/gnu/packages/image-viewers.scm +++ b/gnu/packages/image-viewers.scm @@ -18,6 +18,8 @@ ;;; Copyright © 2021 Rovanion Luckey ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Stefan Reichör +;;; Copyright © 2021 Raghav Gururajan +;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. ;;; @@ -46,6 +48,7 @@ #:use-module (guix build-system python) #:use-module (gnu packages autotools) #:use-module (gnu packages algebra) + #:use-module (gnu packages base) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -53,6 +56,7 @@ #:use-module (gnu packages documentation) #:use-module (gnu packages fontutils) #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) #:use-module (gnu packages ghostscript) #:use-module (gnu packages gl) @@ -63,7 +67,9 @@ #:use-module (gnu packages image) #:use-module (gnu packages image-processing) #:use-module (gnu packages imagemagick) + #:use-module (gnu packages linux) #:use-module (gnu packages maths) + #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages photo) @@ -71,10 +77,164 @@ #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) + #:use-module (gnu packages suckless) + #:use-module (gnu packages terminals) + #:use-module (gnu packages video) + #:use-module (gnu packages web) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) #:use-module (gnu packages)) +(define-public ytfzf + (package + (name "ytfzf") + (version "1.2.0") + (home-page "https://github.com/pystardust/ytfzf") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url home-page) + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "00d416qb4109pm77ikhnmds8qng90ni2jan9kdnxz7b6sh5f61nz")) + (patches + (search-patches + ;; Pre-requisite for 'patch' phase. + "ytfzf-programs.patch" + ;; Disables self-update. + "ytfzf-updates.patch")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no test suite + #:modules + ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (binutils (assoc-ref inputs "binutils")) + (catimg (assoc-ref inputs "catimg")) + (chafa (assoc-ref inputs "chafa")) + (coreutils (assoc-ref inputs "coreutils")) + (curl (assoc-ref inputs "curl")) + (dmenu (assoc-ref inputs "dmenu")) + (fzf (assoc-ref inputs "fzf")) + (gawk (assoc-ref inputs "gawk")) + (grep (assoc-ref inputs "grep")) + (jp2a (assoc-ref inputs "jp2a")) + (jq (assoc-ref inputs "jq")) + (libnotify (assoc-ref inputs "libnotify")) + (mpv (assoc-ref inputs "mpv")) + (ncurses (assoc-ref inputs "ncurses")) + (python-ueberzug (assoc-ref inputs "python-ueberzug")) + (sed (assoc-ref inputs "sed")) + (util-linux (assoc-ref inputs "util-linux")) + (youtube-dl (assoc-ref inputs "youtube-dl"))) + ;; Use correct $PREFIX path. + (substitute* "Makefile" + (("/usr/bin") + (string-append out "/bin"))) + ;; Use absolute path for referenced programs. + (substitute* "ytfzf" + (("@awk@") + (string-append gawk "/bin/awk")) + (("@cat@") + (string-append coreutils "/bin/cat")) + (("@catimg@") + (string-append catimg "/bin/catimg")) + (("@chafa@") + (string-append chafa "/bin/chafa")) + (("@chmod@") + (string-append coreutils "/bin/chmod")) + (("@column@") + (string-append util-linux "/bin/column")) + (("@cp@") + (string-append coreutils "/bin/cp")) + (("@cut@") + (string-append coreutils "/bin/cut")) + (("@curl@") + (string-append curl "/bin/curl")) + (("@date@") + (string-append coreutils "/bin/date")) + (("@dmenu@") + (string-append dmenu "/bin/dmenu")) + (("@fzf@") + (string-append fzf "/bin/fzf")) + (("@grep@") + (string-append grep "/bin/grep")) + (("@head@") + (string-append coreutils "/bin/head")) + (("@jp2a@") + (string-append jp2a "/bin/jp2a")) + (("@jq@") + (string-append jq "/bin/jq")) + (("@mkdir@") + (string-append coreutils "/bin/mkdir")) + (("@mkfifo@") + (string-append coreutils "/bin/mkfifo")) + (("@mpv@") + (string-append mpv "/bin/mpv")) + (("@nohup@") + (string-append coreutils "/bin/nohup")) + (("@notify-send@") + (string-append libnotify "/bin/notify-send")) + (("@rm@") + (string-append coreutils "/bin/rm")) + (("@sed@") + (string-append sed "/bin/sed")) + (("@seq@") + (string-append coreutils "/bin/seq")) + (("@setsid@") + (string-append util-linux "/bin/setsid")) + (("@sleep@") + (string-append coreutils "/bin/sleep")) + (("@sort@") + (string-append coreutils "/bin/sort")) + (("@tput@") + (string-append ncurses "/bin/tput")) + (("@tr@") + (string-append coreutils "/bin/tr")) + (("@ueberzug@") + (string-append python-ueberzug "/bin/ueberzug")) + (("@uname@") + (string-append coreutils "/bin/uname")) + (("@uniq@") + (string-append coreutils "/bin/uniq")) + (("@wc@") + (string-append coreutils "/bin/wc")) + (("@youtube-dl@") + (string-append youtube-dl "/bin/youtube-dl")))))) + (delete 'configure)))) ;no configure script + (inputs + `(("binutils" ,binutils) + ("catimg" ,catimg) + ("chafa" ,chafa) + ("coreutils" ,coreutils) + ("curl" ,curl) + ("dmenu" ,dmenu) + ("fzf" ,fzf) + ("gawk" ,gawk) + ("grep" ,grep) + ("jp2a" ,jp2a) + ("jq" ,jq) + ("libnotify" ,libnotify) + ("mpv" ,mpv) + ("ncurses" ,ncurses) + ("python-ueberzug" ,python-ueberzug) + ("sed" ,sed) + ("util-linux" ,util-linux) + ("youtube-dl" ,youtube-dl))) + (synopsis "Watch PeerTube or YouTube videos from the terminal") + (description "@code{ytfzf} is a POSIX script that helps you find PeerTube or +YouTube videos without requiring API and opens/downloads them using mpv/ytdl.") + (license license:gpl3+))) + (define-public feh (package (name "feh") diff --git a/gnu/packages/patches/ytfzf-programs.patch b/gnu/packages/patches/ytfzf-programs.patch new file mode 100644 index 0000000000..fc7684d3ef --- /dev/null +++ b/gnu/packages/patches/ytfzf-programs.patch @@ -0,0 +1,650 @@ +From 291a0cd6e24026da0cfd2007e48c00f0824bd0d2 Mon Sep 17 00:00:00 2001 +From: Raghav Gururajan +Date: Mon, 5 Jul 2021 06:45:49 -0400 +Subject: [PATCH 1/2] Modify the strings of referenced programs. + +Pattern the strings of referenced programs, so that they can be easily +substituted with absolute paths using a custom-phase. + +Co-authored-by: jgart +--- + ytfzf | 202 +++++++++++++++++++++++++++++----------------------------- + 1 file changed, 101 insertions(+), 101 deletions(-) + +diff --git a/ytfzf b/ytfzf +index f4d2e0d..0a2c372 100755 +--- a/ytfzf ++++ b/ytfzf +@@ -49,19 +49,19 @@ cache_dir=${YTFZF_CACHE-${cache_dir-$HOME/.cache/ytfzf}} + #video type preference (mp4/1080p, mp4/720p, etc..) + video_pref=${YTFZF_PREF-${video_pref-}} + #the menu to use instead of fzf when -D is specified +-external_menu=${YTFZF_EXTMENU-${external_menu-dmenu -i -l 30 -p Search:}} ++external_menu=${YTFZF_EXTMENU-${external_menu-@dmenu@ -i -l 30 -p Search:}} + #number of columns (characters on a line) the external menu can have + #necessary for formatting text for external menus + external_menu_len=${YTFZF_EXTMENU_LEN-${external_menu_len-220}} + #player settings (players need to support streaming with youtube-dl) + #player to use for watching the video +-video_player=${YTFZF_PLAYER-${video_player-mpv}} ++video_player=${YTFZF_PLAYER-${video_player-@mpv@}} + #if YTFZF_PREF is specified, use this player instead +-video_player_format=${YTFZF_PLAYER_FORMAT-${video_player_format-mpv --ytdl-format=}} ++video_player_format=${YTFZF_PLAYER_FORMAT-${video_player_format-@mpv@ --ytdl-format=}} + #player to use for audio only +-audio_player=${YTFZF_AUDIO_PLAYER-${audio_player-mpv --no-video}} ++audio_player=${YTFZF_AUDIO_PLAYER-${audio_player-@mpv@ --no-video}} + #the command to use for displaying thumbnails +-thumb_disp_method=${YTFZF_THUMB_DISP_METHOD-${thumb_disp_method-ueberzug}} ++thumb_disp_method=${YTFZF_THUMB_DISP_METHOD-${thumb_disp_method-@ueberzug@}} + #Storing the argument and location for autogenerated subtitles + [ -z "$YTFZF_SUBT_NAME" ] && YTFZF_SUBT_NAME="" + #Stores the language for the auto genereated subtitles +@@ -85,8 +85,8 @@ subscriptions_file=${subscriptions_file-$config_dir/subscriptions} + #> stores the pid of running ytfzf sessions + pid_file="$cache_dir/.pid" + #> make folders that don't exist +-[ -d "$cache_dir" ] || mkdir -p "$cache_dir" +-[ -d "$thumb_dir" ] || mkdir -p "$thumb_dir" ++[ -d "$cache_dir" ] || @mkdir@ -p "$cache_dir" ++[ -d "$thumb_dir" ] || @mkdir@ -p "$thumb_dir" + + #> config settings + #list of shortcuts to use in fzf +@@ -177,12 +177,12 @@ dep_ck () { + done + unset Dep + } +-dep_ck "jq" "youtube-dl" "curl" ++dep_ck "@jq@" "@youtube-dl@" "@curl@" + + + #only check for mpv if $YTFZF_PLAYER is set to it + #don't check $YTFZF_PLAYER as it could be multiple commands +-[ "$video_player" = "mpv" ] && dep_ck "mpv" ++[ "$video_player" = "@mpv@" ] && dep_ck "@mpv@" + + ############################ + # Help Texts # +@@ -326,8 +326,8 @@ print_info () { + } + + print_error () { +- [ $ext_menu_notifs -eq 1 ] && notify-send "error" "$*" || printf "\033[31m$*\033[0m" >&2 +- [ $ext_menu_notifs -eq 1 ] && notify-send "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" || printf "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" >&2 ++ [ $ext_menu_notifs -eq 1 ] && @notify-send@ "error" "$*" || printf "\033[31m$*\033[0m" >&2 ++ [ $ext_menu_notifs -eq 1 ] && @notify-send@ "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" || printf "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" >&2 + } + + ############################ +@@ -398,12 +398,12 @@ format_fzf () { + format_menu () { + if [ "$is_ext_menu" -eq 0 ]; then + #dep_ck fzf here because it is only necessary to use here +- dep_ck "fzf" +- menu_command='column -t -s "$tab_space" | fzf -m --bind change:top --tabstop=1 --layout=reverse --delimiter="$tab_space" --nth=1,2 --expect="$shortcuts" $FZF_DEFAULT_OPTS' ++ dep_ck "@fzf@" ++ menu_command='@column@ -t -s "$tab_space" | @fzf@ -m --bind change:top --tabstop=1 --layout=reverse --delimiter="$tab_space" --nth=1,2 --expect="$shortcuts" $FZF_DEFAULT_OPTS' + format_fzf + else + # Dmenu doesn't render tabs so removing it +- menu_command='tr -d "$tab_space" | '"$external_menu" ++ menu_command='@tr@ -d "$tab_space" | '"$external_menu" + format_ext_menu + fi + } +@@ -461,13 +461,13 @@ ID="ytfzf-ueberzug" + WIDTH=$FZF_PREVIEW_COLUMNS + HEIGHT=$FZF_PREVIEW_LINES + start_ueberzug () { +- [ -e $FIFO ] || { mkfifo "$FIFO" || exit 1 ; } +- ueberzug layer --parser json --silent < "$FIFO" & ++ [ -e $FIFO ] || { @mkfifo@ "$FIFO" || exit 1 ; } ++ @ueberzug@ layer --parser json --silent < "$FIFO" & + exec 3>"$FIFO" + } + stop_ueberzug () { + exec 3>&- +- rm "$FIFO" > /dev/null 2>&1 ++ @rm@ "$FIFO" > /dev/null 2>&1 + } + + preview_img () { +@@ -476,12 +476,12 @@ preview_img () { + shorturl=${args##*${tab_space}|} + shorturl="${shorturl%% *}" + +- json_obj=$(printf "%s" "$videos_json" | jq '.[]|select( .videoID == "'"$shorturl"'")') ++ json_obj=$(printf "%s" "$videos_json" | @jq@ '.[]|select( .videoID == "'"$shorturl"'")') + + + IFS=$tab_space read -r title channel duration views date description <<-EOF + $( +- printf "%s" "$json_obj" | jq -r \ ++ printf "%s" "$json_obj" | @jq@ -r \ + ' + [.title,.channel,.duration,.views,.date,.description]|@tsv + ' +@@ -530,31 +530,31 @@ preview_img () { + } > "$FIFO" ;; + catimg) + printf "\n" +- catimg -w "$((thumb_width * 2))" "$IMAGE" ;; ++ @catimg@ -w "$((thumb_width * 2))" "$IMAGE" ;; + jp2a) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=24 "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=24 "$IMAGE" ;; + jp2a-8) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=8 "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=8 "$IMAGE" ;; + jp2a-4) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=4 "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=4 "$IMAGE" ;; + jp2a-gray|jp2a-grey) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" "$IMAGE" ;; + chafa) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" "$IMAGE" ;; + chafa-gray|chafa-grey) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=2 "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" --colors=2 "$IMAGE" ;; + chafa-4) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=16 "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" --colors=16 "$IMAGE" ;; + chafa-8) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=256 "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" --colors=256 "$IMAGE" ;; + custom) + if ! function_exists "handle_display_img"; then + printf "\033[031mERROR[#07]: \033[0m\033[1mhandle_display_img\033[0m is not defined" >&2 +@@ -585,20 +585,20 @@ download_thumbnails () { + if [ "$thumbnail_quality" -eq 1 ]; then + image_download () { + # higher quality images +- curl -s "$Url" -G --data-urlencode "sqp=" > "$thumb_dir/$Name.png" ++ @curl@ -s "$Url" -G --data-urlencode "sqp=" > "$thumb_dir/$Name.png" + } + else + image_download () { +- curl -s "$Url" > "$thumb_dir/$Name.png" ++ @curl@ -s "$Url" > "$thumb_dir/$Name.png" + } + fi + + print_info "Downloading Thumbnails...\n" + thumb_urls=$(printf "%s" "$*" |\ +- jq -r '.[]|[.thumbs,.videoID]|@tsv' ) ++ @jq@ -r '.[]|[.thumbs,.videoID]|@tsv' ) + + while IFS=$tab_space read -r Url Name; do +- sleep 0.001 ++ @sleep@ 0.001 + { + image_download + } & +@@ -628,7 +628,7 @@ get_sp_filter () { + #another example is sort by filter + upload date filter only changes one character as well + if [ -n "$filter_id" ]; then + #gets the character in the filter_id that needs to be replaced if upload_date_filter is also given +- upload_date_character=$(printf "%s" "$filter_id" | awk '{print substr($1, 8, 1)}') ++ upload_date_character=$(printf "%s" "$filter_id" | @awk@ '{print substr($1, 8, 1)}') + fi + + #For each of these, if upload_date_character is unset, the filter_id should be the normal filter +@@ -650,7 +650,7 @@ get_sp_filter () { + if [ -n "$upload_date_character" ]; then + #replaces the 8th character in the filter_id with the appropriate character + #the 8th character specifies the upload_date_filter +- sp=$(printf "%s" "$filter_id" | sed 's/\(.\{7\}\)./\1'"$upload_date_character"'/') ++ sp=$(printf "%s" "$filter_id" | @sed@ 's/\(.\{7\}\)./\1'"$upload_date_character"'/') + #otherwise set it to the filter_id + else + sp=$filter_id +@@ -660,15 +660,15 @@ get_sp_filter () { + + get_yt_json () { + # scrapes the json embedded in the youtube html page +- printf "%s" "$*" | sed -n '/var *ytInitialData/,$p' | tr -d '\n' |\ +- sed -E ' s_^.*var ytInitialData ?=__ ; s_;.*__ ;' ++ printf "%s" "$*" | @sed@ -n '/var *ytInitialData/,$p' | @tr@ -d '\n' |\ ++ @sed@ -E ' s_^.*var ytInitialData ?=__ ; s_;.*__ ;' + } + + get_yt_html () { + link=$1 + query=$2 + printf "%s" "$( +- curl "$link" -s \ ++ @curl@ "$link" -s \ + -G --data-urlencode "search_query=$query" \ + -G --data-urlencode "sp=$sp" \ + -H 'Authority: www.youtube.com' \ +@@ -684,7 +684,7 @@ get_video_data () { + # outputs tab and pipe separated fields: title, channel, view count, video length, video upload date, and the video id/url + # from the videos_json + printf "%s" "$*" |\ +- jq -r '.[]| "\(.title)'"$tab_space"'|\(.channel)'"$tab_space"'|\(.views)'"$tab_space"'|\(.duration)'"$tab_space"'|\(.date)'"$tab_space"'|\(.videoID)"' ++ @jq@ -r '.[]| "\(.title)'"$tab_space"'|\(.channel)'"$tab_space"'|\(.views)'"$tab_space"'|\(.duration)'"$tab_space"'|\(.date)'"$tab_space"'|\(.videoID)"' + } + + scrape_channel () { +@@ -694,7 +694,7 @@ scrape_channel () { + channel_url=$* + + # Converting channel title page url to channel video url +- if ! printf "%s" "$channel_url" | grep -q '/videos *$'; then ++ if ! printf "%s" "$channel_url" | @grep@ -q '/videos *$'; then + channel_url=${channel_url%/featured}/videos + fi + +@@ -706,8 +706,8 @@ scrape_channel () { + fi + + #gets the channel name from title of page +- channel_name=$(printf "%s" "$yt_html" | grep -o '.*' | +- sed \ ++ channel_name=$(printf "%s" "$yt_html" | @grep@ -o '.*' | ++ @sed@ \ + -e 's/ - YouTube//' \ + -e 's/<\/\?title>//g' \ + -e "s/'/'/g" \ +@@ -723,7 +723,7 @@ scrape_channel () { + + #gets a list of videos + videos_json=$(printf "%s" "$yt_json" |\ +- jq '[ .contents | ..|.gridVideoRenderer? | ++ @jq@ '[ .contents | ..|.gridVideoRenderer? | + select(. !=null) | + { + title: .title.runs[0].text, +@@ -736,7 +736,7 @@ scrape_channel () { + } + ]') + +- videos_json=$(printf "%s" "$videos_json" | jq '.[0:'$sub_link_count']') ++ videos_json=$(printf "%s" "$videos_json" | @jq@ '.[0:'$sub_link_count']') + printf "%s\n" "$videos_json" >> "$tmp_video_json_file" + #checks if it's empty in case it was defined in a config function eg: on_get_search + [ -z "$videos_data" ] && videos_data=$(get_video_data "$videos_json") +@@ -768,11 +768,11 @@ get_trending_url_data () { + scrape_pt () { + #gets a list of videos + pt_json=$( +- curl \ ++ @curl@ \ + -s "https://sepiasearch.org/api/v1/search/videos" \ + -G --data-urlencode "search=$*") + videos_json=$(printf "%s" "$pt_json" |\ +- jq '[ .data | .[] | ++ @jq@ '[ .data | .[] | + { + title: .name, + channel: .channel.displayName, +@@ -829,7 +829,7 @@ scrape_yt () { + fi + + #gets a list of videos +- videos_json=$(printf "%s" "$yt_json" | jq '[ .contents| ++ videos_json=$(printf "%s" "$yt_json" | @jq@ '[ .contents| + ..|.videoRenderer? | + select(. !=null) | + { +@@ -844,7 +844,7 @@ scrape_yt () { + } + ]') + +- playlist_json=$(printf "%s" "$yt_json" | jq '[ .contents| ++ playlist_json=$(printf "%s" "$yt_json" | @jq@ '[ .contents| + ..|.playlistRenderer? | + select(. !=null) | + { +@@ -904,31 +904,31 @@ get_search_query () { + #> To select videos from videos_data + user_selection () { + #remove subscription separators +- videos_data_clean=$(printf "%s" "$videos_data" | sed "/.*$tab_space$/d") ++ videos_data_clean=$(printf "%s" "$videos_data" | @sed@ "/.*$tab_space$/d") + + #$selected_data is the video the user picked + #picks the first n videos + if [ "$select_all" -eq 1 ] ; then + selected_data=$videos_data_clean + elif [ "$auto_select" -eq 1 ] ; then +- selected_data=$(printf "%s\n" "$videos_data_clean" | sed "${link_count}"q ) ++ selected_data=$(printf "%s\n" "$videos_data_clean" | @sed@ "${link_count}"q ) + #picks n random videos + elif [ "$random_select" -eq 1 ] ; then +- selected_data=$(printf "%s\n" "$videos_data_clean" | posix_shuf | head -n${link_count}) ++ selected_data=$(printf "%s\n" "$videos_data_clean" | posix_shuf | @head@ -n${link_count}) + #posix_shuf, pick the first $link_count videos + + #show thumbnail menu + elif [ "$show_thumbnails" -eq 1 ] ; then +- dep_ck "ueberzug" "fzf" ++ dep_ck "@ueberzug@" "@fzf@" + export YTFZF_THUMB_DISP_METHOD="$thumb_disp_method" +- [ "$thumb_disp_method" = "ueberzug" ] && start_ueberzug ++ [ "$thumb_disp_method" = "@ueberzug@" ] && start_ueberzug + #thumbnails only work in fzf, use fzf +- menu_command="fzf -m --tabstop=1 --bind change:top --delimiter=\"$tab_space\" \ ++ menu_command="@fzf@ -m --tabstop=1 --bind change:top --delimiter=\"$tab_space\" \ + --nth=1,2 --expect='$shortcuts' $FZF_DEFAULT_OPTS \ + --layout=reverse --preview \"sh $0 -U {}\" \ + --preview-window \"$PREVIEW_SIDE:50%:noborder:wrap\"" + selected_data=$( title_len=200 video_menu "$videos_data" ) +- [ "$thumb_disp_method" = "ueberzug" ] && stop_ueberzug ++ [ "$thumb_disp_method" = "@ueberzug@" ] && stop_ueberzug + # Deletes thumbnails if no video is selected + [ -z "$selected_data" ] && clean_up + #show regular menu +@@ -951,10 +951,10 @@ handle_shortcuts () { + case $selected_key in + "$urls_shortcut") printf "%s\n" $selected_urls; return 1 ;; + "$title_shortcut") +- printf "%s\n" "$selected_data" | awk -F " " '{print $1}'; return 1 ;; ++ printf "%s\n" "$selected_data" | @awk@ -F " " '{print $1}'; return 1 ;; + "$open_browser_shortcut") + for url in $selected_urls; do +- nohup $BROWSER "$url" >/dev/null 2>&1 ++ @nohup@ $BROWSER "$url" >/dev/null 2>&1 + done + return 1 ;; + "$watch_shortcut") is_download=0; is_audio_only=0; return 0;; +@@ -988,10 +988,10 @@ format_user_selection () { + 11) selected_urls=$selected_urls$new_line'https://www.youtube.com/watch?v='$surl ;; + 34) selected_urls=$selected_urls$new_line'https://www.youtube.com/playlist?list='$surl ;; + 36) +- selected_urls=$selected_urls$new_line"$(printf "%s" "$videos_json" | jq '.[].url' | grep -F "$surl" | tr -d '"')" ;; ++ selected_urls=$selected_urls$new_line"$(printf "%s" "$videos_json" | @jq@ '.[].url' | @grep@ -F "$surl" | @tr@ -d '"')" ;; + *) continue ;; + esac +- refined_selected_data=$refined_selected_data$new_line$(printf '%s' "$videos_data" | grep "|$surl" ) ++ refined_selected_data=$refined_selected_data$new_line$(printf '%s' "$videos_data" | @grep@ "|$surl" ) + done<<-EOF + $selected_data + EOF +@@ -1014,9 +1014,9 @@ print_data () { + get_video_format () { + # select format if flag given + [ $show_format -eq 0 ] && return +- formats=$(youtube-dl -F "$(printf "$selected_urls")") +- line_number=$(printf "$formats" | grep -n '.*extension resolution.*' | cut -d: -f1) +- quality=$(printf "$formats \n1 2 xAudio" | awk -v lineno=$line_number 'FNR > lineno {print $3}' | sort -n | awk -F"x" '{print $2 "p"}' | uniq | sed -e "s/Audiop/Audio/" -e "/^p$/d" | eval "$menu_command" | sed "s/p//g") ++ formats=$(@youtube-dl@ -F "$(printf "$selected_urls")") ++ line_number=$(printf "$formats" | @grep@ -n '.*extension resolution.*' | @cut@ -d: -f1) ++ quality=$(printf "$formats \n1 2 xAudio" | @awk@ -v lineno=$line_number 'FNR > lineno {print $3}' | @sort@ -n | @awk@ -F"x" '{print $2 "p"}' | @uniq@ | @sed@ -e "s/Audiop/Audio/" -e "/^p$/d" | eval "$menu_command" | @sed@ "s/p//g") + [ -z "$quality" ] && exit; + [ $quality = "Audio" ] && video_pref= && video_player="$audio_player" || video_pref="bestvideo[height=?$quality][vcodec!=?vp9]+bestaudio/best" + +@@ -1026,9 +1026,9 @@ get_video_format () { + get_sub_lang () { + if [ $auto_caption -eq 1 ]; then + #Gets the auto generated subs and stores them in a file +- sub_list=$(youtube-dl --list-subs --write-auto-sub "$selected_urls" | sed '/Available subtitles/,$d' | awk '{print $1}' | sed '1d;2d;3d') ++ sub_list=$(@youtube-dl@ --list-subs --write-auto-sub "$selected_urls" | @sed@ '/Available subtitles/,$d' | @awk@ '{print $1}' | @sed@ '1d;2d;3d') + if [ -n "$sub_list" ]; then +- [ -n "$selected_sub" ] || selected_sub=$(printf "$sub_list" | eval "$menu_command") && youtube-dl --sub-lang $selected_sub --write-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NAME="--sub-file=/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated subs not available." ++ [ -n "$selected_sub" ] || selected_sub=$(printf "$sub_list" | eval "$menu_command") && @youtube-dl@ --sub-lang $selected_sub --write-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NAME="--sub-file=/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated subs not available." + fi + unset sub_list + fi +@@ -1046,10 +1046,10 @@ open_player () { + if [ $detach_player -eq 1 ]; then + if [ -z "$video_pref" ] || [ $is_audio_only -eq 1 ]; then + printf "Opening Player: %s\n" "$video_player $*" +- setsid -f $video_player "$@" $YTFZF_SUBT_NAME >/dev/null 2>&1 ++ @setsid@ -f $video_player "$@" $YTFZF_SUBT_NAME >/dev/null 2>&1 + else + printf "Opening Player: %s\n" "$video_player_format$video_pref $*" +- setsid -f $video_player_format"$video_pref" "$@" $YTFZF_SUBT_NAME >/dev/null 2>&1 ++ @setsid@ -f $video_player_format"$video_pref" "$@" $YTFZF_SUBT_NAME >/dev/null 2>&1 + fi + return + fi +@@ -1064,9 +1064,9 @@ open_player () { + fi + elif [ $is_download -eq 1 ]; then + if [ -z "$video_pref" ]; then +- youtube-dl "$@" "$YTFZF_SUBT_NAME" ++ @youtube-dl@ "$@" "$YTFZF_SUBT_NAME" + else +- youtube-dl -f "$video_pref" "$@" $YTFZF_SUBT_NAME || video_pref= open_player "$@" ++ @youtube-dl@ -f "$video_pref" "$@" $YTFZF_SUBT_NAME || video_pref= open_player "$@" + fi + fi + } +@@ -1087,7 +1087,7 @@ play_url () { + fi + + #Delete the temp auto-gen subtitle file +- [ $auto_caption -eq 1 ] && rm -f "${YTFZF_SUBT_NAME#*=}" ++ [ $auto_caption -eq 1 ] && @rm@ -f "${YTFZF_SUBT_NAME#*=}" + + unset player_urls + } +@@ -1102,7 +1102,7 @@ session_is_running () { + #> removes tmp files and clutter + clean_up () { + if ! session_is_running ; then +- [ -d "$thumb_dir" ] && rm -r "$thumb_dir" ++ [ -d "$thumb_dir" ] && @rm@ -r "$thumb_dir" + : > "$pid_file" + function_exists "on_exit" && on_exit + fi +@@ -1124,9 +1124,9 @@ save_before_exit () { + check_if_url () { + # to check if given input is a url + url_regex='^https\?://.*' +- if printf "%s" "$1" | grep -q "$url_regex"; then ++ if printf "%s" "$1" | @grep@ -q "$url_regex"; then + is_url=1 +- selected_urls=$(printf "%s" "$1" | tr ' ' '\n') ++ selected_urls=$(printf "%s" "$1" | @tr@ ' ' '\n') + scrape="url" + else + is_url=0 +@@ -1139,10 +1139,10 @@ get_history () { + if [ "$enable_hist" -eq 1 ]; then + [ -e "$history_file" ] || : > "$history_file" + #gets history data in reverse order (makes it most recent to least recent) +- hist_data=$( sed '1!G; h; $!d' "$history_file" ) ++ hist_data=$( @sed@ '1!G; h; $!d' "$history_file" ) + [ -z "$hist_data" ] && printf "History is empty!\n" >&2 && return 1; + #removes duplicate values from $history_data +- videos_data=$(printf "%s" "$hist_data" | uniq ) ++ videos_data=$(printf "%s" "$hist_data" | @uniq@ ) + [ "$sort_videos_data" -eq 1 ] && videos_data="$(printf "%s" "$videos_data" | sort_video_data_fn)" + else + printf "History is not enabled. Please enable it to use this option (-H).\n" >&2; +@@ -1177,10 +1177,10 @@ get_search_history () { + if [ "$enable_search_hist" -eq 1 ]; then + [ -e "$search_history_file" ] || : > "$search_history_file" + #gets history data in reverse order (makes it most recent to least recent) +- hist_data=$( sed '1!G; h; $!d' "$search_history_file" ) ++ hist_data=$( @sed@ '1!G; h; $!d' "$search_history_file" ) + [ -z "$hist_data" ] && printf "Search history is empty!\n" >&2 && return 1; + #removes duplicate values from $history_data +- search_history=$(printf "%s" "$hist_data" | uniq ) ++ search_history=$(printf "%s" "$hist_data" | @uniq@ ) + else + printf "Search history is not enabled. Please enable it to use this option (-q).\n" >&2; + exit 1; +@@ -1190,7 +1190,7 @@ get_search_history () { + + set_search_history () { + [ -z "$search_query" ] && return +- [ $enable_search_hist -eq 1 ] && printf "%s\t%s\n" "$(date '+%Y-%m-%d %H:%M:%S')" "$search_query" >> "$search_history_file" ; ++ [ $enable_search_hist -eq 1 ] && printf "%s\t%s\n" "$(@date@ '+%Y-%m-%d %H:%M:%S')" "$search_query" >> "$search_history_file" ; + } + + search_history_menu () { +@@ -1200,15 +1200,15 @@ search_history_menu () { + #when using an external menu, the search history will be done there + choice=$( printf "%s\n" "$search_history" | eval "$external_menu" ) + else +- choice="$( printf "%s\n" "$search_history" | fzf --prompt="$search_history_prompt" --print-query --no-multi -d '\t' --with-nth=2.. --expect='alt-enter' --bind='tab:replace-query' )" ++ choice="$( printf "%s\n" "$search_history" | @fzf@ --prompt="$search_history_prompt" --print-query --no-multi -d '\t' --with-nth=2.. --expect='alt-enter' --bind='tab:replace-query' )" + fi + + # first line is the fzf query (what the user types in fzf) + # second line is the fzf --expect key pressed + # third line is the search_history selection made +- query="$( printf "%s" "$choice" | sed -n '1p' )" +- key="$( printf "%s" "$choice" | sed -n '2p' )" +- selection="$( printf "%s" "$choice" | sed -n '3p' )" ++ query="$( printf "%s" "$choice" | @sed@ -n '1p' )" ++ key="$( printf "%s" "$choice" | @sed@ -n '2p' )" ++ selection="$( printf "%s" "$choice" | @sed@ -n '3p' )" + + # if no search history selection has been made + # and the user typed a query, use that instead +@@ -1225,7 +1225,7 @@ search_history_menu () { + search_query="$query" + return;; + esac +- search_query="$( printf "%s" "$selection" | awk -F'\t' '{printf "%s", $NF}' )" ++ search_query="$( printf "%s" "$selection" | @awk@ -F'\t' '{printf "%s", $NF}' )" + } + + ! function_exists "send_select_video_notif" && send_select_video_notif () { +@@ -1244,13 +1244,13 @@ search_history_menu () { + + #if downloading, say Downloading not currently playing + [ $is_download -eq 1 ] && title="Downloading" || title="Currently playing" +- notify-send "$title" "$message" -i "$video_thumb" ++ @notify-send@ "$title" "$message" -i "$video_thumb" + + unset message video_thumb title + } + + send_notify () { +- videos_selected_count=$(printf "%s\n" "$*" | wc -l) ++ videos_selected_count=$(printf "%s\n" "$*" | @wc@ -l) + while IFS=$tab_space read -r video_title video_channel video_views video_duration video_date video_shorturl; do + send_select_video_notif + done << EOF +@@ -1284,14 +1284,14 @@ if ! function_exists "data_sort_key"; then + sort_by="${5#|}" + sort_by="${sort_by#Streamed}" + #print the data that should be sorted by +- printf "%d" "$(date -d "${sort_by}" '+%s')" ++ printf "%d" "$(@date@ -d "${sort_by}" '+%s')" + unset sort_by + } + fi + #the function to use for sorting + if ! function_exists "data_sort_fn"; then + data_sort_fn () { +- sort -nr ++ @sort@ -nr + } + fi + sort_video_data_fn () { +@@ -1300,7 +1300,7 @@ sort_video_data_fn () { + IFS="$tab_space" + #run the key function to get the value to sort by + printf "%s\t%s\n" "$(data_sort_key $line)" "$line" +- done | data_sort_fn | cut -f2- ++ done | data_sort_fn | @cut@ -f2- + unset IFS line + } + +@@ -1314,19 +1314,19 @@ scrape_subscriptions () { + while IFS= read -r url; do + scrape_channel "$url" & + done <<-EOF +- $( sed \ ++ $( @sed@ \ + -e "s/#.*//" \ + -e "/^[[:space:]]*$/d" \ + -e "s/[[:space:]]*//g" \ + "$subscriptions_file") + EOF + wait +- videos_json="$(cat "$tmp_video_json_file")" ++ videos_json="$(@cat@ "$tmp_video_json_file")" + export videos_json + if [ $sort_videos_data -eq 1 ]; then + videos_data=$(sort_video_data_fn < "$tmp_video_data_file") + else +- videos_data=$(cat "$tmp_video_data_file") ++ videos_data=$(@cat@ "$tmp_video_data_file") + fi + } + +@@ -1346,11 +1346,11 @@ create_subs () { + : > "$config_dir/subscriptions" + + # check how many subscriptions there are in the file +- sublength=$( jq '. | length' < "$yt_sub_import_file" ) ++ sublength=$( @jq@ '. | length' < "$yt_sub_import_file" ) + +- for i in $(seq $((sublength - 1))); do +- channelInfo=$(jq --argjson index ${i} '[ "https://www.youtube.com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "#" + .[$index].snippet.title ]' < "$yt_sub_import_file") +- printf "%s\n" "$(printf "%s" "$channelInfo" | tr -d '[]"\n,')" >> "$subscriptions_file" ++ for i in $(@seq@ $((sublength - 1))); do ++ channelInfo=$(@jq@ --argjson index ${i} '[ "https://www.youtube.com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "#" + .[$index].snippet.title ]' < "$yt_sub_import_file") ++ printf "%s\n" "$(printf "%s" "$channelInfo" | @tr@ -d '[]"\n,')" >> "$subscriptions_file" + done + exit + } +@@ -1367,10 +1367,10 @@ verify_thumb_disp_method () { + + #sort -R is not posix + posix_shuf () { +- awk -F '\n' ' ++ @awk@ -F '\n' ' + BEGIN {srand()} #set the random seed at the start + {print rand() " " $0} #prepend a random number for each line' |\ +- sort | sed -E 's/[^ ]* //' ++ @sort@ | @sed@ -E 's/[^ ]* //' + #sort by the random numbers, remove the random number + } + +@@ -1486,8 +1486,8 @@ parse_opt () { + exit ;; + version) + printf "\033[1mytfzf:\033[0m %s\n" "$YTFZF_VERSION" +- printf "\033[1myoutube-dl:\033[0m %s\n" "$(youtube-dl --version)" +- command -v "fzf" 1>/dev/null && printf "\033[1mfzf:\033[0m %s\n" "$(fzf --version)" ++ printf "\033[1myoutube-dl:\033[0m %s\n" "$(@youtube-dl@ --version)" ++ command -v "@fzf@" 1>/dev/null && printf "\033[1mfzf:\033[0m %s\n" "$(@fzf@ --version)" + exit ;; + + subt) +@@ -1559,19 +1559,19 @@ done + shift $((OPTIND-1)) + + #only apply to ext_menu since they dont have a terminal to print to +-[ $is_ext_menu -eq 1 ] && command -v notify-send 1>/dev/null 2>&1 && ext_menu_notifs=1 || ext_menu_notifs=0 ++[ $is_ext_menu -eq 1 ] && command -v @notify-send@ 1>/dev/null 2>&1 && ext_menu_notifs=1 || ext_menu_notifs=0 + + #used for thumbnail previews in ueberzug + if [ $is_ext_menu -eq 0 ]; then +- export TTY_LINES=$(tput lines) +- export TTY_COLS=$(tput cols) ++ export TTY_LINES=$(@tput@ lines) ++ export TTY_COLS=$(@tput@ cols) + fi + + #if both are true, it defaults to using fzf, and if fzf isnt installed it will throw an error + #so print this error instead and set $show_thumbnails to 0 + if [ $is_ext_menu -eq 1 ] && [ $show_thumbnails -eq 1 ]; then + [ $ext_menu_notifs -eq 1 ] &&\ +- notify-send "warning" "Currently thumbnails do not work in external menus" ||\ ++ @notify-send@ "warning" "Currently thumbnails do not work in external menus" ||\ + printf "\033[33mWARNING: Currently thumbnails do not work in external menus\033[0m\n" >&2 + show_thumbnails=0 + fi +-- +2.32.0 + diff --git a/gnu/packages/patches/ytfzf-updates.patch b/gnu/packages/patches/ytfzf-updates.patch new file mode 100644 index 0000000000..1790b7a238 --- /dev/null +++ b/gnu/packages/patches/ytfzf-updates.patch @@ -0,0 +1,44 @@ +From 75bf4f584866a013d5618ea6be19e97a8196d63e Mon Sep 17 00:00:00 2001 +From: Raghav Gururajan +Date: Mon, 5 Jul 2021 06:47:38 -0400 +Subject: [PATCH 2/2] Disable updates within the application. + +Patch the code responsible for self-updating the application. + +Co-authored-by: jgart +--- + ytfzf | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) + +diff --git a/ytfzf b/ytfzf +index 0a2c372..845e8e9 100755 +--- a/ytfzf ++++ b/ytfzf +@@ -1260,22 +1260,8 @@ EOF + } + + update_ytfzf () { +- branch="$1" +- updatefile="/tmp/ytfzf-update" +- curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile" +- +- if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh'; then +- chmod 755 "$updatefile" +- [ "$(uname)" = "Darwin" ] && prefix="/usr/local/bin" || prefix="/usr/bin" +- function_exists "sudo" && doasroot="sudo" || doasroot="doas" +- $doasroot cp "$updatefile" "$prefix/ytfzf" +- unset prefix doasroot +- else +- printf "%bFailed to update ytfzf. Try again later.%b" "$c_red" "$c_reset" +- fi +- +- rm "$updatefile" +- exit 0 ++ printf "%bUpdates have to be installed with Guix.%b\n" "$c_red" "$c_reset" ++ exit 1 + } + + #gives a value to sort by (this will give the unix time the video was uploaded) +-- +2.32.0 + -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 08:02:27 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 12:02:27 +0000 Received: from localhost ([127.0.0.1]:44321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NIw-0007tJ-Qq for submit@debbugs.gnu.org; Mon, 05 Jul 2021 08:02:27 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:39510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NIt-0007pw-Sz for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 08:02:25 -0400 Received: from butterfly.local ([188.189.37.160]) by andre.telenet-ops.be with bizsmtp id RQ2M250063TK16401Q2M7h; Mon, 05 Jul 2021 14:02:22 +0200 Message-ID: <43898301886a211ed76e3bdea47203ca5dcf9625.camel@telenet.be> Subject: Re: [bug#49238] [PATCH v3 2/2] gnu: Add ytfzf. From: Maxime Devos To: Raghav Gururajan , 49238@debbugs.gnu.org Date: Mon, 05 Jul 2021 14:02:20 +0200 In-Reply-To: <20210705111425.14479-2-rg@raghavgururajan.name> References: <20210705111425.14479-1-rg@raghavgururajan.name> <20210705111425.14479-2-rg@raghavgururajan.name> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-FjbmS081+JGOdI/a2ze5" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1625486542; bh=9YWG+EkxnYX4mC80dONLM7li7J8yKTV7ocBsv+eumJM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=NLyOtUaP5f0qQsctFnnU1z0IOTc7Mw+7NJxQfI+ZzLWMuPOLI0jBW2dBO+yeO5P73 QSVxppuLvvMKisqt1H7vqMPOq4Hcb7FZx+TVPI/ZWWElNj3Vgt515A8ALx0eEBXEPl F04qbjd61t+owLjDea9AX6k2gDzGg2fMJbEA0MlPOQzAb/olATlXESkwX45dnlodAS xZpBRY8xYeBuWDvvg5wcvEvcdBWRj7B1Q+KR7KAyoNIucTyAgMGKCWZV1Zx3U5GyBp n+jX3xljlbcxYNfoA08aWDCS/608QeKdxxjcLeGokYC2Jq+WW9UPUjESPcljdbqJcg LMNBoSJmdZsxw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49238 Cc: jgart X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-FjbmS081+JGOdI/a2ze5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, > + (modify-phases %standard-phases > + (add-after 'unpack 'patch > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (binutils (assoc-ref inputs "binutils")) The 'binutils' input doesn't seem to be used anywhere. > + if [ -n "$sub_list" ]; then > +- [ -n "$selected_sub" ] || selected_sub=3D$(printf "$sub_li= st" | eval "$menu_command") && youtube-dl --sub-lang $selected_sub --wri= te-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NA= ME=3D"--sub-file=3D/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated = subs not available." > ++ [ -n "$selected_sub" ] || selected_sub=3D$(printf "$sub_li= st" | eval "$menu_command") && @youtube-dl@ --sub-lang $selected_sub --w= rite-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_= NAME=3D"--sub-file=3D/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generate= d subs not available." For a previous version of this patch series, I noted that writing /tmp/ytfzf is quite possibly insecure, and also incorrect on multi-user systems. I don't see this addressed anywhere. Greetings, Maxime. --=-FjbmS081+JGOdI/a2ze5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYOL0zBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7tiHAQDZpO/ZidvfIpGONMjr+7C/3hPA WXu1KOvgSOM+0yOq7AD5AUdYpbPtq1lk0Xo7SPjYhJW2aJvRJWQVpjNZZ30TGQk= =iy0Q -----END PGP SIGNATURE----- --=-FjbmS081+JGOdI/a2ze5-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 08:04:00 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 12:04:00 +0000 Received: from localhost ([127.0.0.1]:44330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NKS-0008Bl-C6 for submit@debbugs.gnu.org; Mon, 05 Jul 2021 08:04:00 -0400 Received: from out0.migadu.com ([94.23.1.103]:41933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NKP-0008Bb-OG for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 08:03:59 -0400 To: Maxime Devos DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1625486635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QLLSpJw32BtjK5WFweYUcdvqiPJfEVSJNd2toOztTbE=; b=eV7EVMY9Iws3IrHVjOmn/MYGxMLPoh/agL3sG7Pv32T1TfTsOrA99OwA9U7ZVBHZElfNpO qzJTaoJ4qANMhEIs0JTlJnvA02OZX3nzEdCAvtAt9pU2hQZb4aXhkLBmgw1T0dt2aCVLTh xGpJtydXCkVkZhHYkmyTEdNErZlvIe5CPNIo9iOLSI68YFzCQcoht9xWoCN7bvNjgF3c7u AdbJUTGl3mi1eetXwV1g+he2qXOhYpNNvSL+Ttch7nG1Ujgxbu1j/lgEjmWDmGuneFNlsN UsI02FUaiHgmICq6Lr4mXRT/fYNv73y0972Q1KHBlj3LsCwWGknSl7GOrAR2ww== References: <20210627054737.7972-1-rg@raghavgururajan.name> <20210627054737.7972-2-rg@raghavgururajan.name> <2e6b08035ebeddd60faa283e0a183d8d76e0f709.camel@telenet.be> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Raghav Gururajan Subject: Re: [bug#49238] [PATCH v1 2/2] gnu: Add ytfzf. Message-ID: Date: Mon, 5 Jul 2021 08:03:53 -0400 MIME-Version: 1.0 In-Reply-To: <2e6b08035ebeddd60faa283e0a183d8d76e0f709.camel@telenet.be> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TNizMfWK7IDDTthxpSLbDS1l3srJBTE6h" X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49238 Cc: 49238@debbugs.gnu.org, jgart@dismail.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TNizMfWK7IDDTthxpSLbDS1l3srJBTE6h Content-Type: multipart/mixed; boundary="5eg7lQUWQzGYbsv2CDgwdZ6JfLqJ0F3q6"; protected-headers="v1" From: Raghav Gururajan To: Maxime Devos Cc: jgart@dismail.de, 49238@debbugs.gnu.org Message-ID: Subject: Re: [bug#49238] [PATCH v1 2/2] gnu: Add ytfzf. References: <20210627054737.7972-1-rg@raghavgururajan.name> <20210627054737.7972-2-rg@raghavgururajan.name> <2e6b08035ebeddd60faa283e0a183d8d76e0f709.camel@telenet.be> In-Reply-To: <2e6b08035ebeddd60faa283e0a183d8d76e0f709.camel@telenet.be> --5eg7lQUWQzGYbsv2CDgwdZ6JfLqJ0F3q6 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: quoted-printable Hi Maxime! > That's a neat trick to avoid fragile (substitute* ...). > However, as I understand it, the origin is meant to be > usable as source code (think install dependencies && guix build && tar = xzf stuff.tgz > && ./configure && make && try it out), such that > "guix build --source=3Dtransitive stuff" would give all the > source code for building stuff (in the sense of =E2=80=98Corresponding = Source=E2=80=99 > of the GPL), and "guix-mpv", 'guix-jq" ... don't exist anywhere. >=20 > I don't know if that has been spelled out somewhere though. >=20 > I'd suggest adding "patch" to 'native-inputs', adding the patch > to 'inputs' or 'native-inputs' (doesn't really matter which) and > doing (invoke "patch" OPTIONS "blabla.patch") before the substitute*. >=20 > Actually, myself I'm not convinced because you could consider > the package definition itself to be part of the =E2=80=98corresponding = source=E2=80=99. I get the idea, but I don't think we can call .patch files inside=20 phases, the patches directory is not exposed/available inside=20 build-environment. > I'm wondering if (string-append (assoc-ref inputs "catimg") "/bin/catim= g") > would be better, as 'string-append' is less complex than 'format' > and "format" doesn't seem to provide any additional value here. Cool! I have made this change in v4. > Now about the patch: >=20 > Maybe tell people to report issues at bug-guix@gnu.org or #guix? Dunno Changed in v4. > Don't forget to patch 'column'. >=20 > Don't forget to patch "mkfifo". >=20 > Don't forget patching 'sleep'. It is not shell a built-in > (try "type sleep" and "type [" in a terminal"). >=20 > Don't forget patching 'grep' and 'tr'. >=20 > Don't forget 'grep -> guix-grep' and 'cut -> guix-cut' >=20 > Don't forget 'awk -> guix-awk' and 'sort -> guix-sort' and 'uniq -> 'gu= ix-uniq' >=20 > Don't forget 'sed -> guix-sed' and 'awk -> guix-awk' Thanks, I have patched these in v4. > FWIW, writing to "/tmp/ytfzf" seems to be a potential security problem > and bad behaviour on multiple-user systems. >=20 > What would happen if /tmp/ytfzf is a symlink to /etc/passwd an ytfzf is= run > as root (yes, running as root is not recommended)? Would that brick the= system? > What if /tmp/ytfzf is a symlink to ~/.profile? Would that brick the log= in? >=20 > What if multiple users run ytfzf concurrently? Would they overwrite eae= ch > other subtitles? Would a different user be able to see what the other > is downloading? >=20 > A relatively easy fix would be to write to, say, $HOME/.cache/ytzf-subs= > instead (not sure what the proper directory would be), which is complet= ely > under the user's control. Good catch. I have changed this in v4. Let me know if v4 looks good. Regards, RG. --5eg7lQUWQzGYbsv2CDgwdZ6JfLqJ0F3q6-- --TNizMfWK7IDDTthxpSLbDS1l3srJBTE6h Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTNLV6qqYzLN9qR1rBfWBZkf4vlUQUCYOL1KQUDAAAAAAAKCRBfWBZkf4vlUVrR AQCOAlVxtTsBgWRC3yRBy2WcVqq/p9aHcy7IHY/v4sH/jQEAtzYIbv2eVZEZKDQJjvMJuRsO93Zc mOnrPcFiXl38MgE= =bcn4 -----END PGP SIGNATURE----- --TNizMfWK7IDDTthxpSLbDS1l3srJBTE6h-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 08:13:48 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 12:13:48 +0000 Received: from localhost ([127.0.0.1]:44343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NTw-0008Q8-4m for submit@debbugs.gnu.org; Mon, 05 Jul 2021 08:13:48 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:36892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NTt-0008Px-FO for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 08:13:46 -0400 Received: from butterfly.local ([188.189.37.160]) by andre.telenet-ops.be with bizsmtp id RQDj250013TK16401QDj6N; Mon, 05 Jul 2021 14:13:43 +0200 Message-ID: Subject: Re: [bug#49238] [PATCH v1 2/2] gnu: Add ytfzf. From: Maxime Devos To: Raghav Gururajan Date: Mon, 05 Jul 2021 14:13:32 +0200 In-Reply-To: References: <20210627054737.7972-1-rg@raghavgururajan.name> <20210627054737.7972-2-rg@raghavgururajan.name> <2e6b08035ebeddd60faa283e0a183d8d76e0f709.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-4dAS71LEVbi+WHU36BWR" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1625487224; bh=5cgA5sGWx/H718+cg5XFSDHuBv01lAuY5G/kcsc7Ns4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=hMZLgP6DIPwIbIrwz7M+FBziqOup1lcEOJVfPUViqGArSz5hazGVz4uSxpYSHqHlB g17eJVL3U4UjH4O8dNrXc/KH2M3XvXnC7HQ8x+nWmF6WTTDL2LRbczkdNjV4Zee01s dJTZ+doDaF/FVe/6J9/YzqUMSTu2Y9o5BNMiVzG+Eb3zPj8Rxrmr5fGqHmqQxl3W/j exXYML/iIbo/jmBD1KsWcxXdwYLDg1QMGdJG23r/S8E7nT9QEyJbe73F1KN3yIU52R fTMZFOjp1eJrsz6x4qWwz+c+PjKz5iS2XSZ5l4sp1BhXgB/EK+zXIxQ1pnsyWII5Ag dRStMQRfYVUGw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49238 Cc: 49238@debbugs.gnu.org, jgart@dismail.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-4dAS71LEVbi+WHU36BWR Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Raghav Gururajan schreef op ma 05-07-2021 om 08:03 [-0400]: > [...] > >=20 > > I'd suggest adding "patch" to 'native-inputs', adding the patch > > to 'inputs' or 'native-inputs' (doesn't really matter which) and > > doing (invoke "patch" OPTIONS "blabla.patch") before the substitute*. > >=20 > > [...] > > I get the idea, but I don't think we can call .patch files inside=20 > phases, the patches directory is not exposed/available inside=20 > build-environment. If the relevant patch files are added to 'inputs' or 'native-inputs', then they are available in the build environment. As an example, see the "libpng-apng" package. It adds the patch to 'inputs' (named "apng") and invokes "patch" during the 'patch-apng' phase. The "apng" input uses an 'origin' reference, but you could use (local-file ...) there as well. Or beter: use 'search-patch' instead. Greetings, Maxime. --=-4dAS71LEVbi+WHU36BWR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYOL3bBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7idkAQC/OUgDsUAQxrMJkwlNinH0qX+Q WnmldBspUR6kSwDH/wEA/mXRFnDLrbyfl65S0iOXeihsvVNhYf8ygC1Ca5N31g0= =LK2J -----END PGP SIGNATURE----- --=-4dAS71LEVbi+WHU36BWR-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 08:19:16 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 12:19:17 +0000 Received: from localhost ([127.0.0.1]:44349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NZE-00007J-OX for submit@debbugs.gnu.org; Mon, 05 Jul 2021 08:19:16 -0400 Received: from out2.migadu.com ([188.165.223.204]:65013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NZC-000077-1U for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 08:19:15 -0400 To: Maxime Devos DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1625487552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1YPj6y7q2Evy3mzVqWCKBUoVYT/iuz9wiHWTew1pJtM=; b=Tx1Sc2T/32z6KwQluXFKMPHSjhhn9ZGFnNvhzO8iFvpVlTi1+/FG5KahJX4eJkuJxrdy5I Iisk4TjbRK00gUf97KcwIs9prUjs+h1H+Y0hbgUKtSUxSF9le+ymR86Nh+2eaV+pfZicFM nTMfIf81apZKV+O3KHtbQEjzeOkYmUoiBovvToHJYEchoJXHqu0SMFSTlH7Dj9K3HqBE5b yt6MMGnmf3c51f2u3TKnkRDUUEzLFGjIEiPrRF5FaRKLwUU5Jhx0gOrumy99wYkaLwMF6E 9KaabxZKuyUVPlXEz2/5BTTBJYmLiNbH8KpOflfleT1jC2MCi7IuamCFm/56Hg== References: <20210705111425.14479-1-rg@raghavgururajan.name> <20210705111425.14479-2-rg@raghavgururajan.name> <43898301886a211ed76e3bdea47203ca5dcf9625.camel@telenet.be> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Raghav Gururajan Subject: Re: [bug#49238] [PATCH v3 2/2] gnu: Add ytfzf. Message-ID: <3b9e2954-3d44-4df7-637d-6672cd0d6623@raghavgururajan.name> Date: Mon, 5 Jul 2021 08:19:09 -0400 MIME-Version: 1.0 In-Reply-To: <43898301886a211ed76e3bdea47203ca5dcf9625.camel@telenet.be> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SHIxbj5I5oYSXvHv6ZsxSnex0TT9Hr0rw" X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49238 Cc: 49238@debbugs.gnu.org, jgart X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SHIxbj5I5oYSXvHv6ZsxSnex0TT9Hr0rw Content-Type: multipart/mixed; boundary="B55hV6LyDRbf1bHcDIvgZiQ4YDEgqmAuF"; protected-headers="v1" From: Raghav Gururajan To: Maxime Devos Cc: jgart , 49238@debbugs.gnu.org Message-ID: <3b9e2954-3d44-4df7-637d-6672cd0d6623@raghavgururajan.name> Subject: Re: [bug#49238] [PATCH v3 2/2] gnu: Add ytfzf. References: <20210705111425.14479-1-rg@raghavgururajan.name> <20210705111425.14479-2-rg@raghavgururajan.name> <43898301886a211ed76e3bdea47203ca5dcf9625.camel@telenet.be> In-Reply-To: <43898301886a211ed76e3bdea47203ca5dcf9625.camel@telenet.be> --B55hV6LyDRbf1bHcDIvgZiQ4YDEgqmAuF Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: quoted-printable Hi Maxime! > The 'binutils' input doesn't seem to be used anywhere. >=20 > I don't see this addressed anywhere. My v4 patch-set didn't come through it seems. Regards, RG. --B55hV6LyDRbf1bHcDIvgZiQ4YDEgqmAuF-- --SHIxbj5I5oYSXvHv6ZsxSnex0TT9Hr0rw Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTNLV6qqYzLN9qR1rBfWBZkf4vlUQUCYOL4vQUDAAAAAAAKCRBfWBZkf4vlUQ2s AQCmNbc9ldCdM4dT723qNyjoEDrxOdcnTfO50UzOdc1a8gEAojlSIR+TQUkAQSKrgXx5+iiIgwz2 p/MGm0kUgd10LAQ= =zzK6 -----END PGP SIGNATURE----- --SHIxbj5I5oYSXvHv6ZsxSnex0TT9Hr0rw-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 08:21:01 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 12:21:01 +0000 Received: from localhost ([127.0.0.1]:44354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Nav-00009x-1n for submit@debbugs.gnu.org; Mon, 05 Jul 2021 08:21:01 -0400 Received: from out0.migadu.com ([94.23.1.103]:45377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Nat-00009p-Dj for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 08:21:00 -0400 To: Maxime Devos DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1625487658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=E+yxTb6ZjXyd8x/xRz+Jhe3RgIfURbh5hqRTSVHZAno=; b=nhou+cIHAD/hqjD3U5+dXP0axrVK5sFZ6OXHJohI/QALyywO9BbiHryp+FR1D+qAtP6cMC haABYHbrKqP04je5UHD2caCRhBwkCLxIL64m1YgYH6PEtPwOvlon9vWTRKdgN1yHZ0KIhY FLWQX6507JFn/9LhgNtmnMdyLczmIkNV1fXk7XPPQ26grjZdiC6xRtFiYkG/TULZtACa8p HApQLrjDjAvzgAdavYHsVUC4imLEKT+zUJsjiSyPKRSZ2MoL6chH1yB32uDSfSRavCTR/s dzclRE0qHCPB/QhOkSSEWO96qTWLPHFNxI2IFYzH1BF/T/mTNKeE0e4leddMNg== References: <20210627054737.7972-1-rg@raghavgururajan.name> <20210627054737.7972-2-rg@raghavgururajan.name> <2e6b08035ebeddd60faa283e0a183d8d76e0f709.camel@telenet.be> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Raghav Gururajan Subject: Re: [bug#49238] [PATCH v1 2/2] gnu: Add ytfzf. Message-ID: Date: Mon, 5 Jul 2021 08:20:56 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fRv3ydvfduBYlRCp2lY2OHZn7vuz0PKWS" X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49238 Cc: 49238@debbugs.gnu.org, jgart@dismail.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fRv3ydvfduBYlRCp2lY2OHZn7vuz0PKWS Content-Type: multipart/mixed; boundary="BV2s8IJ1fBJeqttXzCq0ZsgjrOBY1sELE"; protected-headers="v1" From: Raghav Gururajan To: Maxime Devos Cc: jgart@dismail.de, 49238@debbugs.gnu.org Message-ID: Subject: Re: [bug#49238] [PATCH v1 2/2] gnu: Add ytfzf. References: <20210627054737.7972-1-rg@raghavgururajan.name> <20210627054737.7972-2-rg@raghavgururajan.name> <2e6b08035ebeddd60faa283e0a183d8d76e0f709.camel@telenet.be> In-Reply-To: --BV2s8IJ1fBJeqttXzCq0ZsgjrOBY1sELE Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: quoted-printable Hi Maixme! >> I get the idea, but I don't think we can call .patch files inside >> phases, the patches directory is not exposed/available inside >> build-environment. >=20 > If the relevant patch files are added to 'inputs' or 'native-inputs', > then they are available in the build environment. As an example, > see the "libpng-apng" package. It adds the patch to 'inputs' > (named "apng") and invokes "patch" during the 'patch-apng' phase. >=20 > The "apng" input uses an 'origin' reference, but you could use > (local-file ...) there as well. Or beter: use 'search-patch' > instead. Ah thanks so much for the pointer. Since my v4 patch-set didn't come=20 through, I'll make this change and send v5. Regards, RG. --BV2s8IJ1fBJeqttXzCq0ZsgjrOBY1sELE-- --fRv3ydvfduBYlRCp2lY2OHZn7vuz0PKWS Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTNLV6qqYzLN9qR1rBfWBZkf4vlUQUCYOL5KAUDAAAAAAAKCRBfWBZkf4vlUet+ AP9fn+jVFR/r74QSJmR+i8bU9/XuTL2DyawZiYf7qxv53AD/cEQy0kOXtL+WTcvhMfDbIeMElmqd gY+aI50k7+HUvAQ= =gizH -----END PGP SIGNATURE----- --fRv3ydvfduBYlRCp2lY2OHZn7vuz0PKWS-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:10:14 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 15:10:14 +0000 Received: from localhost ([127.0.0.1]:46423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QEg-0003d0-Br for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:10:14 -0400 Received: from out2.migadu.com ([188.165.223.204]:17207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QEd-0003ce-7A for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 11:10:12 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1625497809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0NYftBhdwMWQRjhTZ9JRrAOOiwsvEKyP0xPGOsxYjw=; b=Rx2LTDrSeKCAYsXBpcDN+DG4NkNVAnrsW3BAy9vMIXu0kQylJhJqObxO9RDhhxiGcwalxj 4XD1VY+DjtlWxMs77WgcT/hCiG7jb1/bc+i/0KCewp2F94ZWYKaJonkoBwaeb7yfLbxWJL dmBAmB2OS9Fg0E8jzKATuuvh2DuTqmytlwTrlGeypkYbWzUq4cjLdWvwapyeZ+j2q1K9q1 uXS5b9qVwwUKv1J+cGmde3jidN3fWk8NV72cIBcAbTVAE2a9vN9nyLDrPPv6ZerSmsCO4+ vA8nebLS2od9QRseaJyP8irHwkw3z2xwBWTRofMEl76Ktz+xuBCFUAyhiaKZaA== From: Raghav Gururajan To: 49238@debbugs.gnu.org Subject: [PATCH v5 1/2] gnu: Add python-ueberzug. Date: Mon, 5 Jul 2021 11:10:01 -0400 Message-Id: <20210705151002.24052-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/python-xyz.scm (python-ueberzug): New variable. Co-authored-by: jgart --- gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [188.165.223.204 listed in wl.mailspike.net] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 49238 Cc: Raghav Gururajan , maximedevos@telenet.be, jgart X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) * gnu/packages/python-xyz.scm (python-ueberzug): New variable. Co-authored-by: jgart --- gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index b74b3b808f..aa2406287d 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -101,6 +101,7 @@ ;;; Copyright © 2021 LibreMiami ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Raghav Gururajan +;;; Copyright © 2021 jgart ;;; Copyright © 2021 Danial Behzadi ;;; ;;; This file is part of GNU Guix. @@ -221,6 +222,41 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26)) +(define-public python-ueberzug + (package + (name "python-ueberzug") + (version "18.1.9") + (source + (origin + (method url-fetch) + (uri (pypi-uri "ueberzug" version)) + (sha256 + (base32 + "1hxd45dnwa9yv908acarr98n2drmar66wzq9z2qd3irj24srzr3w")))) + (build-system python-build-system) + (inputs + `(("libx11" ,libx11) + ("libxext" ,libxext))) + (propagated-inputs + `(("python-attrs" ,python-attrs) + ("python-docopt" ,python-docopt) + ("python-pillow" ,python-pillow) + ("python-xlib" ,python-xlib))) + (home-page "https://github.com/seebye/ueberzug") + (synopsis "Command line util to display images in combination with X11") + (description "Überzug is a command line util which allows to draw images on +terminals by using child windows. The advantages of using Überzug are: +@itemize +@item No race conditions as a new window is created to display images. +@item Expose events will be processed, so images will be redrawn on switch +workspaces. +@item Tmux support (excluding multi pane windows). +@item Terminals without the WINDOWID environment variable are supported. +@item Chars are used as position - and size unit. +@item No memory leak (/ unlimited cache). +@end itemize") + (license license:gpl3+))) + (define-public python-fire (package (name "python-fire") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:10:22 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 15:10:22 +0000 Received: from localhost ([127.0.0.1]:46425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QEh-0003d9-MA for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:10:22 -0400 Received: from out2.migadu.com ([188.165.223.204]:17217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QEd-0003ci-92 for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 11:10:14 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1625497810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9rJcgpl8Ks4RkkgYPazpWqdR6XfO5nS1kqGgJFwklhk=; b=H64NxmE/KoKaX2VlxRBL4cm5DCCUU5XaVEijj22T1vwhQmq9OYCcm1K6Cfx7vv0jx3I3im 7Ff4Y7m8E6Xqv5V+JGG69E7lgER88e3VMWCGKKKSBBRzMMb2r7WhsnUQGJp/JrNQoM4NTq dvilJAEXO4taAyXk0SmvydJjzNEg1x68AJmhBR44tYrJCT+ldj9N6POnUpfFvg6PvOFxGz WR4PGoiI4eibIBO22jeVnc6N08I3xQYx0E/f83K1KTge5HsGZXNKXMoIjh5TqnlOGYPb9E LalnpOrmZiLQz1PT6e72aKrxvuKKt/mjQrZRzg1tdBJcDQvJ688397o3D03GAA== From: Raghav Gururajan To: 49238@debbugs.gnu.org Subject: [PATCH v5 2/2] gnu: Add ytfzf. Date: Mon, 5 Jul 2021 11:10:02 -0400 Message-Id: <20210705151002.24052-2-rg@raghavgururajan.name> In-Reply-To: <20210705151002.24052-1-rg@raghavgururajan.name> References: <20210705151002.24052-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 173 ++++++ gnu/packages/patches/ytfzf-programs.patch | 650 ++++++++++++++++++++++ gnu/packages/patches/ [...] Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [188.165.223.204 listed in wl.mailspike.net] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.0 LOTS_OF_MONEY Huge... sums of money 1.8 MONEY_NOHTML Lots of money in plain text 0.0 T_MONEY_PERCENT X% of a lot of money for you X-Debbugs-Envelope-To: 49238 Cc: Raghav Gururajan , maximedevos@telenet.be, jgart X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 173 ++++++ gnu/packages/patches/ytfzf-programs.patch | 650 ++++++++++++++++++++++ gnu/packages/patches/ [...] Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 LOTS_OF_MONEY Huge... sums of money 1.8 MONEY_NOHTML Lots of money in plain text -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 T_MONEY_PERCENT X% of a lot of money for you * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 173 ++++++ gnu/packages/patches/ytfzf-programs.patch | 650 ++++++++++++++++++++++ gnu/packages/patches/ytfzf-updates.patch | 44 ++ 4 files changed, 869 insertions(+) create mode 100644 gnu/packages/patches/ytfzf-programs.patch create mode 100644 gnu/packages/patches/ytfzf-updates.patch diff --git a/gnu/local.mk b/gnu/local.mk index beaf99bf71..66687b420c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1858,6 +1858,8 @@ dist_patch_DATA = \ %D%/packages/patches/xsane-support-ipv6.patch \ %D%/packages/patches/xsane-tighten-default-umask.patch \ %D%/packages/patches/yggdrasil-extra-config.patch \ + %D%/packages/patches/ytfzf-programs.patch \ + %D%/packages/patches/ytfzf-updates.patch \ %D%/packages/patches/ytnef-CVE-2021-3403.patch \ %D%/packages/patches/ytnef-CVE-2021-3404.patch \ %D%/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch \ diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm index f01b6a614a..9850aabad6 100644 --- a/gnu/packages/image-viewers.scm +++ b/gnu/packages/image-viewers.scm @@ -18,6 +18,8 @@ ;;; Copyright © 2021 Rovanion Luckey ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Stefan Reichör +;;; Copyright © 2021 Raghav Gururajan +;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. ;;; @@ -46,6 +48,7 @@ #:use-module (guix build-system python) #:use-module (gnu packages autotools) #:use-module (gnu packages algebra) + #:use-module (gnu packages base) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -53,6 +56,7 @@ #:use-module (gnu packages documentation) #:use-module (gnu packages fontutils) #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) #:use-module (gnu packages ghostscript) #:use-module (gnu packages gl) @@ -63,7 +67,9 @@ #:use-module (gnu packages image) #:use-module (gnu packages image-processing) #:use-module (gnu packages imagemagick) + #:use-module (gnu packages linux) #:use-module (gnu packages maths) + #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages photo) @@ -71,10 +77,177 @@ #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) + #:use-module (gnu packages suckless) + #:use-module (gnu packages terminals) + #:use-module (gnu packages video) + #:use-module (gnu packages web) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) #:use-module (gnu packages)) +(define-public ytfzf + (package + (name "ytfzf") + (version "1.2.0") + (home-page "https://github.com/pystardust/ytfzf") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url home-page) + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "00d416qb4109pm77ikhnmds8qng90ni2jan9kdnxz7b6sh5f61nz")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no test suite + #:modules + ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'apply-patches + (lambda* (#:key inputs #:allow-other-keys) + ;; Pre-requisite for 'patch-script' phase. + (invoke "patch" "--input" + (assoc-ref inputs "ytfzf-programs")) + ;; Disables self-update. + (invoke "patch" "--input" + (assoc-ref inputs "ytfzf-updates")))) + (add-after 'apply-patches 'patch-script + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (catimg (assoc-ref inputs "catimg")) + (chafa (assoc-ref inputs "chafa")) + (coreutils (assoc-ref inputs "coreutils")) + (curl (assoc-ref inputs "curl")) + (dmenu (assoc-ref inputs "dmenu")) + (fzf (assoc-ref inputs "fzf")) + (gawk (assoc-ref inputs "gawk")) + (grep (assoc-ref inputs "grep")) + (jp2a (assoc-ref inputs "jp2a")) + (jq (assoc-ref inputs "jq")) + (libnotify (assoc-ref inputs "libnotify")) + (mpv (assoc-ref inputs "mpv")) + (ncurses (assoc-ref inputs "ncurses")) + (python-ueberzug (assoc-ref inputs "python-ueberzug")) + (sed (assoc-ref inputs "sed")) + (util-linux (assoc-ref inputs "util-linux")) + (youtube-dl (assoc-ref inputs "youtube-dl"))) + ;; Use correct $PREFIX path. + (substitute* "Makefile" + (("/usr/bin") + (string-append out "/bin"))) + ;; Use absolute path for referenced programs. + (substitute* "ytfzf" + (("@awk@") + (string-append gawk "/bin/awk")) + (("@cat@") + (string-append coreutils "/bin/cat")) + (("@catimg@") + (string-append catimg "/bin/catimg")) + (("@chafa@") + (string-append chafa "/bin/chafa")) + (("@chmod@") + (string-append coreutils "/bin/chmod")) + (("@column@") + (string-append util-linux "/bin/column")) + (("@cp@") + (string-append coreutils "/bin/cp")) + (("@cut@") + (string-append coreutils "/bin/cut")) + (("@curl@") + (string-append curl "/bin/curl")) + (("@date@") + (string-append coreutils "/bin/date")) + (("@dmenu@") + (string-append dmenu "/bin/dmenu")) + (("@fzf@") + (string-append fzf "/bin/fzf")) + (("@grep@") + (string-append grep "/bin/grep")) + (("@head@") + (string-append coreutils "/bin/head")) + (("@jp2a@") + (string-append jp2a "/bin/jp2a")) + (("@jq@") + (string-append jq "/bin/jq")) + (("@mkdir@") + (string-append coreutils "/bin/mkdir")) + (("@mkfifo@") + (string-append coreutils "/bin/mkfifo")) + (("@mpv@") + (string-append mpv "/bin/mpv")) + (("@nohup@") + (string-append coreutils "/bin/nohup")) + (("@notify-send@") + (string-append libnotify "/bin/notify-send")) + (("@rm@") + (string-append coreutils "/bin/rm")) + (("@sed@") + (string-append sed "/bin/sed")) + (("@seq@") + (string-append coreutils "/bin/seq")) + (("@setsid@") + (string-append util-linux "/bin/setsid")) + (("@sleep@") + (string-append coreutils "/bin/sleep")) + (("@sort@") + (string-append coreutils "/bin/sort")) + (("@tput@") + (string-append ncurses "/bin/tput")) + (("@tr@") + (string-append coreutils "/bin/tr")) + (("@ueberzug@") + (string-append python-ueberzug "/bin/ueberzug")) + (("@uname@") + (string-append coreutils "/bin/uname")) + (("@uniq@") + (string-append coreutils "/bin/uniq")) + (("@wc@") + (string-append coreutils "/bin/wc")) + (("@youtube-dl@") + (string-append youtube-dl "/bin/youtube-dl")))) + (substitute* "ytfzf" + ;; Generate temporary files in the user-specific path, + ;; to avoid issues in multi-user systems. + (("/tmp/ytfzf") + "$HOME/.cache/ytfzf") + ;; Report errors to Guix. + (("report at: https://github.com/pystardust/ytfzf") + "report at: https://issues.guix.gnu.org")))) + (delete 'configure)))) ;no configure script + (native-inputs + `(("ytfzf-programs" + ,(search-patch "ytfzf-programs.patch")) + ("ytfzf-updates" + ,(search-patch "ytfzf-updates.patch")))) + (inputs + `(("catimg" ,catimg) + ("chafa" ,chafa) + ("coreutils" ,coreutils) + ("curl" ,curl) + ("dmenu" ,dmenu) + ("fzf" ,fzf) + ("gawk" ,gawk) + ("grep" ,grep) + ("jp2a" ,jp2a) + ("jq" ,jq) + ("libnotify" ,libnotify) + ("mpv" ,mpv) + ("ncurses" ,ncurses) + ("python-ueberzug" ,python-ueberzug) + ("sed" ,sed) + ("util-linux" ,util-linux) + ("youtube-dl" ,youtube-dl))) + (synopsis "Watch PeerTube or YouTube videos from the terminal") + (description "@code{ytfzf} is a POSIX script that helps you find PeerTube or +YouTube videos without requiring API and opens/downloads them using mpv/ytdl.") + (license license:gpl3+))) + (define-public feh (package (name "feh") diff --git a/gnu/packages/patches/ytfzf-programs.patch b/gnu/packages/patches/ytfzf-programs.patch new file mode 100644 index 0000000000..fc7684d3ef --- /dev/null +++ b/gnu/packages/patches/ytfzf-programs.patch @@ -0,0 +1,650 @@ +From 291a0cd6e24026da0cfd2007e48c00f0824bd0d2 Mon Sep 17 00:00:00 2001 +From: Raghav Gururajan +Date: Mon, 5 Jul 2021 06:45:49 -0400 +Subject: [PATCH 1/2] Modify the strings of referenced programs. + +Pattern the strings of referenced programs, so that they can be easily +substituted with absolute paths using a custom-phase. + +Co-authored-by: jgart +--- + ytfzf | 202 +++++++++++++++++++++++++++++----------------------------- + 1 file changed, 101 insertions(+), 101 deletions(-) + +diff --git a/ytfzf b/ytfzf +index f4d2e0d..0a2c372 100755 +--- a/ytfzf ++++ b/ytfzf +@@ -49,19 +49,19 @@ cache_dir=${YTFZF_CACHE-${cache_dir-$HOME/.cache/ytfzf}} + #video type preference (mp4/1080p, mp4/720p, etc..) + video_pref=${YTFZF_PREF-${video_pref-}} + #the menu to use instead of fzf when -D is specified +-external_menu=${YTFZF_EXTMENU-${external_menu-dmenu -i -l 30 -p Search:}} ++external_menu=${YTFZF_EXTMENU-${external_menu-@dmenu@ -i -l 30 -p Search:}} + #number of columns (characters on a line) the external menu can have + #necessary for formatting text for external menus + external_menu_len=${YTFZF_EXTMENU_LEN-${external_menu_len-220}} + #player settings (players need to support streaming with youtube-dl) + #player to use for watching the video +-video_player=${YTFZF_PLAYER-${video_player-mpv}} ++video_player=${YTFZF_PLAYER-${video_player-@mpv@}} + #if YTFZF_PREF is specified, use this player instead +-video_player_format=${YTFZF_PLAYER_FORMAT-${video_player_format-mpv --ytdl-format=}} ++video_player_format=${YTFZF_PLAYER_FORMAT-${video_player_format-@mpv@ --ytdl-format=}} + #player to use for audio only +-audio_player=${YTFZF_AUDIO_PLAYER-${audio_player-mpv --no-video}} ++audio_player=${YTFZF_AUDIO_PLAYER-${audio_player-@mpv@ --no-video}} + #the command to use for displaying thumbnails +-thumb_disp_method=${YTFZF_THUMB_DISP_METHOD-${thumb_disp_method-ueberzug}} ++thumb_disp_method=${YTFZF_THUMB_DISP_METHOD-${thumb_disp_method-@ueberzug@}} + #Storing the argument and location for autogenerated subtitles + [ -z "$YTFZF_SUBT_NAME" ] && YTFZF_SUBT_NAME="" + #Stores the language for the auto genereated subtitles +@@ -85,8 +85,8 @@ subscriptions_file=${subscriptions_file-$config_dir/subscriptions} + #> stores the pid of running ytfzf sessions + pid_file="$cache_dir/.pid" + #> make folders that don't exist +-[ -d "$cache_dir" ] || mkdir -p "$cache_dir" +-[ -d "$thumb_dir" ] || mkdir -p "$thumb_dir" ++[ -d "$cache_dir" ] || @mkdir@ -p "$cache_dir" ++[ -d "$thumb_dir" ] || @mkdir@ -p "$thumb_dir" + + #> config settings + #list of shortcuts to use in fzf +@@ -177,12 +177,12 @@ dep_ck () { + done + unset Dep + } +-dep_ck "jq" "youtube-dl" "curl" ++dep_ck "@jq@" "@youtube-dl@" "@curl@" + + + #only check for mpv if $YTFZF_PLAYER is set to it + #don't check $YTFZF_PLAYER as it could be multiple commands +-[ "$video_player" = "mpv" ] && dep_ck "mpv" ++[ "$video_player" = "@mpv@" ] && dep_ck "@mpv@" + + ############################ + # Help Texts # +@@ -326,8 +326,8 @@ print_info () { + } + + print_error () { +- [ $ext_menu_notifs -eq 1 ] && notify-send "error" "$*" || printf "\033[31m$*\033[0m" >&2 +- [ $ext_menu_notifs -eq 1 ] && notify-send "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" || printf "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" >&2 ++ [ $ext_menu_notifs -eq 1 ] && @notify-send@ "error" "$*" || printf "\033[31m$*\033[0m" >&2 ++ [ $ext_menu_notifs -eq 1 ] && @notify-send@ "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" || printf "Check for new versions and report at: https://github.com/pystardust/ytfzf\n" >&2 + } + + ############################ +@@ -398,12 +398,12 @@ format_fzf () { + format_menu () { + if [ "$is_ext_menu" -eq 0 ]; then + #dep_ck fzf here because it is only necessary to use here +- dep_ck "fzf" +- menu_command='column -t -s "$tab_space" | fzf -m --bind change:top --tabstop=1 --layout=reverse --delimiter="$tab_space" --nth=1,2 --expect="$shortcuts" $FZF_DEFAULT_OPTS' ++ dep_ck "@fzf@" ++ menu_command='@column@ -t -s "$tab_space" | @fzf@ -m --bind change:top --tabstop=1 --layout=reverse --delimiter="$tab_space" --nth=1,2 --expect="$shortcuts" $FZF_DEFAULT_OPTS' + format_fzf + else + # Dmenu doesn't render tabs so removing it +- menu_command='tr -d "$tab_space" | '"$external_menu" ++ menu_command='@tr@ -d "$tab_space" | '"$external_menu" + format_ext_menu + fi + } +@@ -461,13 +461,13 @@ ID="ytfzf-ueberzug" + WIDTH=$FZF_PREVIEW_COLUMNS + HEIGHT=$FZF_PREVIEW_LINES + start_ueberzug () { +- [ -e $FIFO ] || { mkfifo "$FIFO" || exit 1 ; } +- ueberzug layer --parser json --silent < "$FIFO" & ++ [ -e $FIFO ] || { @mkfifo@ "$FIFO" || exit 1 ; } ++ @ueberzug@ layer --parser json --silent < "$FIFO" & + exec 3>"$FIFO" + } + stop_ueberzug () { + exec 3>&- +- rm "$FIFO" > /dev/null 2>&1 ++ @rm@ "$FIFO" > /dev/null 2>&1 + } + + preview_img () { +@@ -476,12 +476,12 @@ preview_img () { + shorturl=${args##*${tab_space}|} + shorturl="${shorturl%% *}" + +- json_obj=$(printf "%s" "$videos_json" | jq '.[]|select( .videoID == "'"$shorturl"'")') ++ json_obj=$(printf "%s" "$videos_json" | @jq@ '.[]|select( .videoID == "'"$shorturl"'")') + + + IFS=$tab_space read -r title channel duration views date description <<-EOF + $( +- printf "%s" "$json_obj" | jq -r \ ++ printf "%s" "$json_obj" | @jq@ -r \ + ' + [.title,.channel,.duration,.views,.date,.description]|@tsv + ' +@@ -530,31 +530,31 @@ preview_img () { + } > "$FIFO" ;; + catimg) + printf "\n" +- catimg -w "$((thumb_width * 2))" "$IMAGE" ;; ++ @catimg@ -w "$((thumb_width * 2))" "$IMAGE" ;; + jp2a) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=24 "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=24 "$IMAGE" ;; + jp2a-8) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=8 "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=8 "$IMAGE" ;; + jp2a-4) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=4 "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" --colors --color-depth=4 "$IMAGE" ;; + jp2a-gray|jp2a-grey) + printf "\n" +- jp2a --size="${thumb_width}x$((thumb_height / 2))" "$IMAGE" ;; ++ @jp2a@ --size="${thumb_width}x$((thumb_height / 2))" "$IMAGE" ;; + chafa) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" "$IMAGE" ;; + chafa-gray|chafa-grey) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=2 "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" --colors=2 "$IMAGE" ;; + chafa-4) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=16 "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" --colors=16 "$IMAGE" ;; + chafa-8) + printf "\n" +- chafa --size="${thumb_width}x${thumb_height}" --colors=256 "$IMAGE" ;; ++ @chafa@ --size="${thumb_width}x${thumb_height}" --colors=256 "$IMAGE" ;; + custom) + if ! function_exists "handle_display_img"; then + printf "\033[031mERROR[#07]: \033[0m\033[1mhandle_display_img\033[0m is not defined" >&2 +@@ -585,20 +585,20 @@ download_thumbnails () { + if [ "$thumbnail_quality" -eq 1 ]; then + image_download () { + # higher quality images +- curl -s "$Url" -G --data-urlencode "sqp=" > "$thumb_dir/$Name.png" ++ @curl@ -s "$Url" -G --data-urlencode "sqp=" > "$thumb_dir/$Name.png" + } + else + image_download () { +- curl -s "$Url" > "$thumb_dir/$Name.png" ++ @curl@ -s "$Url" > "$thumb_dir/$Name.png" + } + fi + + print_info "Downloading Thumbnails...\n" + thumb_urls=$(printf "%s" "$*" |\ +- jq -r '.[]|[.thumbs,.videoID]|@tsv' ) ++ @jq@ -r '.[]|[.thumbs,.videoID]|@tsv' ) + + while IFS=$tab_space read -r Url Name; do +- sleep 0.001 ++ @sleep@ 0.001 + { + image_download + } & +@@ -628,7 +628,7 @@ get_sp_filter () { + #another example is sort by filter + upload date filter only changes one character as well + if [ -n "$filter_id" ]; then + #gets the character in the filter_id that needs to be replaced if upload_date_filter is also given +- upload_date_character=$(printf "%s" "$filter_id" | awk '{print substr($1, 8, 1)}') ++ upload_date_character=$(printf "%s" "$filter_id" | @awk@ '{print substr($1, 8, 1)}') + fi + + #For each of these, if upload_date_character is unset, the filter_id should be the normal filter +@@ -650,7 +650,7 @@ get_sp_filter () { + if [ -n "$upload_date_character" ]; then + #replaces the 8th character in the filter_id with the appropriate character + #the 8th character specifies the upload_date_filter +- sp=$(printf "%s" "$filter_id" | sed 's/\(.\{7\}\)./\1'"$upload_date_character"'/') ++ sp=$(printf "%s" "$filter_id" | @sed@ 's/\(.\{7\}\)./\1'"$upload_date_character"'/') + #otherwise set it to the filter_id + else + sp=$filter_id +@@ -660,15 +660,15 @@ get_sp_filter () { + + get_yt_json () { + # scrapes the json embedded in the youtube html page +- printf "%s" "$*" | sed -n '/var *ytInitialData/,$p' | tr -d '\n' |\ +- sed -E ' s_^.*var ytInitialData ?=__ ; s_;.*__ ;' ++ printf "%s" "$*" | @sed@ -n '/var *ytInitialData/,$p' | @tr@ -d '\n' |\ ++ @sed@ -E ' s_^.*var ytInitialData ?=__ ; s_;.*__ ;' + } + + get_yt_html () { + link=$1 + query=$2 + printf "%s" "$( +- curl "$link" -s \ ++ @curl@ "$link" -s \ + -G --data-urlencode "search_query=$query" \ + -G --data-urlencode "sp=$sp" \ + -H 'Authority: www.youtube.com' \ +@@ -684,7 +684,7 @@ get_video_data () { + # outputs tab and pipe separated fields: title, channel, view count, video length, video upload date, and the video id/url + # from the videos_json + printf "%s" "$*" |\ +- jq -r '.[]| "\(.title)'"$tab_space"'|\(.channel)'"$tab_space"'|\(.views)'"$tab_space"'|\(.duration)'"$tab_space"'|\(.date)'"$tab_space"'|\(.videoID)"' ++ @jq@ -r '.[]| "\(.title)'"$tab_space"'|\(.channel)'"$tab_space"'|\(.views)'"$tab_space"'|\(.duration)'"$tab_space"'|\(.date)'"$tab_space"'|\(.videoID)"' + } + + scrape_channel () { +@@ -694,7 +694,7 @@ scrape_channel () { + channel_url=$* + + # Converting channel title page url to channel video url +- if ! printf "%s" "$channel_url" | grep -q '/videos *$'; then ++ if ! printf "%s" "$channel_url" | @grep@ -q '/videos *$'; then + channel_url=${channel_url%/featured}/videos + fi + +@@ -706,8 +706,8 @@ scrape_channel () { + fi + + #gets the channel name from title of page +- channel_name=$(printf "%s" "$yt_html" | grep -o '.*' | +- sed \ ++ channel_name=$(printf "%s" "$yt_html" | @grep@ -o '.*' | ++ @sed@ \ + -e 's/ - YouTube//' \ + -e 's/<\/\?title>//g' \ + -e "s/'/'/g" \ +@@ -723,7 +723,7 @@ scrape_channel () { + + #gets a list of videos + videos_json=$(printf "%s" "$yt_json" |\ +- jq '[ .contents | ..|.gridVideoRenderer? | ++ @jq@ '[ .contents | ..|.gridVideoRenderer? | + select(. !=null) | + { + title: .title.runs[0].text, +@@ -736,7 +736,7 @@ scrape_channel () { + } + ]') + +- videos_json=$(printf "%s" "$videos_json" | jq '.[0:'$sub_link_count']') ++ videos_json=$(printf "%s" "$videos_json" | @jq@ '.[0:'$sub_link_count']') + printf "%s\n" "$videos_json" >> "$tmp_video_json_file" + #checks if it's empty in case it was defined in a config function eg: on_get_search + [ -z "$videos_data" ] && videos_data=$(get_video_data "$videos_json") +@@ -768,11 +768,11 @@ get_trending_url_data () { + scrape_pt () { + #gets a list of videos + pt_json=$( +- curl \ ++ @curl@ \ + -s "https://sepiasearch.org/api/v1/search/videos" \ + -G --data-urlencode "search=$*") + videos_json=$(printf "%s" "$pt_json" |\ +- jq '[ .data | .[] | ++ @jq@ '[ .data | .[] | + { + title: .name, + channel: .channel.displayName, +@@ -829,7 +829,7 @@ scrape_yt () { + fi + + #gets a list of videos +- videos_json=$(printf "%s" "$yt_json" | jq '[ .contents| ++ videos_json=$(printf "%s" "$yt_json" | @jq@ '[ .contents| + ..|.videoRenderer? | + select(. !=null) | + { +@@ -844,7 +844,7 @@ scrape_yt () { + } + ]') + +- playlist_json=$(printf "%s" "$yt_json" | jq '[ .contents| ++ playlist_json=$(printf "%s" "$yt_json" | @jq@ '[ .contents| + ..|.playlistRenderer? | + select(. !=null) | + { +@@ -904,31 +904,31 @@ get_search_query () { + #> To select videos from videos_data + user_selection () { + #remove subscription separators +- videos_data_clean=$(printf "%s" "$videos_data" | sed "/.*$tab_space$/d") ++ videos_data_clean=$(printf "%s" "$videos_data" | @sed@ "/.*$tab_space$/d") + + #$selected_data is the video the user picked + #picks the first n videos + if [ "$select_all" -eq 1 ] ; then + selected_data=$videos_data_clean + elif [ "$auto_select" -eq 1 ] ; then +- selected_data=$(printf "%s\n" "$videos_data_clean" | sed "${link_count}"q ) ++ selected_data=$(printf "%s\n" "$videos_data_clean" | @sed@ "${link_count}"q ) + #picks n random videos + elif [ "$random_select" -eq 1 ] ; then +- selected_data=$(printf "%s\n" "$videos_data_clean" | posix_shuf | head -n${link_count}) ++ selected_data=$(printf "%s\n" "$videos_data_clean" | posix_shuf | @head@ -n${link_count}) + #posix_shuf, pick the first $link_count videos + + #show thumbnail menu + elif [ "$show_thumbnails" -eq 1 ] ; then +- dep_ck "ueberzug" "fzf" ++ dep_ck "@ueberzug@" "@fzf@" + export YTFZF_THUMB_DISP_METHOD="$thumb_disp_method" +- [ "$thumb_disp_method" = "ueberzug" ] && start_ueberzug ++ [ "$thumb_disp_method" = "@ueberzug@" ] && start_ueberzug + #thumbnails only work in fzf, use fzf +- menu_command="fzf -m --tabstop=1 --bind change:top --delimiter=\"$tab_space\" \ ++ menu_command="@fzf@ -m --tabstop=1 --bind change:top --delimiter=\"$tab_space\" \ + --nth=1,2 --expect='$shortcuts' $FZF_DEFAULT_OPTS \ + --layout=reverse --preview \"sh $0 -U {}\" \ + --preview-window \"$PREVIEW_SIDE:50%:noborder:wrap\"" + selected_data=$( title_len=200 video_menu "$videos_data" ) +- [ "$thumb_disp_method" = "ueberzug" ] && stop_ueberzug ++ [ "$thumb_disp_method" = "@ueberzug@" ] && stop_ueberzug + # Deletes thumbnails if no video is selected + [ -z "$selected_data" ] && clean_up + #show regular menu +@@ -951,10 +951,10 @@ handle_shortcuts () { + case $selected_key in + "$urls_shortcut") printf "%s\n" $selected_urls; return 1 ;; + "$title_shortcut") +- printf "%s\n" "$selected_data" | awk -F " " '{print $1}'; return 1 ;; ++ printf "%s\n" "$selected_data" | @awk@ -F " " '{print $1}'; return 1 ;; + "$open_browser_shortcut") + for url in $selected_urls; do +- nohup $BROWSER "$url" >/dev/null 2>&1 ++ @nohup@ $BROWSER "$url" >/dev/null 2>&1 + done + return 1 ;; + "$watch_shortcut") is_download=0; is_audio_only=0; return 0;; +@@ -988,10 +988,10 @@ format_user_selection () { + 11) selected_urls=$selected_urls$new_line'https://www.youtube.com/watch?v='$surl ;; + 34) selected_urls=$selected_urls$new_line'https://www.youtube.com/playlist?list='$surl ;; + 36) +- selected_urls=$selected_urls$new_line"$(printf "%s" "$videos_json" | jq '.[].url' | grep -F "$surl" | tr -d '"')" ;; ++ selected_urls=$selected_urls$new_line"$(printf "%s" "$videos_json" | @jq@ '.[].url' | @grep@ -F "$surl" | @tr@ -d '"')" ;; + *) continue ;; + esac +- refined_selected_data=$refined_selected_data$new_line$(printf '%s' "$videos_data" | grep "|$surl" ) ++ refined_selected_data=$refined_selected_data$new_line$(printf '%s' "$videos_data" | @grep@ "|$surl" ) + done<<-EOF + $selected_data + EOF +@@ -1014,9 +1014,9 @@ print_data () { + get_video_format () { + # select format if flag given + [ $show_format -eq 0 ] && return +- formats=$(youtube-dl -F "$(printf "$selected_urls")") +- line_number=$(printf "$formats" | grep -n '.*extension resolution.*' | cut -d: -f1) +- quality=$(printf "$formats \n1 2 xAudio" | awk -v lineno=$line_number 'FNR > lineno {print $3}' | sort -n | awk -F"x" '{print $2 "p"}' | uniq | sed -e "s/Audiop/Audio/" -e "/^p$/d" | eval "$menu_command" | sed "s/p//g") ++ formats=$(@youtube-dl@ -F "$(printf "$selected_urls")") ++ line_number=$(printf "$formats" | @grep@ -n '.*extension resolution.*' | @cut@ -d: -f1) ++ quality=$(printf "$formats \n1 2 xAudio" | @awk@ -v lineno=$line_number 'FNR > lineno {print $3}' | @sort@ -n | @awk@ -F"x" '{print $2 "p"}' | @uniq@ | @sed@ -e "s/Audiop/Audio/" -e "/^p$/d" | eval "$menu_command" | @sed@ "s/p//g") + [ -z "$quality" ] && exit; + [ $quality = "Audio" ] && video_pref= && video_player="$audio_player" || video_pref="bestvideo[height=?$quality][vcodec!=?vp9]+bestaudio/best" + +@@ -1026,9 +1026,9 @@ get_video_format () { + get_sub_lang () { + if [ $auto_caption -eq 1 ]; then + #Gets the auto generated subs and stores them in a file +- sub_list=$(youtube-dl --list-subs --write-auto-sub "$selected_urls" | sed '/Available subtitles/,$d' | awk '{print $1}' | sed '1d;2d;3d') ++ sub_list=$(@youtube-dl@ --list-subs --write-auto-sub "$selected_urls" | @sed@ '/Available subtitles/,$d' | @awk@ '{print $1}' | @sed@ '1d;2d;3d') + if [ -n "$sub_list" ]; then +- [ -n "$selected_sub" ] || selected_sub=$(printf "$sub_list" | eval "$menu_command") && youtube-dl --sub-lang $selected_sub --write-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NAME="--sub-file=/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated subs not available." ++ [ -n "$selected_sub" ] || selected_sub=$(printf "$sub_list" | eval "$menu_command") && @youtube-dl@ --sub-lang $selected_sub --write-auto-sub --skip-download "$selected_urls" -o /tmp/ytfzf && YTFZF_SUBT_NAME="--sub-file=/tmp/ytfzf.$selected_sub.vtt" || printf "Auto generated subs not available." + fi + unset sub_list + fi +@@ -1046,10 +1046,10 @@ open_player () { + if [ $detach_player -eq 1 ]; then + if [ -z "$video_pref" ] || [ $is_audio_only -eq 1 ]; then + printf "Opening Player: %s\n" "$video_player $*" +- setsid -f $video_player "$@" $YTFZF_SUBT_NAME >/dev/null 2>&1 ++ @setsid@ -f $video_player "$@" $YTFZF_SUBT_NAME >/dev/null 2>&1 + else + printf "Opening Player: %s\n" "$video_player_format$video_pref $*" +- setsid -f $video_player_format"$video_pref" "$@" $YTFZF_SUBT_NAME >/dev/null 2>&1 ++ @setsid@ -f $video_player_format"$video_pref" "$@" $YTFZF_SUBT_NAME >/dev/null 2>&1 + fi + return + fi +@@ -1064,9 +1064,9 @@ open_player () { + fi + elif [ $is_download -eq 1 ]; then + if [ -z "$video_pref" ]; then +- youtube-dl "$@" "$YTFZF_SUBT_NAME" ++ @youtube-dl@ "$@" "$YTFZF_SUBT_NAME" + else +- youtube-dl -f "$video_pref" "$@" $YTFZF_SUBT_NAME || video_pref= open_player "$@" ++ @youtube-dl@ -f "$video_pref" "$@" $YTFZF_SUBT_NAME || video_pref= open_player "$@" + fi + fi + } +@@ -1087,7 +1087,7 @@ play_url () { + fi + + #Delete the temp auto-gen subtitle file +- [ $auto_caption -eq 1 ] && rm -f "${YTFZF_SUBT_NAME#*=}" ++ [ $auto_caption -eq 1 ] && @rm@ -f "${YTFZF_SUBT_NAME#*=}" + + unset player_urls + } +@@ -1102,7 +1102,7 @@ session_is_running () { + #> removes tmp files and clutter + clean_up () { + if ! session_is_running ; then +- [ -d "$thumb_dir" ] && rm -r "$thumb_dir" ++ [ -d "$thumb_dir" ] && @rm@ -r "$thumb_dir" + : > "$pid_file" + function_exists "on_exit" && on_exit + fi +@@ -1124,9 +1124,9 @@ save_before_exit () { + check_if_url () { + # to check if given input is a url + url_regex='^https\?://.*' +- if printf "%s" "$1" | grep -q "$url_regex"; then ++ if printf "%s" "$1" | @grep@ -q "$url_regex"; then + is_url=1 +- selected_urls=$(printf "%s" "$1" | tr ' ' '\n') ++ selected_urls=$(printf "%s" "$1" | @tr@ ' ' '\n') + scrape="url" + else + is_url=0 +@@ -1139,10 +1139,10 @@ get_history () { + if [ "$enable_hist" -eq 1 ]; then + [ -e "$history_file" ] || : > "$history_file" + #gets history data in reverse order (makes it most recent to least recent) +- hist_data=$( sed '1!G; h; $!d' "$history_file" ) ++ hist_data=$( @sed@ '1!G; h; $!d' "$history_file" ) + [ -z "$hist_data" ] && printf "History is empty!\n" >&2 && return 1; + #removes duplicate values from $history_data +- videos_data=$(printf "%s" "$hist_data" | uniq ) ++ videos_data=$(printf "%s" "$hist_data" | @uniq@ ) + [ "$sort_videos_data" -eq 1 ] && videos_data="$(printf "%s" "$videos_data" | sort_video_data_fn)" + else + printf "History is not enabled. Please enable it to use this option (-H).\n" >&2; +@@ -1177,10 +1177,10 @@ get_search_history () { + if [ "$enable_search_hist" -eq 1 ]; then + [ -e "$search_history_file" ] || : > "$search_history_file" + #gets history data in reverse order (makes it most recent to least recent) +- hist_data=$( sed '1!G; h; $!d' "$search_history_file" ) ++ hist_data=$( @sed@ '1!G; h; $!d' "$search_history_file" ) + [ -z "$hist_data" ] && printf "Search history is empty!\n" >&2 && return 1; + #removes duplicate values from $history_data +- search_history=$(printf "%s" "$hist_data" | uniq ) ++ search_history=$(printf "%s" "$hist_data" | @uniq@ ) + else + printf "Search history is not enabled. Please enable it to use this option (-q).\n" >&2; + exit 1; +@@ -1190,7 +1190,7 @@ get_search_history () { + + set_search_history () { + [ -z "$search_query" ] && return +- [ $enable_search_hist -eq 1 ] && printf "%s\t%s\n" "$(date '+%Y-%m-%d %H:%M:%S')" "$search_query" >> "$search_history_file" ; ++ [ $enable_search_hist -eq 1 ] && printf "%s\t%s\n" "$(@date@ '+%Y-%m-%d %H:%M:%S')" "$search_query" >> "$search_history_file" ; + } + + search_history_menu () { +@@ -1200,15 +1200,15 @@ search_history_menu () { + #when using an external menu, the search history will be done there + choice=$( printf "%s\n" "$search_history" | eval "$external_menu" ) + else +- choice="$( printf "%s\n" "$search_history" | fzf --prompt="$search_history_prompt" --print-query --no-multi -d '\t' --with-nth=2.. --expect='alt-enter' --bind='tab:replace-query' )" ++ choice="$( printf "%s\n" "$search_history" | @fzf@ --prompt="$search_history_prompt" --print-query --no-multi -d '\t' --with-nth=2.. --expect='alt-enter' --bind='tab:replace-query' )" + fi + + # first line is the fzf query (what the user types in fzf) + # second line is the fzf --expect key pressed + # third line is the search_history selection made +- query="$( printf "%s" "$choice" | sed -n '1p' )" +- key="$( printf "%s" "$choice" | sed -n '2p' )" +- selection="$( printf "%s" "$choice" | sed -n '3p' )" ++ query="$( printf "%s" "$choice" | @sed@ -n '1p' )" ++ key="$( printf "%s" "$choice" | @sed@ -n '2p' )" ++ selection="$( printf "%s" "$choice" | @sed@ -n '3p' )" + + # if no search history selection has been made + # and the user typed a query, use that instead +@@ -1225,7 +1225,7 @@ search_history_menu () { + search_query="$query" + return;; + esac +- search_query="$( printf "%s" "$selection" | awk -F'\t' '{printf "%s", $NF}' )" ++ search_query="$( printf "%s" "$selection" | @awk@ -F'\t' '{printf "%s", $NF}' )" + } + + ! function_exists "send_select_video_notif" && send_select_video_notif () { +@@ -1244,13 +1244,13 @@ search_history_menu () { + + #if downloading, say Downloading not currently playing + [ $is_download -eq 1 ] && title="Downloading" || title="Currently playing" +- notify-send "$title" "$message" -i "$video_thumb" ++ @notify-send@ "$title" "$message" -i "$video_thumb" + + unset message video_thumb title + } + + send_notify () { +- videos_selected_count=$(printf "%s\n" "$*" | wc -l) ++ videos_selected_count=$(printf "%s\n" "$*" | @wc@ -l) + while IFS=$tab_space read -r video_title video_channel video_views video_duration video_date video_shorturl; do + send_select_video_notif + done << EOF +@@ -1284,14 +1284,14 @@ if ! function_exists "data_sort_key"; then + sort_by="${5#|}" + sort_by="${sort_by#Streamed}" + #print the data that should be sorted by +- printf "%d" "$(date -d "${sort_by}" '+%s')" ++ printf "%d" "$(@date@ -d "${sort_by}" '+%s')" + unset sort_by + } + fi + #the function to use for sorting + if ! function_exists "data_sort_fn"; then + data_sort_fn () { +- sort -nr ++ @sort@ -nr + } + fi + sort_video_data_fn () { +@@ -1300,7 +1300,7 @@ sort_video_data_fn () { + IFS="$tab_space" + #run the key function to get the value to sort by + printf "%s\t%s\n" "$(data_sort_key $line)" "$line" +- done | data_sort_fn | cut -f2- ++ done | data_sort_fn | @cut@ -f2- + unset IFS line + } + +@@ -1314,19 +1314,19 @@ scrape_subscriptions () { + while IFS= read -r url; do + scrape_channel "$url" & + done <<-EOF +- $( sed \ ++ $( @sed@ \ + -e "s/#.*//" \ + -e "/^[[:space:]]*$/d" \ + -e "s/[[:space:]]*//g" \ + "$subscriptions_file") + EOF + wait +- videos_json="$(cat "$tmp_video_json_file")" ++ videos_json="$(@cat@ "$tmp_video_json_file")" + export videos_json + if [ $sort_videos_data -eq 1 ]; then + videos_data=$(sort_video_data_fn < "$tmp_video_data_file") + else +- videos_data=$(cat "$tmp_video_data_file") ++ videos_data=$(@cat@ "$tmp_video_data_file") + fi + } + +@@ -1346,11 +1346,11 @@ create_subs () { + : > "$config_dir/subscriptions" + + # check how many subscriptions there are in the file +- sublength=$( jq '. | length' < "$yt_sub_import_file" ) ++ sublength=$( @jq@ '. | length' < "$yt_sub_import_file" ) + +- for i in $(seq $((sublength - 1))); do +- channelInfo=$(jq --argjson index ${i} '[ "https://www.youtube.com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "#" + .[$index].snippet.title ]' < "$yt_sub_import_file") +- printf "%s\n" "$(printf "%s" "$channelInfo" | tr -d '[]"\n,')" >> "$subscriptions_file" ++ for i in $(@seq@ $((sublength - 1))); do ++ channelInfo=$(@jq@ --argjson index ${i} '[ "https://www.youtube.com/channel/" + .[$index].snippet.resourceId.channelId + "/videos", "#" + .[$index].snippet.title ]' < "$yt_sub_import_file") ++ printf "%s\n" "$(printf "%s" "$channelInfo" | @tr@ -d '[]"\n,')" >> "$subscriptions_file" + done + exit + } +@@ -1367,10 +1367,10 @@ verify_thumb_disp_method () { + + #sort -R is not posix + posix_shuf () { +- awk -F '\n' ' ++ @awk@ -F '\n' ' + BEGIN {srand()} #set the random seed at the start + {print rand() " " $0} #prepend a random number for each line' |\ +- sort | sed -E 's/[^ ]* //' ++ @sort@ | @sed@ -E 's/[^ ]* //' + #sort by the random numbers, remove the random number + } + +@@ -1486,8 +1486,8 @@ parse_opt () { + exit ;; + version) + printf "\033[1mytfzf:\033[0m %s\n" "$YTFZF_VERSION" +- printf "\033[1myoutube-dl:\033[0m %s\n" "$(youtube-dl --version)" +- command -v "fzf" 1>/dev/null && printf "\033[1mfzf:\033[0m %s\n" "$(fzf --version)" ++ printf "\033[1myoutube-dl:\033[0m %s\n" "$(@youtube-dl@ --version)" ++ command -v "@fzf@" 1>/dev/null && printf "\033[1mfzf:\033[0m %s\n" "$(@fzf@ --version)" + exit ;; + + subt) +@@ -1559,19 +1559,19 @@ done + shift $((OPTIND-1)) + + #only apply to ext_menu since they dont have a terminal to print to +-[ $is_ext_menu -eq 1 ] && command -v notify-send 1>/dev/null 2>&1 && ext_menu_notifs=1 || ext_menu_notifs=0 ++[ $is_ext_menu -eq 1 ] && command -v @notify-send@ 1>/dev/null 2>&1 && ext_menu_notifs=1 || ext_menu_notifs=0 + + #used for thumbnail previews in ueberzug + if [ $is_ext_menu -eq 0 ]; then +- export TTY_LINES=$(tput lines) +- export TTY_COLS=$(tput cols) ++ export TTY_LINES=$(@tput@ lines) ++ export TTY_COLS=$(@tput@ cols) + fi + + #if both are true, it defaults to using fzf, and if fzf isnt installed it will throw an error + #so print this error instead and set $show_thumbnails to 0 + if [ $is_ext_menu -eq 1 ] && [ $show_thumbnails -eq 1 ]; then + [ $ext_menu_notifs -eq 1 ] &&\ +- notify-send "warning" "Currently thumbnails do not work in external menus" ||\ ++ @notify-send@ "warning" "Currently thumbnails do not work in external menus" ||\ + printf "\033[33mWARNING: Currently thumbnails do not work in external menus\033[0m\n" >&2 + show_thumbnails=0 + fi +-- +2.32.0 + diff --git a/gnu/packages/patches/ytfzf-updates.patch b/gnu/packages/patches/ytfzf-updates.patch new file mode 100644 index 0000000000..1790b7a238 --- /dev/null +++ b/gnu/packages/patches/ytfzf-updates.patch @@ -0,0 +1,44 @@ +From 75bf4f584866a013d5618ea6be19e97a8196d63e Mon Sep 17 00:00:00 2001 +From: Raghav Gururajan +Date: Mon, 5 Jul 2021 06:47:38 -0400 +Subject: [PATCH 2/2] Disable updates within the application. + +Patch the code responsible for self-updating the application. + +Co-authored-by: jgart +--- + ytfzf | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) + +diff --git a/ytfzf b/ytfzf +index 0a2c372..845e8e9 100755 +--- a/ytfzf ++++ b/ytfzf +@@ -1260,22 +1260,8 @@ EOF + } + + update_ytfzf () { +- branch="$1" +- updatefile="/tmp/ytfzf-update" +- curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile" +- +- if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh'; then +- chmod 755 "$updatefile" +- [ "$(uname)" = "Darwin" ] && prefix="/usr/local/bin" || prefix="/usr/bin" +- function_exists "sudo" && doasroot="sudo" || doasroot="doas" +- $doasroot cp "$updatefile" "$prefix/ytfzf" +- unset prefix doasroot +- else +- printf "%bFailed to update ytfzf. Try again later.%b" "$c_red" "$c_reset" +- fi +- +- rm "$updatefile" +- exit 0 ++ printf "%bUpdates have to be installed with Guix.%b\n" "$c_red" "$c_reset" ++ exit 1 + } + + #gives a value to sort by (this will give the unix time the video was uploaded) +-- +2.32.0 + -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:42:24 2021 Received: (at 49238) by debbugs.gnu.org; 5 Jul 2021 15:42:24 +0000 Received: from localhost ([127.0.0.1]:46520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qjo-0006nB-MW for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:42:24 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:48030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qjm-0006n0-GI for 49238@debbugs.gnu.org; Mon, 05 Jul 2021 11:42:23 -0400 Received: from butterfly.local ([188.189.1.51]) by albert.telenet-ops.be with bizsmtp id RTiK2500g161ovQ06TiLJW; Mon, 05 Jul 2021 17:42:21 +0200 Message-ID: Subject: Re: [PATCH v5 2/2] gnu: Add ytfzf. From: Maxime Devos To: Raghav Gururajan , 49238@debbugs.gnu.org Date: Mon, 05 Jul 2021 17:42:15 +0200 In-Reply-To: <20210705151002.24052-2-rg@raghavgururajan.name> References: <20210705151002.24052-1-rg@raghavgururajan.name> <20210705151002.24052-2-rg@raghavgururajan.name> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-k3IU/iPsysaVurXxP/rR" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1625499741; bh=oWRh8v8DZVdqUVrz6G65OnG6QUpwcB5mhuLPHZsXmec=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=sNktoQLcYqjzu/OM/MTkConc8YUGHBXkkORFYcUwQkUga9iB0NGHC6SY5iqbe6hZ4 nmBGR3dzXiCzqEPF+k/hP5Bfo8BgTjdrWZxL4gYg3HlYDw7GYBdRxbAbiNCrWC+XgB wXzqIi563rCLhEsGiT0eHGEbUtXnnm8g02A0Da9S43dcWhFglGW9gK/wx6UVhOMy9k RWYLs06OSTJhx+Zr97lDqKpLOjSFvc0xu9l6XvJL9GWdI4MnJW2ewMe8bsS6I0y/pn bKEoIRYbjBAdSkXJ7yFS0ini8aIe/KSLcyTXeiBucTAjPUWf4jHooIHIfLFimthHN5 EvluKC45eANWw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49238 Cc: jgart X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-k3IU/iPsysaVurXxP/rR Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, This patch looks good to me, but I haven't actually tested it. Also, it may be a good idea to inform upstream on the /tmp/ytfzf issue, such that non-Guix users can benefit as well. Greetings, Maxime. --=-k3IU/iPsysaVurXxP/rR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYOMoVxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rhNAQDX5KuCT/X/efmsmHsXKM96RHWj HVBn3Ix3+1ryckV31QEAmgandnWAAOYUAmZZj2ga5NaKQfox8BXs0GXdxTJ4NAA= =Up48 -----END PGP SIGNATURE----- --=-k3IU/iPsysaVurXxP/rR-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 06 01:25:21 2021 Received: (at 49238) by debbugs.gnu.org; 6 Jul 2021 05:25:21 +0000 Received: from localhost ([127.0.0.1]:47075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0daD-0002G5-8X for submit@debbugs.gnu.org; Tue, 06 Jul 2021 01:25:21 -0400 Received: from out0.migadu.com ([94.23.1.103]:30077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0da9-0002Fv-Vw for 49238@debbugs.gnu.org; Tue, 06 Jul 2021 01:25:19 -0400 To: Maxime Devos DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1625549116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VSimf4hRXgfgI9ESa8fV/H+DRpJNfoiGs2I8bc4Fi4U=; b=MPBtWMxmDSkzMaQx1v61dcH4xVd1p4MOFkd992lqScJfHvKqjixwnTCg1wLO73gM0qBnpR NoSHXeUiX5AcVM5QtFLq1sC8EOU/WyQSZxMwLsPI3vG+sYJNytHV6b2uCMSGtlQGtSaqsf jEQNIxTXfkvCEzFp8NeRq9rSNMd4XpS1VC/mviQd960XVRSphnDKjmmWC3e+EHtNhwuMP5 1zp2LCvtvv3eUsh1OKs7smpoZIV+/C2/8RhWhGgKKnUoY0qmTItQmmK5ARCJa6AWigHzPA JG17B9+wwzE0EIqNrvqerhBomvzbcahgnXhuYTOe1EyeziYJlzoPB0d4YOQNQg== References: <20210705151002.24052-1-rg@raghavgururajan.name> <20210705151002.24052-2-rg@raghavgururajan.name> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Raghav Gururajan Subject: Re: [PATCH v5 2/2] gnu: Add ytfzf. Message-ID: <186b9289-a9cc-5ba7-4e66-d154baab57b2@raghavgururajan.name> Date: Tue, 6 Jul 2021 01:25:14 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sG1NpcJLR3xwcJVoCBwF2jrQYaEzUYxRG" X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49238 Cc: 49238@debbugs.gnu.org, jgart X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sG1NpcJLR3xwcJVoCBwF2jrQYaEzUYxRG Content-Type: multipart/mixed; boundary="SO3MzLOXHvMr0zwyRthMO1sWeC8x3mILl"; protected-headers="v1" From: Raghav Gururajan To: Maxime Devos Cc: jgart , 49238@debbugs.gnu.org Message-ID: <186b9289-a9cc-5ba7-4e66-d154baab57b2@raghavgururajan.name> Subject: Re: [PATCH v5 2/2] gnu: Add ytfzf. References: <20210705151002.24052-1-rg@raghavgururajan.name> <20210705151002.24052-2-rg@raghavgururajan.name> In-Reply-To: --SO3MzLOXHvMr0zwyRthMO1sWeC8x3mILl Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: quoted-printable Hi Maxime! > This patch looks good to me, but I haven't actually tested it. Cool! I'll test and push as v6. > Also, it may be a good idea to inform upstream on the /tmp/ytfzf > issue, such that non-Guix users can benefit as well. Sure thing. Regards, RG. --SO3MzLOXHvMr0zwyRthMO1sWeC8x3mILl-- --sG1NpcJLR3xwcJVoCBwF2jrQYaEzUYxRG Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTNLV6qqYzLN9qR1rBfWBZkf4vlUQUCYOPpOgUDAAAAAAAKCRBfWBZkf4vlUVNS AP9gT7E9MXEEmLKz/36aV7Nppkth4XWqZ2ggDKMglDiN8wEAjGmgtDDBArB/bNyr7w1BfL+tuYXe 0FDcjenxKFKXVgE= =rFif -----END PGP SIGNATURE----- --sG1NpcJLR3xwcJVoCBwF2jrQYaEzUYxRG-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 06 01:37:43 2021 Received: (at 49238-done) by debbugs.gnu.org; 6 Jul 2021 05:37:44 +0000 Received: from localhost ([127.0.0.1]:47092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0dmB-0002dn-Ox for submit@debbugs.gnu.org; Tue, 06 Jul 2021 01:37:43 -0400 Received: from out2.migadu.com ([188.165.223.204]:14360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0dmA-0002df-Fe for 49238-done@debbugs.gnu.org; Tue, 06 Jul 2021 01:37:43 -0400 To: 49238-done@debbugs.gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1625549861; h=from:from:reply-to:subject:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type; bh=oVp+/gpH7B5idY8eGWGYmiooZBNZfoOUmoRpbJ7O8Bg=; b=nUBaYHl+ewAQMDpeZQeVgNZYk4aHhB+VCyHagbVBIA8iApFuKXHhRMxBLeDIzwXjq8cEit 5qL0ncqYgCzHWT7bySeioplGObSCA5PDodNMCmn+RnqwMXCoFALc75aiZ3lA4C5c+XDlbF 07ldrSO8Jw5Z0H/y5GbzAhLmVysnhQjpouAUpYFCC9w06IOvKB/IJxKqmU/HuzONFhvpFW pJ1uptsd/0oniwRxAwBE0NPu8DlmOF1LlZk8MPuw38zq80mnl3oxoYghx3gp6yco/1cFin QujOX25/gubKPnwYVBW3A+p15NpfLVhUgH6T8pDvshEa2OXT8DY2xSSC2d6kWA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Raghav Gururajan Message-ID: <310a6600-a4bf-f1cf-486b-7c82c23399c1@raghavgururajan.name> Date: Tue, 6 Jul 2021 01:37:39 -0400 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="H92SGRCT8Sq8l6mpg2neGGg1UCSgfoAVi" X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Pushed as 586136d127..aa6e6fb2e9 to master. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [188.165.223.204 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: 49238-done Cc: jgart X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --H92SGRCT8Sq8l6mpg2neGGg1UCSgfoAVi Content-Type: multipart/mixed; boundary="InnGJisBN3QwtkpFHo81Lk1AwRajMS2W0"; protected-headers="v1" From: Raghav Gururajan To: 49238-done@debbugs.gnu.org Cc: jgart Message-ID: <310a6600-a4bf-f1cf-486b-7c82c23399c1@raghavgururajan.name> --InnGJisBN3QwtkpFHo81Lk1AwRajMS2W0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: quoted-printable Pushed as 586136d127..aa6e6fb2e9 to master. --InnGJisBN3QwtkpFHo81Lk1AwRajMS2W0-- --H92SGRCT8Sq8l6mpg2neGGg1UCSgfoAVi Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTNLV6qqYzLN9qR1rBfWBZkf4vlUQUCYOPsIwUDAAAAAAAKCRBfWBZkf4vlUelE APwP/9+xcS0SWfDIw7lN/y16SbMUZZs6jGt8gP0VRx+gKQEAqYc+1jv/LkwrzZ2x4Wnt3qZPIVBR m+2JoSI3fCgq+ws= =s5cr -----END PGP SIGNATURE----- --H92SGRCT8Sq8l6mpg2neGGg1UCSgfoAVi-- From unknown Wed Jun 18 23:16:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 03 Aug 2021 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator