GNU bug report logs - #56087
[PATCH] gnu: suckless: add farbfeld and propagate input to sent

Previous Next

Package: guix-patches;

Reported by: Gabriel Wicki <gabriel <at> erlikon.ch>

Date: Sun, 19 Jun 2022 12:24:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56087 in the body.
You can then email your comments to 56087 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#56087; Package guix-patches. (Sun, 19 Jun 2022 12:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gabriel Wicki <gabriel <at> erlikon.ch>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 19 Jun 2022 12:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gabriel Wicki <gabriel <at> erlikon.ch>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: suckless: add farbfeld and propagate input to sent
Date: Sun, 19 Jun 2022 14:23:17 +0200
Hello

Stumbling over the tools in suckless.scm i tried out sent.
Unfortunately just installing sent and giving the example from their
source-repo a try only produced a (somewhat strange) error.

Apparently sent (and probably other suckless tools) rely on suckless'
farbfeld package to handle images and the like, so i packaged it and
propagated the input farbfeld to sent.  This fixes the issue; now
presentations with images work.

I hope my patches are fine.

Best regards
Gabriel


From 55a563f53334c3eaac9cbae79fe33936679ab291 Mon Sep 17 00:00:00 2001
From: Gabriel Wicki <gabriel <at> erlikon.ch>
Date: Sat, 18 Jun 2022 17:00:16 +0200
Subject: [PATCH 1/2] gnu: Add farbfeld.

* gnu/packages/suckless.scm (farbfeld): New variable.
---
 gnu/packages/suckless.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index 5aa37657b9..fb3af9ad6c 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -1084,3 +1084,35 @@ (define-public sfeed
 various other formats.  There are also some programs and scripts included to
 import and export OPML and to fetch, filter, merge and order feed items.")
     (license license:isc)))
