From bf9dc7568272e28b79dd1ae3610c3ac83cc216a6 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Fri, 25 Jun 2021 19:01:26 +0200 Subject: gnu: connman: Update to 1.40. * gnu/packages/connman.scm (connman): Update to 1.40. [source]: Remove upstreamed patch. [inputs]: Add lz4, rather than propagate it from openconnect. * gnu/packages/patches/connman-CVE-2021-33833.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/packages/patches/connman-CVE-2021-33833.patch | 74 ----------------------- 1 file changed, 74 deletions(-) delete mode 100644 gnu/packages/patches/connman-CVE-2021-33833.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/connman-CVE-2021-33833.patch b/gnu/packages/patches/connman-CVE-2021-33833.patch deleted file mode 100644 index 3e1a19d961..0000000000 --- a/gnu/packages/patches/connman-CVE-2021-33833.patch +++ /dev/null @@ -1,74 +0,0 @@ -Fix CVE-2021-33833: - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-33833 - -Patch copied from upstream source repository: - -https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=eceb2e8d2341c041df55a5e2f047d9a8c491463c - -From eceb2e8d2341c041df55a5e2f047d9a8c491463c Mon Sep 17 00:00:00 2001 -From: Valery Kashcheev -Date: Mon, 7 Jun 2021 18:58:24 +0200 -Subject: [PATCH] dnsproxy: Check the length of buffers before memcpy - -Fix using a stack-based buffer overflow attack by checking the length of -the ptr and uptr buffers. - -Fix debug message output. - -Fixes: CVE-2021-33833 ---- - src/dnsproxy.c | 20 +++++++++++--------- - 1 file changed, 11 insertions(+), 9 deletions(-) - -diff --git a/src/dnsproxy.c b/src/dnsproxy.c -index de52df5a..38dbdd71 100644 ---- a/src/dnsproxy.c -+++ b/src/dnsproxy.c -@@ -1788,17 +1788,15 @@ static char *uncompress(int16_t field_count, char *start, char *end, - * tmp buffer. - */ - -- debug("pos %d ulen %d left %d name %s", pos, ulen, -- (int)(uncomp_len - (uptr - uncompressed)), uptr); -- -- ulen = strlen(name); -- if ((uptr + ulen + 1) > uncomp_end) { -+ ulen = strlen(name) + 1; -+ if ((uptr + ulen) > uncomp_end) - goto out; -- } -- strncpy(uptr, name, uncomp_len - (uptr - uncompressed)); -+ strncpy(uptr, name, ulen); -+ -+ debug("pos %d ulen %d left %d name %s", pos, ulen, -+ (int)(uncomp_end - (uptr + ulen)), uptr); - - uptr += ulen; -- *uptr++ = '\0'; - - ptr += pos; - -@@ -1841,7 +1839,7 @@ static char *uncompress(int16_t field_count, char *start, char *end, - } else if (dns_type == ns_t_a || dns_type == ns_t_aaaa) { - dlen = uptr[-2] << 8 | uptr[-1]; - -- if (ptr + dlen > end) { -+ if ((ptr + dlen) > end || (uptr + dlen) > uncomp_end) { - debug("data len %d too long", dlen); - goto out; - } -@@ -1880,6 +1878,10 @@ static char *uncompress(int16_t field_count, char *start, char *end, - * refresh interval, retry interval, expiration - * limit and minimum ttl). They are 20 bytes long. - */ -+ if ((uptr + 20) > uncomp_end || (ptr + 20) > end) { -+ debug("soa record too long"); -+ goto out; -+ } - memcpy(uptr, ptr, 20); - uptr += 20; - ptr += 20; --- -2.32.0 - -- cgit v1.2.3 From 35188a82570348c1c47dadf94bd273942a75c20a Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 28 Jun 2021 12:09:23 +0200 Subject: gnu: upower: Build from Git sources. * gnu/packages/gnome.scm (upower)[source]: Use GIT-FETCH and GIT-FILE-NAME. Adjust snippet. [native-inputs]: Add autoconf, automake, gtk-doc, libtool, and which. * gnu/packages/patches/upower-builddir.patch: Adjust to Makefile.am. --- gnu/packages/gnome.scm | 62 +++++++++++++++++------------- gnu/packages/patches/upower-builddir.patch | 24 +++++++++--- 2 files changed, 54 insertions(+), 32 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 03a12f5f15..2a493fc40b 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -5394,27 +5394,32 @@ faster results and to avoid unnecessary server load.") (package (name "upower") (version "0.99.11") - (source (origin - (method url-fetch) - (uri (string-append "https://upower.freedesktop.org/releases/" - "upower-" version ".tar.xz")) - (sha256 - (base32 - "1vxxvmz2cxb1qy6ibszaz5bskqdy9nd9fxspj9fv3gfmrjzzzdb4")) - (patches (search-patches "upower-builddir.patch")) - (modules '((guix build utils))) - (snippet - '(begin - ;; Upstream commit - ;; - ;; moved 'dbus-1/system.d' from etc/ to share/. However, - ;; 'dbus-configuration-directory' in (gnu services dbus) - ;; expects it in etc/. Thus, move it back to its previous - ;; location. - (substitute* "src/Makefile.in" - (("^dbusconfdir =.*$") - "dbusconfdir = $(sysconfdir)/dbus-1/system.d\n")) - #t)))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.freedesktop.org/upower/upower") + (commit (string-append "UPOWER_" + (string-map (match-lambda (#\. #\_) + (chr chr)) + version))))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0frs6ywvsz48d0zfviy40h6mj0icfc1q21hn7p99nchps39z85f8")) + (patches (search-patches "upower-builddir.patch")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Upstream commit + ;; + ;; moved 'dbus-1/system.d' from etc/ to share/. However, + ;; 'dbus-configuration-directory' in (gnu services dbus) + ;; expects it in etc/. Thus, move it back to its previous + ;; location. + (substitute* "src/Makefile.am" + (("^dbusconfdir =.*$") + "dbusconfdir = $(sysconfdir)/dbus-1/system.d\n")) + #t)))) (build-system glib-or-gtk-build-system) (arguments '(#:phases @@ -5430,10 +5435,15 @@ faster results and to avoid unnecessary server load.") (assoc-ref %outputs "out") "/lib/udev/rules.d")))) (native-inputs - `(("gobject-introspection" ,gobject-introspection) - ("pkg-config" ,pkg-config) + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("gobject-introspection" ,gobject-introspection) + ("gtk-doc" ,gtk-doc) ("intltool" ,intltool) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config) ("python" ,python) + ("which" ,which) ; for ./autogen.sh ;; For tests. ("python-dbus" ,python-dbus) @@ -5442,9 +5452,9 @@ faster results and to avoid unnecessary server load.") ("umockdev" ,umockdev) ;; For man pages. - ("libxslt" ,libxslt) ;for 'xsltproc' - ("libxml2" ,libxml2) ;for 'XML_CATALOG_FILES' - ("docbook-xsl" ,docbook-xsl))) + ("docbook-xsl" ,docbook-xsl) + ("libxslt" ,libxslt) ; for 'xsltproc' + ("libxml2" ,libxml2))) ; for 'XML_CATALOG_FILES' (inputs `(("dbus-glib" ,dbus-glib) ("libgudev" ,libgudev) diff --git a/gnu/packages/patches/upower-builddir.patch b/gnu/packages/patches/upower-builddir.patch index 51295f2076..a61d387faf 100644 --- a/gnu/packages/patches/upower-builddir.patch +++ b/gnu/packages/patches/upower-builddir.patch @@ -1,3 +1,8 @@ +From 27ae011b31d831752b97eb209bc2b2206fcf40f7 Mon Sep 17 00:00:00 2001 +From: Tobias Geerinckx-Rice +Date: Mon, 28 Jun 2021 11:58:47 +0200 +Subject: [PATCH] gnu: upower: Fix build directory. + Remove explicit set of UPOWER_CONF_FILE_NAME in up-self-test.c; instead the harness should set it. In Guix we set it explicitly; the right thing is to use AM_TEST_ENVIRONMENT and regenerate the @@ -6,13 +11,17 @@ some things, so we patch the Makefile.in instead. Also fix to not try to create /var/lib/upower if /var isn't writable. -Patch by Andy Wingo -Reduced to upower 0.99.10 by Tobias Geerinckx-Rice +Based on a patch by Andy Wingo +--- + src/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) ---- upower-0.99.2.orig/src/Makefile.in 2014-12-18 10:32:01.000000000 +0100 -+++ upower-0.99.2/src/Makefile.in 2015-04-04 19:49:28.020843678 +0200 -@@ -1789,7 +1790,7 @@ - @HAVE_SYSTEMDSYSTEMUNITDIR_TRUE@ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ +diff --git a/src/Makefile.am b/src/Makefile.am +index 3400139..f51ee89 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -181,7 +181,7 @@ $(systemdservice_DATA): $(systemdservice_in_files) Makefile + endif install-data-hook: - if test -w $(DESTDIR)$(prefix)/; then \ @@ -20,3 +29,6 @@ Reduced to upower 0.99.10 by Tobias Geerinckx-Rice mkdir -p $(DESTDIR)$(historydir); \ fi +-- +2.32.0 + -- cgit v1.2.3 From 076bbc440fdf2640c63242a0288b0a0a96734261 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 28 Jun 2021 19:02:37 +0200 Subject: gnu: Add oneko. * gnu/packages/toys.scm (oneko): New variable. Signed-off-by: Leo Prikler --- gnu/local.mk | 1 + .../patches/oneko-remove-nonfree-characters.patch | 307 +++++++++++++++++++++ gnu/packages/toys.scm | 63 ++++- 3 files changed, 370 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/oneko-remove-nonfree-characters.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index f507fe566f..7d1fc8157c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1499,6 +1499,7 @@ dist_patch_DATA = \ %D%/packages/patches/ocaml-dose3-dont-make-printconf.patch \ %D%/packages/patches/ocaml-dose3-Install-mli-cmx-etc.patch \ %D%/packages/patches/omake-fix-non-determinism.patch \ + %D%/packages/patches/oneko-remove-nonfree-characters.patch \ %D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch \ %D%/packages/patches/opencascade-oce-glibc-2.26.patch \ %D%/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch \ diff --git a/gnu/packages/patches/oneko-remove-nonfree-characters.patch b/gnu/packages/patches/oneko-remove-nonfree-characters.patch new file mode 100644 index 0000000000..4f80e53995 --- /dev/null +++ b/gnu/packages/patches/oneko-remove-nonfree-characters.patch @@ -0,0 +1,307 @@ +Remove options and code to use bitmaps of the BSD daemon and other characters +with copyright issues. The bitmaps themselves are deleted in a source snippet. +diff --git a/cursors/cursor.include b/cursors/cursor.include +index ef96d72..1dc3dc2 100644 +--- a/cursors/cursor.include ++++ b/cursors/cursor.include +@@ -2,9 +2,3 @@ + #include "mouse_cursor_mask.xbm" + #include "bone_cursor.xbm" + #include "bone_cursor_mask.xbm" +-#include "bsd_cursor.xbm" +-#include "bsd_cursor_mask.xbm" +-#include "card_cursor.xbm" +-#include "card_cursor_mask.xbm" +-#include "petal_cursor.xbm" +-#include "petal_cursor_mask.xbm" +diff --git a/oneko.c b/oneko.c +index d2b81fe..04fa59f 100644 +--- a/oneko.c ++++ b/oneko.c +@@ -33,7 +33,7 @@ XColor theBackgroundColor; /* $@?'(J ($@%P%C%/%0%i%&%s%I(J) */ + + int Synchronous = False; + /* Types of animals */ +-#define BITMAPTYPES 6 ++#define BITMAPTYPES 3 + typedef struct _AnimalDefaults { + char *name; + int speed, idle, bitmap_width, bitmap_height; +@@ -51,12 +51,6 @@ AnimalDefaultsData AnimalDefaultsDataTable[] = + mouse_cursor_width,mouse_cursor_height, mouse_cursor_x_hot,mouse_cursor_y_hot }, + { "dog" , 10, 6, 32, 32, 125000L, 0, 0, bone_cursor_bits,bone_cursor_mask_bits, + bone_cursor_width,bone_cursor_height, bone_cursor_x_hot,bone_cursor_y_hot }, +- { "bsd_daemon" , 16, 6, 32, 32, 300000L, 22, 20, bsd_cursor_bits,bsd_cursor_mask_bits, +- bsd_cursor_width,bsd_cursor_height, bsd_cursor_x_hot,bsd_cursor_y_hot }, +- { "sakura" , 13, 6, 32, 32, 125000L, 0, 0, card_cursor_bits,card_cursor_mask_bits, +- card_cursor_width,card_cursor_height, card_cursor_x_hot,card_cursor_y_hot }, +- { "tomoyo" , 10, 6, 32, 32, 125000L, 32, 32, petal_cursor_bits,petal_cursor_mask_bits, +- petal_cursor_width,petal_cursor_height, petal_cursor_x_hot,petal_cursor_y_hot }, + }; + + /* +@@ -154,70 +148,70 @@ typedef struct { + + BitmapGCData BitmapGCDataTable[] = + { +- { &Mati2GC, &Mati2Xbm, mati2_bits, mati2_tora_bits, mati2_dog_bits, mati2_bsd_bits, mati2_sakura_bits, mati2_tomoyo_bits, +- &Mati2Msk, mati2_mask_bits, mati2_mask_bits, mati2_dog_mask_bits, mati2_bsd_mask_bits, mati2_sakura_mask_bits, mati2_tomoyo_mask_bits }, +- { &Jare2GC, &Jare2Xbm, jare2_bits, jare2_tora_bits, jare2_dog_bits, jare2_bsd_bits, jare2_sakura_bits, jare2_tomoyo_bits, +- &Jare2Msk, jare2_mask_bits, jare2_mask_bits, jare2_dog_mask_bits, jare2_bsd_mask_bits, jare2_sakura_mask_bits, jare2_tomoyo_mask_bits }, +- { &Kaki1GC, &Kaki1Xbm, kaki1_bits, kaki1_tora_bits, kaki1_dog_bits, kaki1_bsd_bits, kaki1_sakura_bits, kaki1_tomoyo_bits, +- &Kaki1Msk, kaki1_mask_bits, kaki1_mask_bits, kaki1_dog_mask_bits, kaki1_bsd_mask_bits, kaki1_sakura_mask_bits, kaki1_tomoyo_mask_bits }, +- { &Kaki2GC, &Kaki2Xbm, kaki2_bits, kaki2_tora_bits, kaki2_dog_bits, kaki2_bsd_bits, kaki2_sakura_bits, kaki2_tomoyo_bits, +- &Kaki2Msk, kaki2_mask_bits, kaki2_mask_bits, kaki2_dog_mask_bits, kaki2_bsd_mask_bits, kaki2_sakura_mask_bits, kaki2_tomoyo_mask_bits }, +- { &Mati3GC, &Mati3Xbm, mati3_bits, mati3_tora_bits, mati3_dog_bits, mati3_bsd_bits, mati3_sakura_bits, mati3_tomoyo_bits, +- &Mati3Msk, mati3_mask_bits, mati3_mask_bits, mati3_dog_mask_bits, mati3_bsd_mask_bits, mati3_sakura_mask_bits, mati3_tomoyo_mask_bits }, +- { &Sleep1GC, &Sleep1Xbm, sleep1_bits, sleep1_tora_bits, sleep1_dog_bits, sleep1_bsd_bits, sleep1_sakura_bits, sleep1_tomoyo_bits, +- &Sleep1Msk, sleep1_mask_bits, sleep1_mask_bits, sleep1_dog_mask_bits, sleep1_bsd_mask_bits, sleep1_sakura_mask_bits, sleep1_tomoyo_mask_bits }, +- { &Sleep2GC, &Sleep2Xbm, sleep2_bits, sleep2_tora_bits, sleep2_dog_bits, sleep2_bsd_bits, sleep2_sakura_bits, sleep2_tomoyo_bits, +- &Sleep2Msk, sleep2_mask_bits, sleep2_mask_bits, sleep2_dog_mask_bits, sleep2_bsd_mask_bits, sleep2_sakura_mask_bits, sleep2_tomoyo_mask_bits }, +- { &AwakeGC, &AwakeXbm, awake_bits, awake_tora_bits, awake_dog_bits, awake_bsd_bits, awake_sakura_bits, awake_tomoyo_bits, +- &AwakeMsk, awake_mask_bits, awake_mask_bits, awake_dog_mask_bits, awake_bsd_mask_bits, awake_sakura_mask_bits, awake_tomoyo_mask_bits }, +- { &Up1GC, &Up1Xbm, up1_bits, up1_tora_bits, up1_dog_bits, up1_bsd_bits, up1_sakura_bits, up1_tomoyo_bits, +- &Up1Msk, up1_mask_bits, up1_mask_bits, up1_dog_mask_bits, up1_bsd_mask_bits, up1_sakura_mask_bits, up1_tomoyo_mask_bits }, +- { &Up2GC, &Up2Xbm, up2_bits, up2_tora_bits, up2_dog_bits, up2_bsd_bits, up2_sakura_bits, up2_tomoyo_bits, +- &Up2Msk, up2_mask_bits, up2_mask_bits, up2_dog_mask_bits, up2_bsd_mask_bits, up2_sakura_mask_bits, up2_tomoyo_mask_bits }, +- { &Down1GC, &Down1Xbm, down1_bits, down1_tora_bits, down1_dog_bits, down1_bsd_bits, down1_sakura_bits, down1_tomoyo_bits, +- &Down1Msk, down1_mask_bits, down1_mask_bits, down1_dog_mask_bits, down1_bsd_mask_bits, down1_sakura_mask_bits, down1_tomoyo_mask_bits }, +- { &Down2GC, &Down2Xbm, down2_bits, down2_tora_bits, down2_dog_bits, down2_bsd_bits, down2_sakura_bits, down2_tomoyo_bits, +- &Down2Msk, down2_mask_bits, down2_mask_bits, down2_dog_mask_bits, down2_bsd_mask_bits, down2_sakura_mask_bits, down2_tomoyo_mask_bits }, +- { &Left1GC, &Left1Xbm, left1_bits, left1_tora_bits, left1_dog_bits, left1_bsd_bits, left1_sakura_bits, left1_tomoyo_bits, +- &Left1Msk, left1_mask_bits, left1_mask_bits, left1_dog_mask_bits, left1_bsd_mask_bits, left1_sakura_mask_bits, left1_tomoyo_mask_bits }, +- { &Left2GC, &Left2Xbm, left2_bits, left2_tora_bits, left2_dog_bits, left2_bsd_bits, left2_sakura_bits, left2_tomoyo_bits, +- &Left2Msk, left2_mask_bits, left2_mask_bits, left2_dog_mask_bits, left2_bsd_mask_bits, left2_sakura_mask_bits, left2_tomoyo_mask_bits }, +- { &Right1GC, &Right1Xbm, right1_bits, right1_tora_bits, right1_dog_bits, right1_bsd_bits, right1_sakura_bits, right1_tomoyo_bits, +- &Right1Msk, right1_mask_bits, right1_mask_bits,right1_dog_mask_bits, right1_bsd_mask_bits, right1_sakura_mask_bits, right1_tomoyo_mask_bits }, +- { &Right2GC, &Right2Xbm, right2_bits, right2_tora_bits, right2_dog_bits, right2_bsd_bits, right2_sakura_bits, right2_tomoyo_bits, +- &Right2Msk, right2_mask_bits, right2_mask_bits, right2_dog_mask_bits, right2_bsd_mask_bits, right2_sakura_mask_bits, right2_tomoyo_mask_bits }, +- { &UpLeft1GC, &UpLeft1Xbm, upleft1_bits, upleft1_tora_bits, upleft1_dog_bits, upleft1_bsd_bits, upleft1_sakura_bits, upleft1_tomoyo_bits, +- &UpLeft1Msk, upleft1_mask_bits, upleft1_mask_bits, upleft1_dog_mask_bits, upleft1_bsd_mask_bits, upleft1_sakura_mask_bits, upleft1_tomoyo_mask_bits }, +- { &UpLeft2GC, &UpLeft2Xbm, upleft2_bits, upleft2_tora_bits, upleft2_dog_bits, upleft2_bsd_bits, upleft2_sakura_bits, upleft2_tomoyo_bits, +- &UpLeft2Msk, upleft2_mask_bits, upleft2_mask_bits,upleft2_dog_mask_bits, upleft2_bsd_mask_bits, upleft2_sakura_mask_bits, upleft2_tomoyo_mask_bits }, +- { &UpRight1GC, &UpRight1Xbm, upright1_bits, upright1_tora_bits, upright1_dog_bits, upright1_bsd_bits, upright1_sakura_bits, upright1_tomoyo_bits, +- &UpRight1Msk, upright1_mask_bits, upright1_mask_bits,upright1_dog_mask_bits, upright1_bsd_mask_bits, upright1_sakura_mask_bits, upright1_tomoyo_mask_bits }, +- { &UpRight2GC, &UpRight2Xbm, upright2_bits, upright2_tora_bits, upright2_dog_bits, upright2_bsd_bits, upright2_sakura_bits, upright2_tomoyo_bits, +- &UpRight2Msk, upright2_mask_bits, upright2_mask_bits,upright2_dog_mask_bits, upright2_bsd_mask_bits, upright2_sakura_mask_bits, upright2_tomoyo_mask_bits }, +- { &DownLeft1GC, &DownLeft1Xbm, dwleft1_bits, dwleft1_tora_bits, dwleft1_dog_bits, dwleft1_bsd_bits, dwleft1_sakura_bits, dwleft1_tomoyo_bits, +- &DownLeft1Msk, dwleft1_mask_bits, dwleft1_mask_bits, dwleft1_dog_mask_bits, dwleft1_bsd_mask_bits, dwleft1_sakura_mask_bits, dwleft1_tomoyo_mask_bits }, +- { &DownLeft2GC, &DownLeft2Xbm, dwleft2_bits, dwleft2_tora_bits, dwleft2_dog_bits, dwleft2_bsd_bits, dwleft2_sakura_bits, dwleft2_tomoyo_bits, +- &DownLeft2Msk, dwleft2_mask_bits, dwleft2_mask_bits, dwleft2_dog_mask_bits, dwleft2_bsd_mask_bits, dwleft2_sakura_mask_bits, dwleft2_tomoyo_mask_bits }, +- { &DownRight1GC, &DownRight1Xbm, dwright1_bits, dwright1_tora_bits, dwright1_dog_bits, dwright1_bsd_bits, dwright1_sakura_bits, dwright1_tomoyo_bits, +- &DownRight1Msk, dwright1_mask_bits, dwright1_mask_bits, dwright1_dog_mask_bits, dwright1_bsd_mask_bits, dwright1_sakura_mask_bits, dwright1_tomoyo_mask_bits }, +- { &DownRight2GC, &DownRight2Xbm, dwright2_bits, dwright2_tora_bits, dwright2_dog_bits, dwright2_bsd_bits, dwright2_sakura_bits, dwright2_tomoyo_bits, +- &DownRight2Msk, dwright2_mask_bits, dwright2_mask_bits, dwright2_dog_mask_bits, dwright2_bsd_mask_bits, dwright2_sakura_mask_bits, dwright2_tomoyo_mask_bits }, +- { &UpTogi1GC, &UpTogi1Xbm, utogi1_bits, utogi1_tora_bits, utogi1_dog_bits, utogi1_bsd_bits, utogi1_sakura_bits, utogi1_tomoyo_bits, +- &UpTogi1Msk, utogi1_mask_bits, utogi1_mask_bits, utogi1_dog_mask_bits, utogi1_bsd_mask_bits, utogi1_sakura_mask_bits, utogi1_tomoyo_mask_bits }, +- { &UpTogi2GC, &UpTogi2Xbm, utogi2_bits, utogi2_tora_bits, utogi2_dog_bits, utogi2_bsd_bits, utogi2_sakura_bits, utogi2_tomoyo_bits, +- &UpTogi2Msk, utogi2_mask_bits, utogi2_mask_bits, utogi2_dog_mask_bits, utogi2_bsd_mask_bits, utogi2_sakura_mask_bits, utogi2_tomoyo_mask_bits }, +- { &DownTogi1GC, &DownTogi1Xbm, dtogi1_bits, dtogi1_tora_bits, dtogi1_dog_bits, dtogi1_bsd_bits, dtogi1_sakura_bits, dtogi1_tomoyo_bits, +- &DownTogi1Msk, dtogi1_mask_bits, dtogi1_mask_bits, dtogi1_dog_mask_bits, dtogi1_bsd_mask_bits, dtogi1_sakura_mask_bits, dtogi1_tomoyo_mask_bits }, +- { &DownTogi2GC, &DownTogi2Xbm, dtogi2_bits, dtogi2_tora_bits, dtogi2_dog_bits, dtogi2_bsd_bits, dtogi2_sakura_bits, dtogi2_tomoyo_bits, +- &DownTogi2Msk, dtogi2_mask_bits, dtogi2_mask_bits, dtogi2_dog_mask_bits, dtogi2_bsd_mask_bits, dtogi2_sakura_mask_bits, dtogi2_tomoyo_mask_bits }, +- { &LeftTogi1GC, &LeftTogi1Xbm, ltogi1_bits, ltogi1_tora_bits, ltogi1_dog_bits, ltogi1_bsd_bits, ltogi1_sakura_bits, ltogi1_tomoyo_bits, +- &LeftTogi1Msk, ltogi1_mask_bits, ltogi1_mask_bits,ltogi1_dog_mask_bits, ltogi1_bsd_mask_bits, ltogi1_sakura_mask_bits, ltogi1_tomoyo_mask_bits }, +- { &LeftTogi2GC, &LeftTogi2Xbm, ltogi2_bits, ltogi2_tora_bits, ltogi2_dog_bits, ltogi2_bsd_bits, ltogi2_sakura_bits, ltogi2_tomoyo_bits, +- &LeftTogi2Msk, ltogi2_mask_bits, ltogi2_mask_bits,ltogi2_dog_mask_bits, ltogi2_bsd_mask_bits, ltogi2_sakura_mask_bits, ltogi2_tomoyo_mask_bits }, +- { &RightTogi1GC, &RightTogi1Xbm, rtogi1_bits, rtogi1_tora_bits, rtogi1_dog_bits, rtogi1_bsd_bits, rtogi1_sakura_bits, rtogi1_tomoyo_bits, +- &RightTogi1Msk, rtogi1_mask_bits, rtogi1_mask_bits,rtogi1_dog_mask_bits, rtogi1_bsd_mask_bits, rtogi1_sakura_mask_bits, rtogi1_tomoyo_mask_bits }, +- { &RightTogi2GC, &RightTogi2Xbm, rtogi2_bits, rtogi2_tora_bits, rtogi2_dog_bits, rtogi2_bsd_bits, rtogi2_sakura_bits, rtogi2_tomoyo_bits, +- &RightTogi2Msk, rtogi2_mask_bits, rtogi2_mask_bits,rtogi2_dog_mask_bits, rtogi2_bsd_mask_bits, rtogi2_sakura_mask_bits, rtogi2_tomoyo_mask_bits }, ++ { &Mati2GC, &Mati2Xbm, mati2_bits, mati2_tora_bits, mati2_dog_bits, ++ &Mati2Msk, mati2_mask_bits, mati2_mask_bits, mati2_dog_mask_bits }, ++ { &Jare2GC, &Jare2Xbm, jare2_bits, jare2_tora_bits, jare2_dog_bits, ++ &Jare2Msk, jare2_mask_bits, jare2_mask_bits, jare2_dog_mask_bits }, ++ { &Kaki1GC, &Kaki1Xbm, kaki1_bits, kaki1_tora_bits, kaki1_dog_bits, ++ &Kaki1Msk, kaki1_mask_bits, kaki1_mask_bits, kaki1_dog_mask_bits }, ++ { &Kaki2GC, &Kaki2Xbm, kaki2_bits, kaki2_tora_bits, kaki2_dog_bits, ++ &Kaki2Msk, kaki2_mask_bits, kaki2_mask_bits, kaki2_dog_mask_bits }, ++ { &Mati3GC, &Mati3Xbm, mati3_bits, mati3_tora_bits, mati3_dog_bits, ++ &Mati3Msk, mati3_mask_bits, mati3_mask_bits, mati3_dog_mask_bits }, ++ { &Sleep1GC, &Sleep1Xbm, sleep1_bits, sleep1_tora_bits, sleep1_dog_bits, ++ &Sleep1Msk, sleep1_mask_bits, sleep1_mask_bits, sleep1_dog_mask_bits }, ++ { &Sleep2GC, &Sleep2Xbm, sleep2_bits, sleep2_tora_bits, sleep2_dog_bits, ++ &Sleep2Msk, sleep2_mask_bits, sleep2_mask_bits, sleep2_dog_mask_bits }, ++ { &AwakeGC, &AwakeXbm, awake_bits, awake_tora_bits, awake_dog_bits, ++ &AwakeMsk, awake_mask_bits, awake_mask_bits, awake_dog_mask_bits }, ++ { &Up1GC, &Up1Xbm, up1_bits, up1_tora_bits, up1_dog_bits, ++ &Up1Msk, up1_mask_bits, up1_mask_bits, up1_dog_mask_bits }, ++ { &Up2GC, &Up2Xbm, up2_bits, up2_tora_bits, up2_dog_bits, ++ &Up2Msk, up2_mask_bits, up2_mask_bits, up2_dog_mask_bits }, ++ { &Down1GC, &Down1Xbm, down1_bits, down1_tora_bits, down1_dog_bits, ++ &Down1Msk, down1_mask_bits, down1_mask_bits, down1_dog_mask_bits }, ++ { &Down2GC, &Down2Xbm, down2_bits, down2_tora_bits, down2_dog_bits, ++ &Down2Msk, down2_mask_bits, down2_mask_bits, down2_dog_mask_bits }, ++ { &Left1GC, &Left1Xbm, left1_bits, left1_tora_bits, left1_dog_bits, ++ &Left1Msk, left1_mask_bits, left1_mask_bits, left1_dog_mask_bits }, ++ { &Left2GC, &Left2Xbm, left2_bits, left2_tora_bits, left2_dog_bits, ++ &Left2Msk, left2_mask_bits, left2_mask_bits, left2_dog_mask_bits }, ++ { &Right1GC, &Right1Xbm, right1_bits, right1_tora_bits, right1_dog_bits, ++ &Right1Msk, right1_mask_bits, right1_mask_bits,right1_dog_mask_bits }, ++ { &Right2GC, &Right2Xbm, right2_bits, right2_tora_bits, right2_dog_bits, ++ &Right2Msk, right2_mask_bits, right2_mask_bits, right2_dog_mask_bits }, ++ { &UpLeft1GC, &UpLeft1Xbm, upleft1_bits, upleft1_tora_bits, upleft1_dog_bits, ++ &UpLeft1Msk, upleft1_mask_bits, upleft1_mask_bits, upleft1_dog_mask_bits }, ++ { &UpLeft2GC, &UpLeft2Xbm, upleft2_bits, upleft2_tora_bits, upleft2_dog_bits, ++ &UpLeft2Msk, upleft2_mask_bits, upleft2_mask_bits,upleft2_dog_mask_bits }, ++ { &UpRight1GC, &UpRight1Xbm, upright1_bits, upright1_tora_bits, upright1_dog_bits, ++ &UpRight1Msk, upright1_mask_bits, upright1_mask_bits,upright1_dog_mask_bits }, ++ { &UpRight2GC, &UpRight2Xbm, upright2_bits, upright2_tora_bits, upright2_dog_bits, ++ &UpRight2Msk, upright2_mask_bits, upright2_mask_bits,upright2_dog_mask_bits }, ++ { &DownLeft1GC, &DownLeft1Xbm, dwleft1_bits, dwleft1_tora_bits, dwleft1_dog_bits, ++ &DownLeft1Msk, dwleft1_mask_bits, dwleft1_mask_bits, dwleft1_dog_mask_bits }, ++ { &DownLeft2GC, &DownLeft2Xbm, dwleft2_bits, dwleft2_tora_bits, dwleft2_dog_bits, ++ &DownLeft2Msk, dwleft2_mask_bits, dwleft2_mask_bits, dwleft2_dog_mask_bits }, ++ { &DownRight1GC, &DownRight1Xbm, dwright1_bits, dwright1_tora_bits, dwright1_dog_bits, ++ &DownRight1Msk, dwright1_mask_bits, dwright1_mask_bits, dwright1_dog_mask_bits }, ++ { &DownRight2GC, &DownRight2Xbm, dwright2_bits, dwright2_tora_bits, dwright2_dog_bits, ++ &DownRight2Msk, dwright2_mask_bits, dwright2_mask_bits, dwright2_dog_mask_bits }, ++ { &UpTogi1GC, &UpTogi1Xbm, utogi1_bits, utogi1_tora_bits, utogi1_dog_bits, ++ &UpTogi1Msk, utogi1_mask_bits, utogi1_mask_bits, utogi1_dog_mask_bits }, ++ { &UpTogi2GC, &UpTogi2Xbm, utogi2_bits, utogi2_tora_bits, utogi2_dog_bits, ++ &UpTogi2Msk, utogi2_mask_bits, utogi2_mask_bits, utogi2_dog_mask_bits }, ++ { &DownTogi1GC, &DownTogi1Xbm, dtogi1_bits, dtogi1_tora_bits, dtogi1_dog_bits, ++ &DownTogi1Msk, dtogi1_mask_bits, dtogi1_mask_bits, dtogi1_dog_mask_bits }, ++ { &DownTogi2GC, &DownTogi2Xbm, dtogi2_bits, dtogi2_tora_bits, dtogi2_dog_bits, ++ &DownTogi2Msk, dtogi2_mask_bits, dtogi2_mask_bits, dtogi2_dog_mask_bits }, ++ { &LeftTogi1GC, &LeftTogi1Xbm, ltogi1_bits, ltogi1_tora_bits, ltogi1_dog_bits, ++ &LeftTogi1Msk, ltogi1_mask_bits, ltogi1_mask_bits,ltogi1_dog_mask_bits }, ++ { &LeftTogi2GC, &LeftTogi2Xbm, ltogi2_bits, ltogi2_tora_bits, ltogi2_dog_bits, ++ &LeftTogi2Msk, ltogi2_mask_bits, ltogi2_mask_bits,ltogi2_dog_mask_bits }, ++ { &RightTogi1GC, &RightTogi1Xbm, rtogi1_bits, rtogi1_tora_bits, rtogi1_dog_bits, ++ &RightTogi1Msk, rtogi1_mask_bits, rtogi1_mask_bits,rtogi1_dog_mask_bits }, ++ { &RightTogi2GC, &RightTogi2Xbm, rtogi2_bits, rtogi2_tora_bits, rtogi2_dog_bits, ++ &RightTogi2Msk, rtogi2_mask_bits, rtogi2_mask_bits,rtogi2_dog_mask_bits }, + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } + }; + +@@ -1512,8 +1506,6 @@ GetArguments(argc, argv, theDisplayName) + } + else { + char *av = argv[ArgCounter] + 1; +- if (strcmp(av, "bsd") == 0) +- av = "bsd_daemon"; + for (loop=0;loopl9g(J True $@$H$7$^$9!#(J + $@$r;H$&$3$H$KN10U$7$F$/$@$5$$!#(J + $@%O!<%I%j%s%/$"$k$$$O%=%U%H%j%s%/$K$h$C$F!"$3$N%W%m%0%i%`$r(J tora $@$H$7$F(J + $@5/F0$7$?>l9g$K$O!"%G%U%)%k%H$G(J \fB-tora\fP $@%*%W%7%g%s$,M-8z$H$J$j$^$9!#(J +-.PP +-BSD $@%G!<%b%s$O(J Marshall Kirk McKusick $@;a$NCx:nJ*$G$9!#$9$Y$F$N8"Mx$O(J +-$@J];}$5$l$F$$$^$9!#(J +-BSD Daemon Copyright 1988 by Marshall Kirk McKusick. All Rights Reserved. +-.PP +-$@LZG7K\:y$*$h$SBgF;;{CN@$$OL!2h!X%+!<%I%-%c%W%?!<$5$/$i!Y!J(JCLAMP, $@9VCL(J +-$@ ;;; Copyright © 2019 Jesse Gibbons -;;; Copyright © 2019, 2020 Timotej Lazar +;;; Copyright © 2019, 2020, 2021 Timotej Lazar ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2021 Leo Famulari ;;; @@ -21,6 +21,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages toys) + #:use-module (gnu packages) #:use-module (gnu packages bison) #:use-module (gnu packages flex) #:use-module (gnu packages gtk) @@ -36,6 +37,66 @@ #:use-module (guix packages) #:use-module (guix utils)) +(define-public oneko + (package + (name "oneko") + (version "1.2.sakura.5") + (source + (origin + (method url-fetch) + (uri (string-append + "http://www.daidouji.com/oneko/distfiles/oneko-" version ".tar.gz")) + (sha256 + (base32 "0bxjlbafn10sfi5d06420pg70rpvsiy5gdbm8kspd6qy4kqhabic")) + (patches (search-patches "oneko-remove-nonfree-characters.patch")) + (modules '((guix build utils))) + (snippet + ;; Remove bitmaps with copyright issues. + '(begin + (for-each delete-file-recursively + (cons* "bitmaps/bsd" "bitmaps/sakura" "bitmaps/tomoyo" + "bitmasks/bsd" "bitmasks/sakura" "bitmasks/tomoyo" + (find-files "cursors" "(bsd|card|petal).*\\.xbm"))) + #t)))) + (build-system gnu-build-system) + (native-inputs + `(("imake" ,imake))) + (inputs + `(("libx11" ,libx11) + ("libxext" ,libxext))) + (arguments + `(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda _ + (invoke "xmkmf") + ;; Fix incorrectly generated compiler flags. + (substitute* "Makefile" + (("(CDEBUGFLAGS = ).*" _ front) (string-append front "-O2\n"))) + #t)) + (replace 'install + (lambda* (#:key outputs make-flags #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (doc (string-append out "/share/doc/" ,name "-" ,version)) + (man (string-append out "/share/man")) + (man6 (string-append man "/man6")) + (man6-ja (string-append man "/ja/man6"))) + (install-file "oneko" bin) + (mkdir-p man6) + (mkdir-p man6-ja) + (copy-file "oneko.man" (string-append man6 "/oneko.6")) + (copy-file "oneko.man.jp" (string-append man6-ja "/oneko.6")) + (for-each (lambda (file) (install-file file doc)) + (find-files "." "README.*"))) + #t))))) + (home-page "http://www.daidouji.com/oneko/") + (synopsis "Cute cat chasing your mouse pointer") + (description "Displays a cat or another animated character that chases the +mouse pointer around the screen while you work.") + (license license:public-domain))) ; see https://directory.fsf.org/wiki/Oneko + (define-public sl (package (name "sl") -- cgit v1.2.3 From e3e4cbb93fb4a7085eea089ed633083c95c77a32 Mon Sep 17 00:00:00 2001 From: Sarah Morgensen Date: Fri, 25 Jun 2021 00:21:06 -0700 Subject: gnu: Add go-1.16. Add go@1.16 as a non-default go. Changes from 1.14: Use now-supported GO_LDSO configuration option for setting the interpreter. Bootstrap with gccgo on platforms which do not support go-1.4. Fix and re-enable cmd/go script tests. Fix typo in cgoldflags patch. Break out tests into "check" phase. Remove references to perl to reduce closure size by ~10%. Set GOCACHE so go doesn't attempt to access $HOME. * gnu/packages/patches/go-fix-script-tests.patch: New file. * local.mk (dist_patch_DATA): Register it. * gnu/packages/golang.scm (go-1.16): New variable. Use the patch. Signed-off-by: Efraim Flashner --- gnu/local.mk | 1 + gnu/packages/golang.scm | 159 +++++++++++++++++++++++++ gnu/packages/patches/go-fix-script-tests.patch | 18 +++ 3 files changed, 178 insertions(+) create mode 100644 gnu/packages/patches/go-fix-script-tests.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 7d1fc8157c..6b9202cba1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1169,6 +1169,7 @@ dist_patch_DATA = \ %D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \ %D%/packages/patches/gobject-introspection-cc.patch \ %D%/packages/patches/gobject-introspection-girepository.patch \ + %D%/packages/patches/go-fix-script-tests.patch \ %D%/packages/patches/go-skip-gc-test.patch \ %D%/packages/patches/gpm-glibc-2.26.patch \ %D%/packages/patches/gpodder-disable-updater.patch \ diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 1d17f02cdd..aedb5d4f69 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -26,6 +26,7 @@ ;;; Copyright © 2021 Ricardo Wurmus ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2021 Sharlatan Hellseher +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,6 +46,7 @@ (define-module (gnu packages golang) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix utils) + #:use-module ((guix build utils) #:select (alist-replace)) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix packages) @@ -54,6 +56,7 @@ #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages base) + #:use-module ((gnu packages bootstrap) #:select (glibc-dynamic-linker)) #:use-module (gnu packages gcc) #:use-module (gnu packages glib) #:use-module (gnu packages lua) @@ -441,6 +444,162 @@ in the style of communicating sequential processes (@dfn{CSP}).") ,@(package-native-inputs go-1.4))) (supported-systems %supported-systems))) +(define-public go-1.16 + (package + (inherit go-1.14) + (name "go") + (version "1.16.5") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/golang/go") + (commit (string-append "go" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "19a93p217h5xi2sgh34qzv24pkd4df0sw4fc5z6k47lspjp3vx2l")))) + (arguments + (substitute-keyword-arguments (package-arguments go-1.14) + ((#:tests? _) #t) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'remove-unused-sourcecode-generators + (lambda _ + ;; Prevent perl from inclusion in closure through unused files + (for-each delete-file (find-files "src" "\\.pl$")))) + (replace 'prebuild + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib")) + (net-base (assoc-ref inputs "net-base")) + (tzdata-path + (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))) + + ;; Having the patch in the 'patches' field of breaks + ;; the 'TestServeContent' test due to the fact that + ;; timestamps are reset. Thus, apply it from here. + (invoke "patch" "-p2" "--force" "-i" + (assoc-ref inputs "go-skip-gc-test.patch")) + (invoke "patch" "-p2" "--force" "-i" + (assoc-ref inputs "go-fix-script-tests.patch")) + + (for-each make-file-writable (find-files ".")) + + (substitute* "os/os_test.go" + (("/usr/bin") (getcwd)) + (("/bin/sh") (which "sh"))) + + (substitute* "cmd/go/testdata/script/cgo_path_space.txt" + (("/bin/sh") (which "sh"))) + + ;; Add libgcc to runpath + (substitute* "cmd/link/internal/ld/lib.go" + (("!rpath.set") "true")) + (substitute* "cmd/go/internal/work/gccgo.go" + (("cgoldflags := \\[\\]string\\{\\}") + (string-append "cgoldflags := []string{" + "\"-Wl,-rpath=" gcclib "\"" + "}")) + (("\"-lgcc_s\", ") + (string-append + "\"-Wl,-rpath=" gcclib "\", \"-lgcc_s\", "))) + (substitute* "cmd/go/internal/work/gc.go" + (("ldflags = setextld\\(ldflags, compiler\\)") + (string-append + "ldflags = setextld(ldflags, compiler)\n" + "ldflags = append(ldflags, \"-r\")\n" + "ldflags = append(ldflags, \"" gcclib "\")\n"))) + + ;; Disable failing tests: these tests attempt to access + ;; commands or network resources which are neither available + ;; nor necessary for the build to succeed. + (for-each + (match-lambda + ((file regex) + (substitute* file + ((regex all before test_name) + (string-append before "Disabled" test_name))))) + '(("net/net_test.go" "(.+)(TestShutdownUnix.+)") + ("net/dial_test.go" "(.+)(TestDialTimeout.+)") + ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPort.+)") + ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPortWithCancel.+)") + ;; 127.0.0.1 doesn't exist + ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPTR.+)") + ;; 127.0.0.1 doesn't exist + ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPTRWithCancel.+)") + ;; /etc/services doesn't exist + ("net/parse_test.go" "(.+)(TestReadLine.+)") + ("os/os_test.go" "(.+)(TestHostname.+)") + ;; The user's directory doesn't exist + ("os/os_test.go" "(.+)(TestUserHomeDir.+)") + ("time/format_test.go" "(.+)(TestParseInSydney.+)") + ("time/format_test.go" "(.+)(TestParseInLocation.+)") + ("os/exec/exec_test.go" "(.+)(TestEcho.+)") + ("os/exec/exec_test.go" "(.+)(TestCommandRelativeName.+)") + ("os/exec/exec_test.go" "(.+)(TestCatStdin.+)") + ("os/exec/exec_test.go" "(.+)(TestCatGoodAndBadFile.+)") + ("os/exec/exec_test.go" "(.+)(TestExitStatus.+)") + ("os/exec/exec_test.go" "(.+)(TestPipes.+)") + ("os/exec/exec_test.go" "(.+)(TestStdinClose.+)") + ("os/exec/exec_test.go" "(.+)(TestIgnorePipeErrorOnSuccess.+)") + ("syscall/syscall_unix_test.go" "(.+)(TestPassFD\\(.+)") + ("os/exec/exec_test.go" "(.+)(TestExtraFiles/areturn.+)") + ("cmd/go/go_test.go" "(.+)(TestCoverageWithCgo.+)") + ("cmd/go/go_test.go" "(.+)(TestTwoPkgConfigs.+)") + ("os/exec/exec_test.go" "(.+)(TestOutputStderrCapture.+)") + ("os/exec/exec_test.go" "(.+)(TestExtraFiles.+)") + ("os/exec/exec_test.go" "(.+)(TestExtraFilesRace.+)") + ("net/lookup_test.go" "(.+)(TestLookupPort.+)") + ("syscall/exec_linux_test.go" + "(.+)(TestCloneNEWUSERAndRemapNoRootDisableSetgroups.+)"))) + + ;; These tests fail on aarch64-linux + (substitute* "cmd/dist/test.go" + (("t.registerHostTest\\(\"testsanitizers/msan.*") "")) + + ;; fix shebang for testar script + ;; note the target script is generated at build time. + (substitute* "../misc/cgo/testcarchive/carchive_test.go" + (("#!/usr/bin/env") (string-append "#!" (which "env")))) + + (substitute* "net/lookup_unix.go" + (("/etc/protocols") (string-append net-base "/etc/protocols"))) + (substitute* "net/port_unix.go" + (("/etc/services") (string-append net-base "/etc/services"))) + (substitute* "time/zoneinfo_unix.go" + (("/usr/share/zoneinfo/") tzdata-path))))) + (replace 'build + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; FIXME: Some of the .a files are not bit-reproducible. + ;; (Is this still true?) + (let* ((output (assoc-ref outputs "out")) + (loader (string-append (assoc-ref inputs "libc") + ,(glibc-dynamic-linker)))) + (setenv "CC" (which "gcc")) + (setenv "GO_LDSO" loader) + (setenv "GOOS" "linux") + (setenv "GOROOT" (dirname (getcwd))) + (setenv "GOROOT_FINAL" output) + (setenv "GOCACHE" "/tmp/go-cache") + (invoke "sh" "make.bash" "--no-banner")))) + (replace 'check + (lambda* (#:key target (tests? (not target)) (parallel-tests? #t) + #:allow-other-keys) + (let* ((njobs (if parallel-tests? (parallel-job-count) 1))) + (when tests? + (setenv "GOMAXPROCS" (number->string njobs)) + (invoke "sh" "run.bash" "--no-rebuild"))))) + (add-before 'install 'unpatch-perl-shebangs + (lambda _ + ;; Rewrite references to perl input in test scripts + (substitute* "net/http/cgi/testdata/test.cgi" + (("^#!.*") "#!/usr/bin/env perl\n")))))))) + (native-inputs + `(("go-fix-script-tests.patch" ,(search-patch "go-fix-script-tests.patch")) + ,@(if (not (member (%current-system) (package-supported-systems go-1.4))) + (alist-replace "go" (list gccgo-10) (package-native-inputs go-1.14)) + (package-native-inputs go-1.14)))))) + (define-public go go-1.14) (define-public go-github-com-alsm-ioprogress diff --git a/gnu/packages/patches/go-fix-script-tests.patch b/gnu/packages/patches/go-fix-script-tests.patch new file mode 100644 index 0000000000..b29e83fef0 --- /dev/null +++ b/gnu/packages/patches/go-fix-script-tests.patch @@ -0,0 +1,18 @@ +Make library/header paths visible to cmd/go script tests, which is necessary for +cgo/gccgo tests to work correctly + +diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go +index dfaa40548e..9d0f0e9bcd 100644 +--- a/src/cmd/go/script_test.go ++++ b/src/cmd/go/script_test.go +@@ -100,6 +100,10 @@ const ( + var extraEnvKeys = []string{ + "SYSTEMROOT", // must be preserved on Windows to find DLLs; golang.org/issue/25210 + "WINDIR", // must be preserved on Windows to be able to run PowerShell command; golang.org/issue/30711 ++ "CPATH", ++ "C_INCLUDE_PATH", ++ "CPLUS_INCLUDE_PATH", ++ "LIBRARY_PATH", + "LD_LIBRARY_PATH", // must be preserved on Unix systems to find shared libraries + "CC", // don't lose user settings when invoking cgo + "GO_TESTING_GOTOOLS", // for gccgo testing -- cgit v1.2.3 From 3fdb2d679259f5d1541240dd4e9cedda17040bf2 Mon Sep 17 00:00:00 2001 From: LibreMiami Date: Sat, 26 Jun 2021 23:12:43 -0400 Subject: gnu: Add ytfzf. * 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 (limited to 'gnu/packages/patches') 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..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 + -- cgit v1.2.3 From 55b14663032b6d6d6d3d302cd97eda28a729859f Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Mon, 28 Jun 2021 17:56:33 -0400 Subject: Revert "gnu: Add ytfzf." This reverts commit 3fdb2d679259f5d1541240dd4e9cedda17040bf2, as it was accidentally pushed. --- 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 deletions(-) delete mode 100644 gnu/packages/patches/ytfzf-programs.patch delete mode 100644 gnu/packages/patches/ytfzf-updates.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 919a0d4a34..6b9202cba1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1858,8 +1858,6 @@ 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 ccbbb3bc2d..f01b6a614a 100644 --- a/gnu/packages/image-viewers.scm +++ b/gnu/packages/image-viewers.scm @@ -18,8 +18,6 @@ ;;; 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. ;;; @@ -48,7 +46,6 @@ #: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) @@ -67,7 +64,6 @@ #: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) @@ -75,108 +71,10 @@ #: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 deleted file mode 100644 index f744c19aeb..0000000000 --- a/gnu/packages/patches/ytfzf-programs.patch +++ /dev/null @@ -1,372 +0,0 @@ -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 deleted file mode 100644 index 9811bd64be..0000000000 --- a/gnu/packages/patches/ytfzf-updates.patch +++ /dev/null @@ -1,41 +0,0 @@ -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 - -- cgit v1.2.3 From b7d70aeb0b5fd595bcbb59b61e513f1291f45575 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 30 Jun 2021 20:02:32 +0300 Subject: gnu: tor: Update to 0.4.6.6. * gnu/packages/tor.scm (tor): Update to 0.4.6.6. [source]: Remove patch. * gnu/packages/patches/tor-fix-build-with-gcc-7.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - .../patches/tor-fix-build-with-gcc-7.patch | 30 ---------------------- gnu/packages/tor.scm | 5 ++-- 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 gnu/packages/patches/tor-fix-build-with-gcc-7.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 6b9202cba1..b197ec55f9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1758,7 +1758,6 @@ dist_patch_DATA = \ %D%/packages/patches/tk-find-library.patch \ %D%/packages/patches/tla2tools-build-xml.patch \ %D%/packages/patches/tlf-support-hamlib-4.2+.patch \ - %D%/packages/patches/tor-fix-build-with-gcc-7.patch \ %D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/transmission-honor-localedir.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ diff --git a/gnu/packages/patches/tor-fix-build-with-gcc-7.patch b/gnu/packages/patches/tor-fix-build-with-gcc-7.patch deleted file mode 100644 index 5481695a63..0000000000 --- a/gnu/packages/patches/tor-fix-build-with-gcc-7.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 810c0616d59809b89f5144d4afdbf70391df7a7f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= -Date: Thu, 10 Jun 2021 20:04:13 +0000 -Subject: [PATCH] Fix compilation on OpenSUSE. - -This patch fixes a build error with GCC 7.x which doesn't seem to accept -const int's as constants in macro initialization. - -See: tpo/core/tor#40410 ---- - src/feature/dirclient/dirclient.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c -index 74c6452061..a2b20621a0 100644 ---- a/src/feature/dirclient/dirclient.c -+++ b/src/feature/dirclient/dirclient.c -@@ -1907,8 +1907,7 @@ dir_client_decompress_response_body(char **bodyp, size_t *bodylenp, - /* If we're pretty sure that we have a compressed directory, and - * we didn't manage to uncompress it, then warn and bail. */ - if (!plausible && !new_body) { -- const int LOG_INTERVAL = 3600; -- static ratelim_t warning_limit = RATELIM_INIT(LOG_INTERVAL); -+ static ratelim_t warning_limit = RATELIM_INIT(60 * 60); - log_fn_ratelim(&warning_limit, LOG_WARN, LD_HTTP, - "Unable to decompress HTTP body (tried %s%s%s, on %s).", - description1, --- -GitLab - diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm index 2d9aac1924..e4f16f6caa 100644 --- a/gnu/packages/tor.scm +++ b/gnu/packages/tor.scm @@ -56,15 +56,14 @@ (define-public tor (package (name "tor") - (version "0.4.6.5") + (version "0.4.6.6") (source (origin (method url-fetch) (uri (string-append "https://dist.torproject.org/tor-" version ".tar.gz")) (sha256 (base32 - "1yacd7h7wg8n6wwrjmx2g9xjj24kj08j5sai9g7fm4cp1m73avbv")) - (patches (search-patches "tor-fix-build-with-gcc-7.patch")))) + "04ifi18cj4cw5lhfzgfrrc42j7qqdmbvxq24xlhj0dsmljdih8rl")))) (build-system gnu-build-system) (arguments `(#:configure-flags -- cgit v1.2.3 From 243d74579d2afdcad1f709909a3ac149475b3e23 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 4 Jul 2021 03:03:47 +0200 Subject: gnu: libgrss: Fix CVE-2016-20011. * gnu/packages/gnome.scm (libgrss): Add patch. * gnu/packages/patches/libgrss-CVE-2016-2001.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/gnome.scm | 4 +- gnu/packages/patches/libgrss-CVE-2016-2001.patch | 101 +++++++++++++++++++++++ 3 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/libgrss-CVE-2016-2001.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index b197ec55f9..beaf99bf71 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1347,6 +1347,7 @@ dist_patch_DATA = \ %D%/packages/patches/libgit2-mtime-0.patch \ %D%/packages/patches/libgnome-encoding.patch \ %D%/packages/patches/libgnomeui-utf8.patch \ + %D%/packages/patches/libgrss-CVE-2016-2001.patch \ %D%/packages/patches/libjxr-fix-function-signature.patch \ %D%/packages/patches/libjxr-fix-typos.patch \ %D%/packages/patches/libofa-ftbfs-1.diff \ diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 57fa3cc75f..aa9504d061 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -392,7 +392,9 @@ services.") (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 - (base32 "1nalslgyglvhpva3px06fj6lv5zgfg0qmj0sbxyyl5d963vc02b7")))) + (base32 "1nalslgyglvhpva3px06fj6lv5zgfg0qmj0sbxyyl5d963vc02b7")) + (patches + (search-patches "libgrss-CVE-2016-2001.patch")))) (build-system glib-or-gtk-build-system) (outputs '("out" "doc")) (arguments diff --git a/gnu/packages/patches/libgrss-CVE-2016-2001.patch b/gnu/packages/patches/libgrss-CVE-2016-2001.patch new file mode 100644 index 0000000000..b7de681475 --- /dev/null +++ b/gnu/packages/patches/libgrss-CVE-2016-2001.patch @@ -0,0 +1,101 @@ +From 2c6ea642663e2a44efc8583fae7c54b7b98f72b3 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Mon, 7 Jun 2021 18:51:07 -0600 +Subject: [PATCH] Ensure the ssl-use-system-ca-file property is set to true on + all SoupSessions. + +The default SoupSessionSync and SoupSessionAsync behaviour does not perform any +TLS certificate validation, unless the ssl-use-system-ca-file property is set +to true. + +This mitigates CVE-2016-20011. +--- + src/feed-channel.c | 2 ++ + src/feed-enclosure.c | 4 ++++ + src/feeds-pool.c | 1 + + src/feeds-publisher.c | 4 +++- + src/feeds-subscriber.c | 4 +++- + 5 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/src/feed-channel.c b/src/feed-channel.c +index 19ca7b2..d2d51b9 100644 +--- a/src/feed-channel.c ++++ b/src/feed-channel.c +@@ -973,6 +973,8 @@ quick_and_dirty_parse (GrssFeedChannel *channel, SoupMessage *msg, GList **save_ + static void + init_soup_session (SoupSession *session, GrssFeedChannel *channel) + { ++ g_object_set (G_OBJECT (session), "ssl-use-system-ca-file", TRUE, NULL); ++ + if (channel->priv->jar != NULL) + soup_session_add_feature (session, SOUP_SESSION_FEATURE (channel->priv->jar)); + if (channel->priv->gzip == TRUE) +diff --git a/src/feed-enclosure.c b/src/feed-enclosure.c +index 68ebbfe..2cd8f9e 100644 +--- a/src/feed-enclosure.c ++++ b/src/feed-enclosure.c +@@ -220,6 +220,8 @@ grss_feed_enclosure_fetch (GrssFeedEnclosure *enclosure, GError **error) + url = grss_feed_enclosure_get_url (enclosure); + + session = soup_session_sync_new (); ++ g_object_set (G_OBJECT (session), "ssl-use-system-ca-file", TRUE, NULL); ++ + msg = soup_message_new ("GET", url); + status = soup_session_send_message (session, msg); + +@@ -282,6 +284,8 @@ grss_feed_enclosure_fetch_async (GrssFeedEnclosure *enclosure, GAsyncReadyCallba + + task = g_task_new (enclosure, NULL, callback, user_data); + session = soup_session_async_new (); ++ g_object_set (G_OBJECT (session), "ssl-use-system-ca-file", TRUE, NULL); ++ + msg = soup_message_new ("GET", grss_feed_enclosure_get_url (enclosure)); + soup_session_queue_message (session, msg, enclosure_downloaded, task); + } +diff --git a/src/feeds-pool.c b/src/feeds-pool.c +index f18f3cd..7b33956 100644 +--- a/src/feeds-pool.c ++++ b/src/feeds-pool.c +@@ -178,6 +178,7 @@ grss_feeds_pool_init (GrssFeedsPool *node) + memset (node->priv, 0, sizeof (GrssFeedsPoolPrivate)); + node->priv->parser = grss_feed_parser_new (); + node->priv->soupsession = soup_session_async_new (); ++ g_object_set (G_OBJECT (node->priv->soupsession), "ssl-use-system-ca-file", TRUE, NULL); + } + + /** +diff --git a/src/feeds-publisher.c b/src/feeds-publisher.c +index 427a54f..500cd96 100644 +--- a/src/feeds-publisher.c ++++ b/src/feeds-publisher.c +@@ -888,8 +888,10 @@ create_and_run_server (GrssFeedsPublisher *pub) + { + SoupAddress *soup_addr; + +- if (pub->priv->soupsession == NULL) ++ if (pub->priv->soupsession == NULL) { + pub->priv->soupsession = soup_session_async_new (); ++ g_object_set (G_OBJECT (pub->priv->soupsession), "ssl-use-system-ca-file", TRUE, NULL); ++ } + + soup_addr = soup_address_new_any (SOUP_ADDRESS_FAMILY_IPV4, pub->priv->port); + pub->priv->server = soup_server_new ("port", pub->priv->port, "interface", soup_addr, NULL); +diff --git a/src/feeds-subscriber.c b/src/feeds-subscriber.c +index 259f891..0f63f83 100644 +--- a/src/feeds-subscriber.c ++++ b/src/feeds-subscriber.c +@@ -513,8 +513,10 @@ init_run_server (GrssFeedsSubscriber *sub) + { + GInetAddress *addr; + +- if (sub->priv->soupsession == NULL) ++ if (sub->priv->soupsession == NULL) { + sub->priv->soupsession = soup_session_async_new (); ++ g_object_set (G_OBJECT (sub->priv->soupsession), "ssl-use-system-ca-file", TRUE, NULL); ++ } + + /* + Flow: +-- +GitLab + -- cgit v1.2.3 From aa6e6fb2e9ea231d12d49a8925fddd8d2686ea94 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Mon, 5 Jul 2021 06:56:07 -0400 Subject: gnu: Add ytfzf. * gnu/packages/image-viewers.scm (ytfzf): New variable. Co-authored-by: jgart --- gnu/local.mk | 2 + gnu/packages/image-viewers.scm | 178 ++++++++ gnu/packages/patches/ytfzf-programs.patch | 651 ++++++++++++++++++++++++++++++ gnu/packages/patches/ytfzf-updates.patch | 44 ++ 4 files changed, 875 insertions(+) create mode 100644 gnu/packages/patches/ytfzf-programs.patch create mode 100644 gnu/packages/patches/ytfzf-updates.patch (limited to 'gnu/packages/patches') 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..bb2eb6a30e 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,8 @@ #: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 bash) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -53,6 +57,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 +68,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 +78,181 @@ #: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")) + (bash (assoc-ref inputs "bash")) + (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")) + (("@sh@") + (string-append bash "/bin/sh")) + (("@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 + `(("bash" ,bash) + ("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..57bd7d4d94 --- /dev/null +++ b/gnu/packages/patches/ytfzf-programs.patch @@ -0,0 +1,651 @@ +From 2118630fe9ac85f4e59135100047cdfb2683c81d 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 | 204 +++++++++++++++++++++++++++++----------------------------- + 1 file changed, 102 insertions(+), 102 deletions(-) + +diff --git a/ytfzf b/ytfzf +index f4d2e0d..f0f2e16 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 {}\" \ ++ --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..40e7c138b0 --- /dev/null +++ b/gnu/packages/patches/ytfzf-updates.patch @@ -0,0 +1,44 @@ +From ceb6836cd31653267506957cd0ccf78046404d3b 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 f0f2e16..2d1bb2e 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 + -- cgit v1.2.3 From f480f27c9c652c927e66d38a7183751303794711 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Wed, 7 Jul 2021 01:53:39 -0400 Subject: gnu: ytfzf: Fix loading of thumbnails. * gnu/packages/patches/ytfzf-programs.patch: Modify. --- gnu/packages/patches/ytfzf-programs.patch | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/ytfzf-programs.patch b/gnu/packages/patches/ytfzf-programs.patch index 57bd7d4d94..005ce2cf99 100644 --- a/gnu/packages/patches/ytfzf-programs.patch +++ b/gnu/packages/patches/ytfzf-programs.patch @@ -1,21 +1,21 @@ -From 2118630fe9ac85f4e59135100047cdfb2683c81d Mon Sep 17 00:00:00 2001 +From 3f1eaf5a1645b28ca18cfa028417dc225b7a557f 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. +Subject: [PATCH] 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 | 204 +++++++++++++++++++++++++++++----------------------------- - 1 file changed, 102 insertions(+), 102 deletions(-) + ytfzf | 198 +++++++++++++++++++++++++++++----------------------------- + 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/ytfzf b/ytfzf -index f4d2e0d..f0f2e16 100755 +index f4d2e0d..e8bb60b 100755 --- a/ytfzf +++ b/ytfzf -@@ -49,19 +49,19 @@ cache_dir=${YTFZF_CACHE-${cache_dir-$HOME/.cache/ytfzf}} +@@ -49,17 +49,17 @@ 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 @@ -35,11 +35,8 @@ index f4d2e0d..f0f2e16 100755 -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@}} + 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" @@ -307,7 +304,7 @@ index f4d2e0d..f0f2e16 100755 ..|.playlistRenderer? | select(. !=null) | { -@@ -904,31 +904,31 @@ get_search_query () { +@@ -904,28 +904,28 @@ get_search_query () { #> To select videos from videos_data user_selection () { #remove subscription separators @@ -332,8 +329,7 @@ index f4d2e0d..f0f2e16 100755 - 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 + [ "$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\" \ @@ -342,11 +338,7 @@ index f4d2e0d..f0f2e16 100755 + --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 + [ "$thumb_disp_method" = "ueberzug" ] && stop_ueberzug @@ -951,10 +951,10 @@ handle_shortcuts () { case $selected_key in "$urls_shortcut") printf "%s\n" $selected_urls; return 1 ;; -- cgit v1.2.3 From 99aecc0988e5fb0b6c2773db13d93501650e928c Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 7 Jul 2021 16:11:26 -0400 Subject: gnu: VTK 8: Re-fix a build failure with recent versions of freetype. * gnu/packages/patches/vtk-8-fix-freetypetools-build-failure.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/image-processing.scm (vtk-8): Dis-inherit from VTK. Use the package definition that predated the update to VTK 9, taken from commit f4dc8ac6dfa036d98aa0990ae22268a9650899d0. --- gnu/local.mk | 1 + gnu/packages/image-processing.scm | 83 ++++++++++++++++++++-- .../vtk-8-fix-freetypetools-build-failure.patch | 36 ++++++++++ 3 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 gnu/packages/patches/vtk-8-fix-freetypetools-build-failure.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 66687b420c..09a9965c19 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1821,6 +1821,7 @@ dist_patch_DATA = \ %D%/packages/patches/vte-CVE-2012-2738-pt1.patch \ %D%/packages/patches/vte-CVE-2012-2738-pt2.patch \ %D%/packages/patches/vtk-fix-freetypetools-build-failure.patch \ + %D%/packages/patches/vtk-8-fix-freetypetools-build-failure.patch \ %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch \ %D%/packages/patches/webkitgtk-share-store.patch \ %D%/packages/patches/webkitgtk-bind-all-fonts.patch \ diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index d1d890e733..7408457814 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -358,7 +358,8 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") ;; freecad needs an old version of VTK, because VTK's API changed from 8 to 9 (define-public vtk-8 - (package (inherit vtk) + (package + (name "vtk") (version "8.2.0") (source (origin (method url-fetch) @@ -367,10 +368,84 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") "/VTK-" version ".tar.gz")) (sha256 (base32 - "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl")))) + "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl")) + (patches + (search-patches "vtk-8-fix-freetypetools-build-failure.patch")) + (modules '((guix build utils))) + (snippet + '(begin + (for-each + (lambda (dir) + (delete-file-recursively + (string-append "ThirdParty/" dir "/vtk" dir))) + ;; ogg, pugixml depended upon unconditionally + '("doubleconversion" "eigen" "expat" "freetype" "gl2ps" + "glew" "hdf5" "jpeg" "jsoncpp" "libproj" "libxml2" "lz4" + "netcdf" "png" "sqlite" "theora" "tiff" "zlib")) + #t)))) + (build-system cmake-build-system) + (arguments + '(#:build-type "Release" ;Build without '-g' to save space. + #:configure-flags '(;"-DBUILD_TESTING:BOOL=TRUE" + ;"-DVTK_MODULE_USE_EXTERNAL_vtkogg:BOOL=TRUE" ; not honored + "-DVTK_USE_SYSTEM_DOUBLECONVERSION:BOOL=TRUE" + "-DVTK_USE_SYSTEM_EIGEN:BOOL=TRUE" + "-DVTK_USE_SYSTEM_EXPAT:BOOL=TRUE" + "-DVTK_USE_SYSTEM_FREETYPE:BOOL=TRUE" + "-DVTK_USE_SYSTEM_GL2PS:BOOL=TRUE" + "-DVTK_USE_SYSTEM_GLEW:BOOL=TRUE" + "-DVTK_USE_SYSTEM_HDF5:BOOL=TRUE" + "-DVTK_USE_SYSTEM_JPEG:BOOL=TRUE" + "-DVTK_USE_SYSTEM_JSONCPP:BOOL=TRUE" + "-DVTK_USE_SYSTEM_LIBPROJ:BOOL=TRUE" + "-DVTK_USE_SYSTEM_LIBXML2:BOOL=TRUE" + "-DVTK_USE_SYSTEM_LZ4:BOOL=TRUE" + "-DVTK_USE_SYSTEM_NETCDF:BOOL=TRUE" + "-DVTK_USE_SYSTEM_PNG:BOOL=TRUE" + ;"-DVTK_USE_SYSTEM_PUGIXML:BOOL=TRUE" ; breaks IO/CityGML + "-DVTK_USE_SYSTEM_SQLITE:BOOL=TRUE" + "-DVTK_USE_SYSTEM_THEORA:BOOL=TRUE" + "-DVTK_USE_SYSTEM_TIFF:BOOL=TRUE" + "-DVTK_USE_SYSTEM_ZLIB:BOOL=TRUE") + #:tests? #f)) ;XXX: test data not included (inputs - `(("jsoncpp" ,jsoncpp-for-tensorflow) - ,@(alist-delete "jsoncpp" (package-inputs vtk)))))) + `(("double-conversion" ,double-conversion) + ("eigen" ,eigen) + ("expat" ,expat) + ("freetype" ,freetype) + ("gl2ps" ,gl2ps) + ("glew" ,glew) + ("glu" ,glu) + ("hdf5" ,hdf5) + ("jpeg" ,libjpeg-turbo) + ("jsoncpp" ,jsoncpp) + ;("libogg" ,libogg) + ("libtheora" ,libtheora) + ("libX11" ,libx11) + ("libxml2" ,libxml2) + ("libXt" ,libxt) + ("lz4" ,lz4) + ("mesa" ,mesa) + ("netcdf" ,netcdf) + ("png" ,libpng) + ("proj" ,proj.4) + ;("pugixml" ,pugixml) + ("sqlite" ,sqlite) + ("tiff" ,libtiff) + ("xorgproto" ,xorgproto) + ("zlib" ,zlib))) + (home-page "https://vtk.org/") + (synopsis "Libraries for 3D computer graphics") + (description + "The Visualization Toolkit (VTK) is a C++ library for 3D computer graphics, +image processing and visualization. It supports a wide variety of +visualization algorithms including: scalar, vector, tensor, texture, and +volumetric methods; and advanced modeling techniques such as: implicit +modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay +triangulation. VTK has an extensive information visualization framework, has +a suite of 3D interaction widgets, supports parallel processing, and +integrates with various databases on GUI toolkits such as Qt and Tk.") + (license license:bsd-3))) ;; itksnap needs an older variant of VTK. (define-public vtk-6 diff --git a/gnu/packages/patches/vtk-8-fix-freetypetools-build-failure.patch b/gnu/packages/patches/vtk-8-fix-freetypetools-build-failure.patch new file mode 100644 index 0000000000..6988e65872 --- /dev/null +++ b/gnu/packages/patches/vtk-8-fix-freetypetools-build-failure.patch @@ -0,0 +1,36 @@ +This fixes a build failure in VTK when building against recent versions +of freetype. + + https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7432 + +Patch by Ben Boeckel + +Subject: [PATCH] vtkFreeTypeTools: avoid using an internal macro + +This macro has been removed upstream as it was always intended to be +private. +--- + Rendering/FreeType/vtkFreeTypeTools.cxx | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/Rendering/FreeType/vtkFreeTypeTools.cxx b/Rendering/FreeType/vtkFreeTypeTools.cxx +index c54289dc60..03b899c4da 100644 +--- a/Rendering/FreeType/vtkFreeTypeTools.cxx ++++ b/Rendering/FreeType/vtkFreeTypeTools.cxx +@@ -387,11 +387,8 @@ FTC_CMapCache* vtkFreeTypeTools::GetCMapCache() + } + + //---------------------------------------------------------------------------- +-FT_CALLBACK_DEF(FT_Error) +-vtkFreeTypeToolsFaceRequester(FTC_FaceID face_id, +- FT_Library lib, +- FT_Pointer request_data, +- FT_Face* face) ++static FT_Error vtkFreeTypeToolsFaceRequester( ++ FTC_FaceID face_id, FT_Library lib, FT_Pointer request_data, FT_Face* face) + { + #if VTK_FTFC_DEBUG_CD + printf("vtkFreeTypeToolsFaceRequester()\n"); +-- +2.30.1 + -- cgit v1.2.3 From 9bfc4a81870b83dc8bb066d73d0cdd48e74e1aa3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 8 Jul 2021 18:56:56 +0200 Subject: gnu: python-seaborn: Update to 0.11.1. * gnu/packages/patches/python-seaborn-kde-test.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/python-xyz.scm (python-seaborn): Use it, and update to 0.11.1. --- gnu/local.mk | 1 + gnu/packages/patches/python-seaborn-kde-test.patch | 36 ++++++++++++++++++++++ gnu/packages/python-xyz.scm | 5 +-- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/python-seaborn-kde-test.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 09a9965c19..1504490c94 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1633,6 +1633,7 @@ dist_patch_DATA = \ %D%/packages/patches/python2-pygobject-2-deprecation.patch \ %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \ %D%/packages/patches/python-robotframework-source-date-epoch.patch \ + %D%/packages/patches/python-seaborn-kde-test.patch \ %D%/packages/patches/python2-subprocess32-disable-input-test.patch \ %D%/packages/patches/python-unittest2-python3-compat.patch \ %D%/packages/patches/python-unittest2-remove-argparse.patch \ diff --git a/gnu/packages/patches/python-seaborn-kde-test.patch b/gnu/packages/patches/python-seaborn-kde-test.patch new file mode 100644 index 0000000000..f300dffc6f --- /dev/null +++ b/gnu/packages/patches/python-seaborn-kde-test.patch @@ -0,0 +1,36 @@ +This patch is an excerpt of this upstream commit: + + commit 0a24478a550132f1882e5be5f5dbc0fc446a8a6c + Author: Michael Waskom + Date: Mon Dec 21 18:44:58 2020 -0500 + + Raise minimal supported Python to 3.7 and bump requirements (#2396) + +It fixes the failure of 'test_weights'. + +--- a/seaborn/tests/test_distributions.py ++++ b/seaborn/tests/test_distributions.py +@@ -709,21 +708,17 @@ class TestKDEPlotUnivariate: + integral = integrate.trapz(ydata, np.log10(xdata)) + assert integral == pytest.approx(1) + +- @pytest.mark.skipif( +- LooseVersion(scipy.__version__) < "1.2.0", +- reason="Weights require scipy >= 1.2.0" +- ) + def test_weights(self): + + x = [1, 2] + weights = [2, 1] + +- ax = kdeplot(x=x, weights=weights) ++ ax = kdeplot(x=x, weights=weights, bw_method=.1) + + xdata, ydata = ax.lines[0].get_xydata().T + +- y1 = ydata[np.argwhere(np.abs(xdata - 1).min())] +- y2 = ydata[np.argwhere(np.abs(xdata - 2).min())] ++ y1 = ydata[np.abs(xdata - 1).argmin()] ++ y2 = ydata[np.abs(xdata - 2).argmin()] + + assert y1 == pytest.approx(2 * y2) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 7a522853ff..181729b2bb 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -8800,13 +8800,14 @@ SVG, EPS, PNG and terminal output.") (define-public python-seaborn (package (name "python-seaborn") - (version "0.10.0") + (version "0.11.1") (source (origin (method url-fetch) (uri (pypi-uri "seaborn" version)) (sha256 - (base32 "1ffbms4kllihfycf6j57dziq4imgdjw03sqgifh5wzcd2d743zjr")))) + (base32 "1b81p9s6li3b606ivgbynrh102fclwlw74m8qxzsii9pv6p8xrs4")) + (patches (search-patches "python-seaborn-kde-test.patch")))) (build-system python-build-system) (arguments `(#:phases -- cgit v1.2.3 From d0ccdd707d42e978eeeb55612398c92889e3ebb1 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Fri, 25 Jun 2021 13:25:05 +0800 Subject: gnu: Add emacs-telega-server. * gnu/packages/emacs-xyz.scm (emacs-telega-server): New variable. * gnu/packages/patches/emacs-telega-path-placeholder.patch: New file. * gnu/package/patches/emacs-telega-patch-server-functions.patch: Remove stale patch. * gnu/local.mk (dist_patch_DATA): Update accordingly. Signed-off-by: Leo Prikler --- gnu/local.mk | 2 +- gnu/packages/emacs-xyz.scm | 55 +++++++++++++++++++++- .../emacs-telega-patch-server-functions.patch | 31 ------------ .../patches/emacs-telega-path-placeholder.patch | 44 +++++++++++++++++ 4 files changed, 99 insertions(+), 33 deletions(-) delete mode 100644 gnu/packages/patches/emacs-telega-patch-server-functions.patch create mode 100644 gnu/packages/patches/emacs-telega-path-placeholder.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 1504490c94..e5eebef7c0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -988,7 +988,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-hyperbole-toggle-messaging.patch \ %D%/packages/patches/emacs-libgit-use-system-libgit2.patch \ %D%/packages/patches/emacs-source-date-epoch.patch \ - %D%/packages/patches/emacs-telega-patch-server-functions.patch \ + %D%/packages/patches/emacs-telega-path-placeholder.patch \ %D%/packages/patches/emacs-telega-test-env.patch \ %D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch \ %D%/packages/patches/enjarify-setup-py.patch \ diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index e4ef3884e8..1a749a05e8 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -81,7 +81,7 @@ ;;; Copyright © 2020, 2021 Niklas Eklund ;;; Copyright © 2020 Marco Grassi ;;; Copyright © 2020 Tomás Ortín Fernández -;;; Copyright © 2020 Zhu Zihao +;;; Copyright © 2020, 2021 Zhu Zihao ;;; Copyright © 2020 Adam Kandur ;;; Copyright © 2020 Tim Howes ;;; Copyright © 2020 Noah Landis @@ -146,6 +146,7 @@ #:use-module (gnu packages djvu) #:use-module (gnu packages ebook) #:use-module (gnu packages emacs) + #:use-module (gnu packages freedesktop) #:use-module (gnu packages golang) #:use-module (gnu packages guile) #:use-module (gnu packages gtk) @@ -26219,6 +26220,58 @@ fish-completion. It can be used in both Eshell and M-x shell.") other @code{helm-type-file} sources such as @code{helm-locate}.") (license license:gpl3+))) +(define-public emacs-telega-server + (package + (name "emacs-telega-server") + (version "0.7.024") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/zevlg/telega.el") + (commit (string-append "v" version)))) + (sha256 + (base32 "1ra04cp49zzx8vy8aswd00l46ixyc44sxh1s3nw880b4ywzxmc6j")) + (file-name (git-file-name "emacs-telega" version)) + (patches + (search-patches "emacs-telega-path-placeholder.patch" + "emacs-telega-test-env.patch")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'enter-subdirectory + (lambda _ (chdir "server") #t)) + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "Makefile" + (("CC=cc") ,(string-append "CC=" (cc-for-target))) + (("^(INSTALL_PREFIX=).*$" _all prefix) + (string-append prefix out "/bin\n"))) + + (substitute* "run_tests.py" + (("^(TELEGA_SERVER = ).*$" _all prefix) + (string-append prefix + "\"" out "/bin/telega-server\"\n")))))) + (delete 'check) + (add-after 'install 'check + (assoc-ref %standard-phases 'check)) + (add-before 'install-license-files 'leave-subdirectory + (lambda _ (chdir "..") #t))) + #:test-target "test")) + (inputs + `(("tdlib" ,tdlib) + ("libappindicator" ,libappindicator))) + (native-inputs + `(("python" ,python) + ("pkg-config" ,pkg-config))) + (home-page "https://zevlg.github.io/telega.el/") + (synopsis "Server process of Telega") + (description "Telega-server is helper program to interact with Telegram +service, and connect it with Emacs via inter-process communication.") + (license license:gpl3+))) + (define-public emacs-telega ;; This package has versions newer than indicated on MELPA. ;; Get the current version from `telega-version` in telega.el. diff --git a/gnu/packages/patches/emacs-telega-patch-server-functions.patch b/gnu/packages/patches/emacs-telega-patch-server-functions.patch deleted file mode 100644 index e3d49278d0..0000000000 --- a/gnu/packages/patches/emacs-telega-patch-server-functions.patch +++ /dev/null @@ -1,31 +0,0 @@ -Remove interactive build for telega-server, as it fails on Guix. -Modify the `telega-server--find-bin' function to only use the version -of telega-server installed by Guix. - -Created by Brett Gilio - ---- a/telega-server.el -+++ b/telega-server.el -@@ -113,7 +113,6 @@ If already deferring, then just executes the BODY." - If BUILD-FLAGS is specified, then rebuild server without any - queries using this flags for building, could be empty string. - Otherwise query user about building flags." -- (interactive) - (telega-test-env 'quiet) - (when (or build-flags - (y-or-n-p "Build `telega-server'? ")) -@@ -137,11 +136,8 @@ Otherwise query user about building flags." - (defun telega-server--find-bin () - "Find telega-server executable. - Raise error if not found." -- (let ((exec-path (cons telega-directory exec-path))) -- (or (executable-find "telega-server") -- (progn (telega-server-build) -- (executable-find "telega-server")) -- (error "`telega-server' not found in exec-path")))) -+ (or (executable-find "telega-server") -+ (error "`telega-server' not found in exec-path"))) - - (defun telega-server-version () - "Return telega-server version." - diff --git a/gnu/packages/patches/emacs-telega-path-placeholder.patch b/gnu/packages/patches/emacs-telega-path-placeholder.patch new file mode 100644 index 0000000000..c20be36712 --- /dev/null +++ b/gnu/packages/patches/emacs-telega-path-placeholder.patch @@ -0,0 +1,44 @@ +From 865b8c553722a971c68742c2e849e41eb0e2360c Mon Sep 17 00:00:00 2001 +From: Zhu Zihao +Date: Thu, 24 Jun 2021 23:43:50 +0800 +Subject: [PATCH] Replace code that search path with placeholder for + configuration. + +--- + telega-server.el | 6 +----- + telega-util.el | 2 +- + 2 files changed, 2 insertions(+), 6 deletions(-) + +diff --git a/telega-server.el b/telega-server.el +index 999125d..0fa0817 100644 +--- a/telega-server.el ++++ b/telega-server.el +@@ -142,11 +142,7 @@ Otherwise query user about building flags." + (defun telega-server--find-bin () + "Find telega-server executable. + Raise error if not found." +- (let ((exec-path (cons telega-directory exec-path))) +- (or (executable-find "telega-server") +- (progn (telega-server-build) +- (executable-find "telega-server")) +- (error "`telega-server' not found in exec-path")))) ++ "@TELEGA_SERVER_BIN@") + + (defun telega-server-version () + "Return telega-server version." +diff --git a/telega-util.el b/telega-util.el +index 73a46b1..f53e20a 100644 +--- a/telega-util.el ++++ b/telega-util.el +@@ -464,7 +464,7 @@ N can't be 0." + + (defun telega-etc-file (filename) + "Return absolute path to FILENAME from etc/ directory in telega." +- (expand-file-name (concat "etc/" filename) telega--lib-directory)) ++ (concat "@TELEGA_SHARE@" "/" filename)) + + (defun telega-link-props (link-type link-to &optional face) + "Generate props for link button openable with `telega-link--button-action'." +-- +2.32.0 + -- cgit v1.2.3 From c881516d4834cc628864bfc193cfb061c3dcde42 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 9 Jul 2021 00:22:19 -0400 Subject: gnu: proot: Update to 5.2.0-alpha. This allows proot to be built for aarch64-linux and armhf-linux. * gnu/packages/patches/proot-test-fhs.patch: Delete patch. * gnu/local.mk (dist_patch_DATA): Un-register it. * gnu/packages/linux.scm: Update to 5.2.0-alpha. [patches]: Remove field. [supported-system]: New field. [tests?]: Disable for ARM-based systems. [phases]{fix-fhs-assumptions-in-tests, set-shell-file-name}: Combine into... {patch-sources}: ... this new phase. {build-manpage}: New phase. {check}: Add seccomp issue URL in comment. [native-inputs]: Add coreutils issue URL in comment. Add pkg-config and python-docutils. [inputs]: Add libarchive. --- gnu/local.mk | 1 - gnu/packages/linux.scm | 114 ++++++++++++++++++++---------- gnu/packages/patches/proot-test-fhs.patch | 98 ------------------------- 3 files changed, 77 insertions(+), 136 deletions(-) delete mode 100644 gnu/packages/patches/proot-test-fhs.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index e5eebef7c0..9a3d8f6eca 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1578,7 +1578,6 @@ dist_patch_DATA = \ %D%/packages/patches/procmail-ambiguous-getline-debian.patch \ %D%/packages/patches/procmail-CVE-2014-3618.patch \ %D%/packages/patches/procmail-CVE-2017-16844.patch \ - %D%/packages/patches/proot-test-fhs.patch \ %D%/packages/patches/psm-arch.patch \ %D%/packages/patches/psm-disable-memory-stats.patch \ %D%/packages/patches/psm-ldflags.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 645b282ccf..90e7fa69d1 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -163,7 +163,8 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-2) #:use-module (srfi srfi-26) - #:use-module (ice-9 match)) + #:use-module (ice-9 match) + #:use-module (ice-9 regex)) (define-public (system->linux-architecture arch) "Return the Linux architecture name for ARCH, a Guix system name such as @@ -6810,7 +6811,9 @@ userspace queueing component and the logging subsystem.") (define-public proot (package (name "proot") - (version "5.1.0") + ;; The last stable release was made in 2015, and fails to build for + ;; the aarch64 platform. + (version "5.2.0-alpha") (source (origin (method git-fetch) @@ -6819,30 +6822,33 @@ userspace queueing component and the logging subsystem.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz")) - (patches (search-patches "proot-test-fhs.patch")))) + (base32 "09vp806y4hqfq2fn2hpi873rh4j6a3c572ph4mkirx1n32wj8srl")))) (build-system gnu-build-system) - (arguments - '(#:make-flags '("-C" "src") + ;; The powerpc64le-linux and mips64el-linux architectures are not + ;; supported (see: + ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51). + (supported-systems '("x86_64-linux" "i686-linux" + "armhf-linux" "aarch64-linux" "i586-gnu")) + (arguments + ;; Disable the test suite on ARM platforms, as there are too many + ;; failures to keep track of (see for example: + ;; https://github.com/proot-me/proot/issues/263). + `(#:tests? ,(not (string-match "^(arm|aarch64)" + (or (%current-target-system) + (%current-system)))) + #:make-flags '("-C" "src") #:phases (modify-phases %standard-phases - (delete 'configure) - (add-before 'build 'set-shell-file-name + (add-after 'unpack 'patch-sources (lambda* (#:key inputs #:allow-other-keys) (substitute* (find-files "src" "\\.[ch]$") (("\"/bin/sh\"") - (string-append "\"" - (assoc-ref inputs "bash") - "/bin/sh\""))))) - (add-before 'check 'fix-fhs-assumptions-in-tests - (lambda _ - (substitute* "tests/test-c6b77b77.mk" - (("/bin/bash") (which "bash")) - (("/usr/bin/test") (which "test"))) - (substitute* '("tests/test-16573e73.c") - (("/bin/([a-z-]+)" _ program) - (which program))) + (string-append "\"" (assoc-ref inputs "bash") + "/bin/sh\""))) + + (substitute* "src/GNUmakefile" + (("/bin/echo") (which "echo"))) - (substitute* (find-files "tests" "\\.sh$") + (substitute* (find-files "test" "\\.sh$") ;; Some of the tests try to "bind-mount" /bin/true. (("-b /bin/true:") (string-append "-b " (which "true") ":")) @@ -6852,27 +6858,63 @@ userspace queueing component and the logging subsystem.") (("/bin/sh") (which "sh")) ;; Others assume /etc/fstab exists. (("/etc/fstab") "/etc/passwd")) - - (substitute* "tests/GNUmakefile" + (substitute* "test/GNUmakefile" (("-b /bin:") "-b /gnu:")) + (substitute* "test/test-c6b77b77.mk" + (("/bin/bash") (which "bash")) + (("/usr/bin/test") (which "test"))) + (substitute* "test/test-16573e73.c" + (("/bin/([a-z-]+)" _ program) + (which program))) + (substitute* "test/test-d2175fc3.sh" + (("\\^/bin/true\\$") "$(which true)")) + (substitute* "test/test-5467b986.sh" + (("-w /usr") "-w /gnu") + (("-w usr") "-w gnu") + (("/usr/share") "/gnu/store") + (("share") "store")) + (substitute* "test/test-092c5e26.sh" + (("-q echo ") + "-q $(which echo) ")) + + ;; The following tests are known to fail (see: + ;; https://github.com/proot-me/proot/issues/184). + (delete-file "test/test-0228fbe7.sh") + (delete-file "test/test-2db65cd2.sh") + + ;; This one fails with "bind: Address already in use" + ;; (see: https://github.com/proot-me/proot/issues/260). + (delete-file "test/test-ssssssss.c") + + ;; This one fails on a waitpid call that returns 1 (see: + ;; https://github.com/proot-me/proot/issues/261). + (delete-file "test/test-ptrace01.c") ;; XXX: This test fails in an obscure corner case, just ;; skip it. - (delete-file "tests/test-kkkkkkkk.c"))) + (delete-file "test/test-kkkkkkkk.c") + + ;; The socket tests requires networking. + (for-each delete-file + (find-files "test" "test-socket.*\\.sh$")))) + (delete 'configure) + (add-after 'build 'build-manpage + (lambda _ + (with-directory-excursion "doc" + (invoke "make" "proot/man.1" "SUFFIX=.py")))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? (let ((n (parallel-job-count))) - ;; For some reason we get lots of segfaults with - ;; seccomp support (x86_64, Linux-libre 4.11.0). + ;; There are lots of segfaults with seccomp support + ;; (x86_64, Linux-libre 4.11.0) (see: + ;; https://github.com/proot-me/proot/issues/106). (setenv "PROOT_NO_SECCOMP" "1") - ;; Most of the tests expect "/bin" to be in $PATH so ;; they can run things that live in $ROOTFS/bin. (setenv "PATH" (string-append (getenv "PATH") ":/bin")) - - (invoke "make" "check" "-C" "tests" + (invoke "make" "check" "-C" "test" ;;"V=1" "-j" (number->string n)))))) (replace 'install @@ -6884,24 +6926,22 @@ userspace queueing component and the logging subsystem.") ;; build currently.) (invoke "make" "-C" "src" "install" (string-append "PREFIX=" out)) - (mkdir-p man1) (copy-file "doc/proot/man.1" (string-append man1 "/proot.1")))))))) (native-inputs `(("which" ,which) - ;; For 'mcookie', used by some of the tests. ("util-linux" ,util-linux) - ;; XXX: Choose the old coreutils because its 'stat' ;; program does not use statx(2) when running 'stat -c - ;; %a' or similar, which PRoot doesn't properly support. + ;; %a' or similar, which PRoot doesn't properly support + ;; (see: https://github.com/proot-me/proot/issues/262). ("coreutils-old" ,coreutils-8.30) - - ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads - ;; make 4.3 to segfault. - ("make-old" ,gnu-make-4.2))) - (inputs `(("talloc" ,talloc))) + ("pkg-config" ,pkg-config) + ;; For rst2man, used to generate the manual page. + ("python-docutils" ,python-docutils))) + (inputs `(("libarchive" ,libarchive) + ("talloc" ,talloc))) (home-page "https://github.com/proot-me/PRoot") (synopsis "Unprivileged chroot, bind mount, and binfmt_misc") (description diff --git a/gnu/packages/patches/proot-test-fhs.patch b/gnu/packages/patches/proot-test-fhs.patch deleted file mode 100644 index d3896addd6..0000000000 --- a/gnu/packages/patches/proot-test-fhs.patch +++ /dev/null @@ -1,98 +0,0 @@ -The test suite of PRoot makes many FHS assumptions, such as assuming -that /bin, /bin/true, and /usr exist. This patch fixes these assumptions. - ---- source/tests/GNUmakefile 2017-05-11 15:26:36.899115484 +0200 -+++ source/tests/GNUmakefile 2017-05-11 15:26:46.143063166 +0200 -@@ -121,7 +121,7 @@ $(ROOTFS_DIR): - setup: $(ROOTFS_BIN) - - $(ROOTFS)/bin/abs-true: -- @ln -fs /bin/true $@ -+ @ln -fs `which true` $@ - - $(ROOTFS)/bin/rel-true: - @ln -fs ./true $@ - ---- source/tests/test-d2175fc3.sh 2017-05-11 15:36:53.727617010 +0200 -+++ source/tests/test-d2175fc3.sh 2017-05-11 15:37:10.155523637 +0200 -@@ -2,8 +2,8 @@ if [ ! -x ${ROOTFS}/bin/readlink ] || [ - exit 125; - fi - --${PROOT} -r ${ROOTFS} /bin/readlink /bin/abs-true | grep '^/bin/true$' -+${PROOT} -r ${ROOTFS} /bin/readlink /bin/abs-true | grep "`which true`" - ${PROOT} -r ${ROOTFS} /bin/readlink /bin/rel-true | grep '^\./true$' - --${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/abs-true | grep '^/bin/true$' -+${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/abs-true | grep "`which true`" - ${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/rel-true | grep '^./true$' - ---- source/tests/test-d1be631a.sh 2017-05-11 15:41:36.458008715 +0200 -+++ source/tests/test-d1be631a.sh 2017-05-11 15:41:38.921994686 +0200 -@@ -1,4 +1,4 @@ --if [ -z `which mknod`] || [ `id -u` -eq 0 ]; then -+if [ -z `which mknod` ] || [ `id -u` -eq 0 ]; then - exit 125; - fi - ---- source/tests/test-5bed7141.c 2017-05-11 15:34:23.088472743 +0200 -+++ source/tests/test-5bed7141.c 2017-05-11 15:34:27.052450235 +0200 -@@ -80,7 +80,7 @@ int main(int argc, char *argv[]) - exit(EXIT_FAILURE); - - case 0: /* child */ -- status = chdir("/usr"); -+ status = chdir("/gnu"); - if (status < 0) { - perror("chdir"); - exit(EXIT_FAILURE); - ---- a/tests/test-092c5e26.sh -+++ b/tests/test-092c5e26.sh -@@ -24,7 +24,7 @@ fi - - unset LD_LIBRARY_PATH - --env PROOT_FORCE_FOREIGN_BINARY=1 PATH=/tmp:/bin:/usr/bin ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$" -+env PROOT_FORCE_FOREIGN_BINARY=1 PATH=/tmp:/bin:/usr/bin:$(dirname $(which echo)) ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$" - env PROOT_FORCE_FOREIGN_BINARY=1 ${PROOT} -r ${ROOTFS} -q echo ${TMP_ABS} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$" - - cat > ${ROOTFS}/${TMP_ABS} < Date: Fri, 16 Jul 2021 00:03:40 -0400 Subject: gnu: Add ark. * gnu/packages/kde-utils.scm (ark): New variable. * gnu/packages/patches/ark-skip-xar-test.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Modified-by: Maxim Cournoyer Signed-off-by: Maxim Cournoyer --- gnu/local.mk | 1 + gnu/packages/kde-utils.scm | 80 ++++++++++++++++++++++++++++ gnu/packages/patches/ark-skip-xar-test.patch | 44 +++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 gnu/packages/patches/ark-skip-xar-test.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 9a3d8f6eca..3f132672c8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -817,6 +817,7 @@ dist_patch_DATA = \ %D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch \ %D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch \ %D%/packages/patches/apr-skip-getservbyname-test.patch \ + %D%/packages/patches/ark-skip-xar-test.patch \ %D%/packages/patches/aspell-default-dict-dir.patch \ %D%/packages/patches/ath9k-htc-firmware-binutils.patch \ %D%/packages/patches/ath9k-htc-firmware-gcc.patch \ diff --git a/gnu/packages/kde-utils.scm b/gnu/packages/kde-utils.scm index 9b31ac2d9f..b5638876d5 100644 --- a/gnu/packages/kde-utils.scm +++ b/gnu/packages/kde-utils.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2019 Hartmut Goebel ;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice +;;; Copyright © 2021 Z572 <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +23,9 @@ #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) + #:use-module (gnu packages) + #:use-module (gnu packages backup) + #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages gnome) #:use-module (gnu packages imagemagick) @@ -33,6 +37,82 @@ #:use-module (gnu packages samba) #:use-module (gnu packages xorg)) +(define-public ark + (package + (name "ark") + (version "20.04.1") + (source (origin + (method url-fetch) + (uri (string-append "mirror://kde/stable/release-service/" version + "/src/ark-" version ".tar.xz")) + (sha256 + (base32 + "0g5bfa1lc7mhrc2ngd4ldf33dpwr7gqrj95kp897pf632wwj23iw")) + ;; The libarchive package in Guix does not support + ;; xar; disable related tests. + (patches (search-patches "ark-skip-xar-test.patch")))) + (build-system qt-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'check 'start-xserver + ;; adddialogtest requires DISPLAY. + (lambda* (#:key inputs #:allow-other-keys) + (let ((xorg-server (assoc-ref inputs "xorg-server"))) + (setenv "HOME" (getcwd)) + (system (format #f "~a/bin/Xvfb :1 &" xorg-server)) + (setenv "DISPLAY" ":1")))) + (add-after 'install 'wrap-executable + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lrzip (assoc-ref inputs "lrzip")) + (lzop (assoc-ref inputs "lzop")) + (p7zip (assoc-ref inputs "p7zip")) + (unzip (assoc-ref inputs "unzip")) + (zip (assoc-ref inputs "zip")) + (zstd (assoc-ref inputs "zstd"))) + (wrap-program (string-append out "/bin/ark") + `("PATH" suffix + ,(map (lambda (p) + (string-append p "/bin")) + (list lrzip lzop p7zip unzip zip zstd)))))))))) + (native-inputs + `(("extra-cmake-modules" ,extra-cmake-modules) + ("pkg-config" ,pkg-config) + ("kdoctools" ,kdoctools) + ("xorg-server" ,xorg-server))) + (inputs + `(("breeze-icons" ,breeze-icons) + ("karchive" ,karchive) + ("kconfig" ,kconfig) + ("kcrash" ,kcrash) + ("kdbusaddons" ,kdbusaddons) + ("khtml" ,khtml) + ("ki18n" ,ki18n) + ("kio" ,kio) + ("kitemmodels" ,kitemmodels) + ("kparts" ,kparts) + ("kpty" ,kpty) + ("kservice" ,kservice) + ("kwidgetsaddons" ,kwidgetsaddons) + ("libarchive" ,libarchive) + ("libzip" ,libzip) + ("qtbase" ,qtbase-5) + ("zlib" ,zlib) + ;; Command line tools used by Ark. + ("lrzip" ,lrzip) + ("lzop" ,lzop) + ("p7zip" ,p7zip) + ("unzip" ,unzip) + ("zip" ,zip) + ("zstd" ,zstd))) + (home-page "https://apps.kde.org/en/ark") + (synopsis "Graphical archiving tool") + (description "Ark is a graphical file compression/decompression utility +with support for multiple formats, including tar, gzip, bzip2, rar and zip, as +well as CD-ROM images.") + (license license:gpl2+))) + (define-public kate (package (name "kate") diff --git a/gnu/packages/patches/ark-skip-xar-test.patch b/gnu/packages/patches/ark-skip-xar-test.patch new file mode 100644 index 0000000000..525201997b --- /dev/null +++ b/gnu/packages/patches/ark-skip-xar-test.patch @@ -0,0 +1,44 @@ +Guix libarchive no support xar. + +--- ark-20.04.1.orig/autotests/kerfuffle/loadtest.cpp 2020-12-23 08:46:15.780782601 +0800 ++++ ark-20.04.1/autotests/kerfuffle/loadtest.cpp 2020-12-23 11:13:17.101724042 +0800 +@@ -181,13 +181,6 @@ + qDebug() << "lz4 executable not found in path. Skipping lz4 test."; + } + +- QTest::newRow("xar archive") +- << QFINDTESTDATA("data/simplearchive.xar") +- << QStringLiteral("simplearchive") +- << true << false << false << false << false << 0 << Archive::Unencrypted +- << QStringLiteral("simplearchive") +- << QString(); +- + QTest::newRow("mimetype child of application/zip") + << QFINDTESTDATA("data/test.odt") + << QStringLiteral("test") +--- ark-20.04.1.orig/autotests/kerfuffle/extracttest.cpp 2020-12-23 08:46:15.780782601 +0800 ++++ ark-20.04.1/autotests/kerfuffle/extracttest.cpp 2020-12-23 11:14:02.801809620 +0800 +@@ -350,23 +350,6 @@ + qDebug() << "lz4 executable not found in path. Skipping lz4 test."; + } + +- archivePath = QFINDTESTDATA("data/simplearchive.xar"); +- QTest::newRow("extract selected entries from a xar archive without path") +- << archivePath +- << QVector { +- new Archive::Entry(this, QStringLiteral("dir1/file11.txt"), QString()), +- new Archive::Entry(this, QStringLiteral("file4.txt"), QString()) +- } +- << optionsNoPaths +- << 2; +- +- archivePath = QFINDTESTDATA("data/simplearchive.xar"); +- QTest::newRow("extract all entries from a xar archive with path") +- << archivePath +- << QVector() +- << optionsPreservePaths +- << 6; +- + archivePath = QFINDTESTDATA("data/hello-1.0-x86_64.AppImage"); + QTest::newRow("extract all entries from an AppImage with path") + << archivePath -- cgit v1.2.3 From 9cb35c02164d929fcb8929e7f454df215df8cf25 Mon Sep 17 00:00:00 2001 From: Justin Veilleux Date: Fri, 16 Jul 2021 12:01:41 -0400 Subject: gnu: Add transmission-remote-gtk. * gnu/packages/bittorrent.scm (transmission-remote-gtk): New variable. * gnu/packages/patches/transmission-remote-gtk-fix-appstream.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Co-authored-by: Leo Famulari --- gnu/local.mk | 1 + gnu/packages/bittorrent.scm | 32 ++++++++++++ .../transmission-remote-gtk-fix-appstream.patch | 61 ++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 gnu/packages/patches/transmission-remote-gtk-fix-appstream.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 3f132672c8..62a5e41a46 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1762,6 +1762,7 @@ dist_patch_DATA = \ %D%/packages/patches/tlf-support-hamlib-4.2+.patch \ %D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/transmission-honor-localedir.patch \ + %D%/packages/patches/transmission-remote-gtk-fix-appstream.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ %D%/packages/patches/tup-unbundle-dependencies.patch \ %D%/packages/patches/tuxpaint-stamps-path.patch \ diff --git a/gnu/packages/bittorrent.scm b/gnu/packages/bittorrent.scm index 0ca60d607c..e17e04dcfe 100644 --- a/gnu/packages/bittorrent.scm +++ b/gnu/packages/bittorrent.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019, 2020 Brett Gilio ;;; Copyright © 2020 Hartmut Goebel +;;; Copyright © 2021 Justin Veilleux ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,6 +39,7 @@ #:use-module (guix utils) #:use-module (gnu packages) #:use-module (gnu packages adns) + #:use-module (gnu packages autotools) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -45,6 +47,7 @@ #:use-module (gnu packages curl) #:use-module (gnu packages cyrus-sasl) #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gettext) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gnupg) @@ -138,6 +141,35 @@ DHT, µTP, PEX and Magnet Links.") ;; A few files files carry an MIT/X11 license header. (license (list l:gpl2 l:gpl3)))) +(define-public transmission-remote-gtk + (package + (name "transmission-remote-gtk") + (version "1.4.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/transmission-remote-gtk/" + "transmission-remote-gtk/releases/download/" + version "/transmission-remote-gtk-" version + ".tar.xz")) + (patches (search-patches "transmission-remote-gtk-fix-appstream.patch")) + (sha256 + (base32 "1aqjl5rgamgcgqvcldd1gzyfh2xci0m7070924d6vz2qln0q75sr")))) + (build-system gnu-build-system) + (native-inputs + `(("gettext" ,gnu-gettext) + ("pkg-config" ,pkg-config))) + (inputs + `(("appstream-glib" ,appstream-glib) + ("curl" ,curl) + ("gtk+" ,gtk+) + ("json-glib" ,json-glib))) + (synopsis "Gtk frontend to the Transmission daemon") + (description "transmission-remote-gtk is a GTK client for remote management +of the Transmission BitTorrent client, using its HTTP RPC protocol.") + (home-page "https://github.com/transmission-remote-gtk/transmission-remote-gtk") + (license l:gpl2+))) + (define-public libtorrent (package (name "libtorrent") diff --git a/gnu/packages/patches/transmission-remote-gtk-fix-appstream.patch b/gnu/packages/patches/transmission-remote-gtk-fix-appstream.patch new file mode 100644 index 0000000000..e7d4c8bb86 --- /dev/null +++ b/gnu/packages/patches/transmission-remote-gtk-fix-appstream.patch @@ -0,0 +1,61 @@ +Fix a bug related to AppStream: + +https://github.com/transmission-remote-gtk/transmission-remote-gtk/issues/95 + +Patch adapted from upstream source repository: + +https://github.com/transmission-remote-gtk/transmission-remote-gtk/commit/89259ff90c703c7fe6768b5317803b9aa5b5ab8c + +From 89259ff90c703c7fe6768b5317803b9aa5b5ab8c Mon Sep 17 00:00:00 2001 +From: Alan +Date: Tue, 17 Nov 2020 01:26:22 +0000 +Subject: [PATCH] fix screenshot and add OARS rating so appdata validates + +--- + README.md | 5 ++--- + data/io.github.TransmissionRemoteGtk.appdata.xml.in | 5 +++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/README.md b/README.md +index 4306cc7..d38314b 100644 +--- a/README.md ++++ b/README.md +@@ -6,13 +6,12 @@ the Transmission BitTorrent client, using its HTTP RPC protocol. + + # DEPENDENCIES + +-The following packages are required dependencies: ++The following packages are required dependencies (debian/ubuntu). + + ```bash +-autoconf-archive appstream-glib intltool ++libgtk-3-dev automake autoconf gcc libgeoip-dev gettext autoconf-archive libappstream-dev appstream-util libcurl4-openssl-dev libjson-glib-dev + ``` + +- + # BUILDING + + Optionally install `libgeoip` and its headers to see the country +diff --git a/data/io.github.TransmissionRemoteGtk.appdata.xml.in b/data/io.github.TransmissionRemoteGtk.appdata.xml.in +index fc35a8f..1476c2a 100644 +--- a/data/io.github.TransmissionRemoteGtk.appdata.xml.in ++++ b/data/io.github.TransmissionRemoteGtk.appdata.xml.in +@@ -7,6 +7,7 @@ + transmission-remote-gtk + Transmission Remote + Transmission Remote Gtk Team ++ + Remotely manage the Transmission BitTorrent client + https://github.com/transmission-remote-gtk/transmission-remote-gtk + https://github.com/transmission-remote-gtk/transmission-remote-gtk/issues +@@ -23,8 +24,8 @@ + + + +- +- http://eth0.org.uk/~alan/transmission-remote-gtk-1.1.1.png ++ ++ https://community.linuxmint.com/img/screenshots/transmission-remote-gtk.png + + + -- cgit v1.2.3