+
+(define-public farbfeld
+  (let ((commit "ab5e3df") (revision "0"))
+    (package
+      (name "farbfeld")
+      (version (git-version "4" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "git://git.suckless.org/farbfeld")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0pkmkvv5ggpzqwqdchd19442x8gh152xy5z1z13ipfznhspsf870"))))
+      (build-system gnu-build-system)
+      (inputs (list libpng libjpeg-turbo))
+      (arguments
+       `(#:make-flags (list "PREFIX="
+                            (string-append "DESTDIR=" %output)
+                            (string-append "CC="
+                                           ,(cc-for-target)))
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (delete 'check))))
+      (synopsis "Image format and conversion tools")
+      (description
+       "farbfeld is a lossless image format which is easy to parse,
+pipe and compress.")
+      (home-page "https://git.suckless.org/farbfeld/")
+      (license license:isc))))
-- 
2.34.0




Information forwarded to guix-patches <at> gnu.org:
bug#56087; Package guix-patches. (Sun, 19 Jun 2022 12:38:01 GMT) Full text and rfc822 format available.

Message #8 received at 56087 <at> debbugs.gnu.org (full text, mbox):

From: Gabriel Wicki <gabriel <at> erlikon.ch>
To: 56087 <at> debbugs.gnu.org
Subject: Re: bug#56087: Acknowledgement ([PATCH] gnu: suckless: add farbfeld
 and propagate input to sent)
Date: Sun, 19 Jun 2022 14:36:52 +0200
From d729f8e2b69a9b36436f6c6d7918ffbe524c5aad Mon Sep 17 00:00:00 2001
From: Gabriel Wicki <gabriel <at> erlikon.ch>
Date: Sat, 18 Jun 2022 17:04:12 +0200
Subject: [PATCH 2/2] gnu: sent: Add farbfeld to propagated-inputs.

* gnu/packages/suckless.scm (sent)[propagated-inputs]: Add it.
---
 gnu/packages/suckless.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index fb3af9ad6c..d3fdee72e5 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -532,6 +532,8 @@ (define-public sent
                (string-append "LIBS=" (pkg-config "--libs") " -lm")))))
     (native-inputs
      (list pkg-config))
+    (propagated-inputs
+     (list farbfeld))
     (inputs
      `(("libpng" ,libpng)
        ("libx11" ,libx11)
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#56087; Package guix-patches. (Sun, 19 Jun 2022 13:13:02 GMT) Full text and rfc822 format available.

Message #11 received at 56087 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Gabriel Wicki <gabriel <at> erlikon.ch>, 56087 <at> debbugs.gnu.org
Subject: Re: [bug#56087] Acknowledgement ([PATCH] gnu: suckless: add
 farbfeld and propagate input to sent)
Date: Sun, 19 Jun 2022 15:12:15 +0200
[Message part 1 (text/plain, inline)]
Gabriel Wicki schreef op zo 19-06-2022 om 14:36 [+0200]:
> +    (propagated-inputs
> +     (list farbfeld))

Propagation (*) can be avoided by looking in the source code of 'sent'
to see where farbfeld is started and replacing "farbfeld" by
"/gnu/store/.../bin/farbfeld" (using 'substitute*' & search-input-
file).

(*) Propagation is fragile in some uses (e.g. running directly from the
store) and hence not recommended when it can be avoided.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56087; Package guix-patches. (Sun, 19 Jun 2022 13:19:02 GMT) Full text and rfc822 format available.

Message #14 received at 56087 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Gabriel Wicki <gabriel <at> erlikon.ch>, 56087 <at> debbugs.gnu.org
Subject: Re: [bug#56087] [PATCH] gnu: suckless: add farbfeld and propagate
 input to sent
Date: Sun, 19 Jun 2022 15:17:54 +0200
[Message part 1 (text/plain, inline)]
Gabriel Wicki schreef op zo 19-06-2022 om 14:23 [+0200]:
> +       `(#:make-flags (list "PREFIX="
> +                            (string-append "DESTDIR=" %output)

Guix does not do staged installation (that's what DESTDIR is for!), so
don't set DESTDIR, instead set PREFIX to #$output instead of DESTDIR
(the difference matters when the compiled program embeds a reference to
its own installation location).  Also, G-exps, because %output isn't
documented IIRC whereas #$output is:

  (arguments
    (list #:make-flags
          #~(list (string-append "PREFIX=" #$output)
                  (string-append "CC=" #$(cc-for-target)))
          #:phases
          #~(modify-phases %standard-phases
              (delete 'configure)
              (delete 'check))))

Also, always add a comment about why tests are skipped (maybe someone
knows how to fix them or the bug they noticed!).

Greetings,
Maxime
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56087; Package guix-patches. (Sun, 19 Jun 2022 13:19:02 GMT) Full text and rfc822 format available.

Message #17 received at 56087 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Gabriel Wicki <gabriel <at> erlikon.ch>, 56087 <at> debbugs.gnu.org
Subject: Re: [bug#56087] [PATCH] gnu: suckless: add farbfeld and propagate
 input to sent
Date: Sun, 19 Jun 2022 15:18:53 +0200
[Message part 1 (text/plain, inline)]
Gabriel Wicki schreef op zo 19-06-2022 om 14:23 [+0200]:
> +  (let ((commit "ab5e3df") (revision "0"))

To avoid collisions, don't abbreviate commits.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56087; Package guix-patches. (Tue, 21 Jun 2022 00:52:02 GMT) Full text and rfc822 format available.

Message #20 received at 56087 <at> debbugs.gnu.org (full text, mbox):

From: Gabriel Wicki <gabriel <at> erlikon.ch>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 56087 <at> debbugs.gnu.org
Subject: Re: [bug#56087] [PATCH] gnu: suckless: add farbfeld and propagate
 input to sent
Date: Tue, 21 Jun 2022 02:50:47 +0200
Hi Maxime

Thanks for your quick reply!  Here is the revised patchset.  I've added
a patch to use `guix style`'s output.

Greetings,
gabriel



From 15e88ce3cb4ab51d6fe9ad9ae3ab15a435fb4db8 Mon Sep 17 00:00:00 2001
From: Gabriel Wicki <gabriel <at> erlikon.ch>
Date: Sat, 18 Jun 2022 17:00:16 +0200
Subject: [PATCH 1/3] gnu: Add farbfeld.

* gnu/packages/suckless.scm (farbfeld): New variable.
[use-modules]: Add (gnu packages imagemagick)
---
 gnu/packages/suckless.scm | 41 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index 5aa37657b9..895fc4161b 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -39,6 +39,7 @@ (define-module (gnu packages suckless)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages libbsd)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages mpd)
@@ -1084,3 +1085,43 @@ (define-public sfeed
 various other formats.  There are also some programs and scripts included to
 import and export OPML and to fetch, filter, merge and order feed items.")
     (license license:isc)))
+
+(define-public farbfeld
+  (let ((commit "ab5e3dfc9cdb476218538c6687df9f44826d8f11") (revision "0"))
+    (package
+      (name "farbfeld")
+      (version (git-version "4" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "git://git.suckless.org/farbfeld")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0pkmkvv5ggpzqwqdchd19442x8gh152xy5z1z13ipfznhspsf870"))))
+      (build-system gnu-build-system)
+      (inputs (list libpng libjpeg-turbo imagemagick))
+      (arguments
+       (list #:tests?
+             #f ;no check target
+             #:make-flags
+             #~(list (string-append "PREFIX="
+                                    #$output)
+                     (string-append "CC="
+                                    #$(cc-for-target)))
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-before 'configure 'patch-2ff
+                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                     (substitute* "2ff"
+                       (("png2ff") (string-append #$output "/bin/png2ff"))
+                       (("jpg2ff") (string-append #$output "/bin/jpg2ff"))
+                       (("convert") (search-input-file inputs "/bin/convert")))))
+                 (delete 'configure))))
+      (synopsis "Image format and conversion tools")
+      (description
+       "farbfeld is a lossless image format which is easy to parse,
+pipe and compress.")
+      (home-page "https://git.suckless.org/farbfeld/")
+      (license license:isc))))
-- 
2.34.0



From 1c5a9ff89bc4525b9e1a07b6b96b017ad58a81fe Mon Sep 17 00:00:00 2001
From: Gabriel Wicki <gabriel <at> erlikon.ch>
Date: Sat, 18 Jun 2022 17:04:12 +0200
Subject: [PATCH 2/3] gnu: sent: Add farbfeld to propagated-inputs.

* gnu/packages/suckless.scm (sent)[propagated-inputs]: Add it.
[phases]{patch-farbfeld}: New phase.
[inputs]: Add farbfeld.
[home-page]: Add trailing slash to fix linter warning.
---
 gnu/packages/suckless.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index 895fc4161b..837977d51b 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -520,7 +520,11 @@ (define-public sent
     (build-system gnu-build-system)
     (arguments
      `(#:phases (modify-phases %standard-phases
-                  (delete 'configure))  ; no configuration
+                  (delete 'configure)  ; no configuration
+                  (add-before 'build 'patch-farbfeld
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (substitute* "config.def.h"
+                        (("2ff") (search-input-file inputs "/bin/2ff"))))))
        #:tests? #f                      ; no test suite
        #:make-flags
        (let ((pkg-config (lambda (flag)
@@ -534,7 +538,8 @@ (define-public sent
     (native-inputs
      (list pkg-config))
     (inputs
-     `(("libpng" ,libpng)
+     `(("farbfeld" ,farbfeld)
+       ("libpng" ,libpng)
        ("libx11" ,libx11)
        ("libxft" ,libxft)
        ("fontconfig" ,fontconfig)))
@@ -544,7 +549,7 @@ (define-public sent
 Especially for presentations using the Takahashi method this is very nice and
 allows you to write down the presentation for a quick lightning talk within a
 few minutes.")
-    (home-page "https://tools.suckless.org/sent")
+    (home-page "https://tools.suckless.org/sent/")
     (license license:x11)))
 
 (define-public wmname
-- 
2.34.0



From 6fb7a48822e51625de8ca1026260faac80adbe17 Mon Sep 17 00:00:00 2001
From: Gabriel Wicki <gabriel <at> erlikon.ch>
Date: Tue, 21 Jun 2022 02:38:40 +0200
Subject: [PATCH 3/3] gnu: sent: Apply guix style

* gnu/packages/suckless.scm (sent): Apply `guix style`.
---
 gnu/packages/suckless.scm | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index 837977d51b..ac3ee7df10 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -520,31 +520,32 @@ (define-public sent
     (build-system gnu-build-system)
     (arguments
      `(#:phases (modify-phases %standard-phases
-                  (delete 'configure)  ; no configuration
+                  (delete 'configure) ;no configuration
                   (add-before 'build 'patch-farbfeld
                     (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* "config.def.h"
                         (("2ff") (search-input-file inputs "/bin/2ff"))))))
-       #:tests? #f                      ; no test suite
+       #:tests?
+       #f ;no test suite
        #:make-flags
        (let ((pkg-config (lambda (flag)
-                           (string-append
-                            "$(shell pkg-config " flag " "
-                            "xft fontconfig x11 libpng)"))))
-         (list (string-append "CC=" ,(cc-for-target))
+                           (string-append "$(shell pkg-config " flag " "
+                                          "xft fontconfig x11 libpng)"))))
+         (list (string-append "CC="
+                              ,(cc-for-target))
                (string-append "PREFIX=" %output)
-               (string-append "INCS=-I. " (pkg-config "--cflags"))
-               (string-append "LIBS=" (pkg-config "--libs") " -lm")))))
-    (native-inputs
-     (list pkg-config))
-    (inputs
-     `(("farbfeld" ,farbfeld)
-       ("libpng" ,libpng)
-       ("libx11" ,libx11)
-       ("libxft" ,libxft)
-       ("fontconfig" ,fontconfig)))
+               (string-append "INCS=-I. "
+                              (pkg-config "--cflags"))
+               (string-append "LIBS="
+                              (pkg-config "--libs") " -lm")))))
+    (native-inputs (list pkg-config))
+    (inputs `(("farbfeld" ,farbfeld) ("libpng" ,libpng)
+              ("libx11" ,libx11)
+              ("libxft" ,libxft)
+              ("fontconfig" ,fontconfig)))
     (synopsis "Plain-text presentation tool")
-    (description "Sent uses plain-text files and PNG images to create slideshow
+    (description
+     "Sent uses plain-text files and PNG images to create slideshow
 presentations.  Each paragraph represents a slide in the presentation.
 Especially for presentations using the Takahashi method this is very nice and
 allows you to write down the presentation for a quick lightning talk within a
-- 
2.34.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 22 Jun 2022 21:16:01 GMT) Full text and rfc822 format available.

Notification sent to Gabriel Wicki <gabriel <at> erlikon.ch>:
bug acknowledged by developer. (Wed, 22 Jun 2022 21:16:02 GMT) Full text and rfc822 format available.

Message #25 received at 56087-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Gabriel Wicki <gabriel <at> erlikon.ch>
Cc: Maxime Devos <maximedevos <at> telenet.be>, 56087-done <at> debbugs.gnu.org
Subject: Re: bug#56087: [PATCH] gnu: suckless: add farbfeld and propagate
 input to sent
Date: Wed, 22 Jun 2022 23:14:51 +0200
Hi Gabriel,

Gabriel Wicki <gabriel <at> erlikon.ch> skribis:

>>From 15e88ce3cb4ab51d6fe9ad9ae3ab15a435fb4db8 Mon Sep 17 00:00:00 2001
> From: Gabriel Wicki <gabriel <at> erlikon.ch>
> Date: Sat, 18 Jun 2022 17:00:16 +0200
> Subject: [PATCH 1/3] gnu: Add farbfeld.
>
> * gnu/packages/suckless.scm (farbfeld): New variable.
> [use-modules]: Add (gnu packages imagemagick)

[...]

>>From 1c5a9ff89bc4525b9e1a07b6b96b017ad58a81fe Mon Sep 17 00:00:00 2001
> From: Gabriel Wicki <gabriel <at> erlikon.ch>
> Date: Sat, 18 Jun 2022 17:04:12 +0200
> Subject: [PATCH 2/3] gnu: sent: Add farbfeld to propagated-inputs.
>
> * gnu/packages/suckless.scm (sent)[propagated-inputs]: Add it.
> [phases]{patch-farbfeld}: New phase.
> [inputs]: Add farbfeld.
> [home-page]: Add trailing slash to fix linter warning.

[...]

>>From 6fb7a48822e51625de8ca1026260faac80adbe17 Mon Sep 17 00:00:00 2001
> From: Gabriel Wicki <gabriel <at> erlikon.ch>
> Date: Tue, 21 Jun 2022 02:38:40 +0200
> Subject: [PATCH 3/3] gnu: sent: Apply guix style
>
> * gnu/packages/suckless.scm (sent): Apply `guix style`.

Applied, thank you & thanks Maxime!

I followed up with:

  guix style -S inputs sent --input-simplification=always

The effect is to remove input labels.

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Jul 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 280 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.