add xftwidth displayed textwidth calculator package

  • Done
  • quality assurance status badge
Details
3 participants
  • Kyle Andrews
  • Ludovic Courtès
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Kyle Andrews
Severity
normal

Debbugs page

Kyle Andrews wrote 5 years ago
(address . guix-patches@gnu.org)
4e2e655c245cfc810b0faaf4c63b8fd99b384269.camel@gmail.com
Hello,

I'd like to provide a package definition for the xftwidth calculator
utility so that it may be included into guix. Please see the attached
patch.

Regards,

Kyle Andrews
From 60deaa526b4a6ca5a66f3b67ba77aa353409d542 Mon Sep 17 00:00:00 2001
From: Kyle Andrews <kyle.c.andrews@gmail.com>
Date: Thu, 19 Sep 2019 20:16:28 -0400
Subject: [PATCH] gnu: Add xftwidth.

* gnu/packages/wm.scm: added xftwidth package.
---
gnu/packages/wm.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (52 lines)
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index e19c6c1438..3e321eeb1c 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -209,6 +209,45 @@ or musca).
(home-page "https://herbstluftwm.org")
(license license:bsd-2)))
+(define-public xftwidth
+ (package
+ (name "xftwidth")
+ (version "20170402")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/vixus0/xftwidth")
+ (commit "35ff963908d41a8a6a7101c434c88255728025ee")))
+ (sha256
+ (base32
+ "1jwl25785li24kbp0m1wxfwk4dgxkliynn03nsj813cjr34kq16h"))
+ (file-name (string-append name "-" version "-checkout"))))
+ (build-system gnu-build-system)
+ (inputs `(("freetype" ,freetype)
+ ("libx11" ,libx11)
+ ("fontconfig" ,fontconfig)
+ ("libxft" ,libxft)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-makefile ; /usr/bin doesn't show up in PATH
+ (lambda _ (substitute* "Makefile" (("usr/") "")) #t))
+ (delete 'check) ; no check included in Makefile
+ (delete 'configure))
+ #:make-flags
+ (let ((out (assoc-ref %outputs "out")))
+ (list (string-append "DESTDIR=" out)))))
+ (synopsis "Calculator for determining displayed text widths using Xft fonts.")
+ (description "A small C program to calculate pixel widths for displayed
+text using Xft fonts (given a specific font name and size). It is ideal for
+scripts including text into the custom (e.g. dzen and xmobar based) panels
+often used in conjunction with minimalistic window managers.")
+ (home-page "http://github.com/vixus0/xftwidth")
+ (license license:expat)))
+
(define-public i3status
(package
(name "i3status")
--
2.23.0
Ludovic Courtès wrote 5 years ago
(name . Kyle Andrews)(address . kyle.c.andrews@gmail.com)(address . 37465@debbugs.gnu.org)
87wodwlcwf.fsf@gnu.org
Hello Kyle,

Kyle Andrews <kyle.c.andrews@gmail.com> skribis:

Toggle quote (7 lines)
> From 60deaa526b4a6ca5a66f3b67ba77aa353409d542 Mon Sep 17 00:00:00 2001
> From: Kyle Andrews <kyle.c.andrews@gmail.com>
> Date: Thu, 19 Sep 2019 20:16:28 -0400
> Subject: [PATCH] gnu: Add xftwidth.
>
> * gnu/packages/wm.scm: added xftwidth package.

I think this should rather go to xdisorg.scm, WDYT?

Toggle quote (6 lines)
> + (build-system gnu-build-system)
> + (inputs `(("freetype" ,freetype)
> + ("libx11" ,libx11)
> + ("fontconfig" ,fontconfig)
> + ("libxft" ,libxft)))

Nitpicking: we don’t usually align input tuples like that. :-)

Toggle quote (6 lines)
> + (synopsis "Calculator for determining displayed text widths using Xft fonts.")
> + (description "A small C program to calculate pixel widths for displayed
> +text using Xft fonts (given a specific font name and size). It is ideal for
> +scripts including text into the custom (e.g. dzen and xmobar based) panels
> +often used in conjunction with minimalistic window managers.")

Could you address the warnings reported by ‘guix lint’ here? Also, make
sure to write full sentences in the description:


The rest LGTM! Could you send an updated patch?

Thanks,
Ludo’.
Kyle Andrews wrote 5 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 37465@debbugs.gnu.org)
c848b277852137e37670a1c4db0c795f2136897d.camel@gmail.com
Hi Ludo,

On Wed, 2019-09-25 at 15:32 +0200, Ludovic Courtès wrote:
Toggle quote (14 lines)
> Hello Kyle,
>
> Kyle Andrews <kyle.c.andrews@gmail.com> skribis:
>
> > From 60deaa526b4a6ca5a66f3b67ba77aa353409d542 Mon Sep 17 00:00:00
> > 2001
> > From: Kyle Andrews <kyle.c.andrews@gmail.com>
> > Date: Thu, 19 Sep 2019 20:16:28 -0400
> > Subject: [PATCH] gnu: Add xftwidth.
> >
> > * gnu/packages/wm.scm: added xftwidth package.
>
> I think this should rather go to xdisorg.scm, WDYT?

That makes sense to me. I have added fontutils as an additional module
dependency in xdisorg.scm to satisfy the inputs.

Toggle quote (9 lines)
> > + (build-system gnu-build-system)
> > + (inputs `(("freetype" ,freetype)
> > + ("libx11" ,libx11)
> > + ("fontconfig" ,fontconfig)
> > + ("libxft" ,libxft)))
>
> Nitpicking: we don’t usually align input tuples like that. :-)
>

Okay. I've removed the alignment. However, note that the dzen package
in xdisorg.scm uses this same aligned format for it's inputs.

Toggle quote (21 lines)
> > + (synopsis "Calculator for determining displayed text widths
> > using Xft fonts.")
> > + (description "A small C program to calculate pixel widths for
> > displayed
> > +text using Xft fonts (given a specific font name and size). It is
> > ideal for
> > +scripts including text into the custom (e.g. dzen and xmobar
> > based) panels
> > +often used in conjunction with minimalistic window managers.")
>
> Could you address the warnings reported by ‘guix lint’ here? Also,
> make
> sure to write full sentences in the description:
>
> https://guix.gnu.org/manual/en/html_node/Synopses-and-Descriptions.
> html
> The rest LGTM! Could you send an updated patch?
>
> Thanks,
> Ludo’.

I've fixed the notes I saw from guix lint:

1. https -> http for github urls
2. Removed period from synopsis
3. Rewrote the description using full sentences

Please see the attached patch.

Regards,
Kyle
From 1c23edb9bdd7a7678636c97ad256995dc31c22d2 Mon Sep 17 00:00:00 2001
From: Kyle Andrews <kyle.c.andrews@gmail.com>
Date: Sun, 29 Sep 2019 10:06:49 -0400
Subject: [PATCH] gnu: Add xftwidth.

* gnu/packages/xdisorg.scm: added xftwidth package.
---
gnu/packages/xdisorg.scm | 42 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

Toggle diff (69 lines)
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 0b40ca6909..79e0f617fd 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -26,6 +26,7 @@
;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
+;;; Copyright © 2019 Kyle Andrews <kyle.c.andrews@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -83,6 +84,7 @@
#:use-module (gnu packages xml)
#:use-module (gnu packages gtk)
#:use-module (gnu packages xorg)
+ #:use-module (gnu packages fontutils)
#:use-module (gnu packages bison)
#:use-module (ice-9 match))
@@ -1322,6 +1324,46 @@ program for X11. It was designed to be fast, tiny and scriptable in any languag
(home-page "https://github.com/robm/dzen")
(license license:expat))))
+(define-public xftwidth
+ (package
+ (name "xftwidth")
+ (version "20170402")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "http://github.com/vixus0/xftwidth")
+ (commit "35ff963908d41a8a6a7101c434c88255728025ee")))
+ (sha256
+ (base32
+ "1jwl25785li24kbp0m1wxfwk4dgxkliynn03nsj813cjr34kq16h"))
+ (file-name (string-append name "-" version "-checkout"))))
+ (build-system gnu-build-system)
+ (inputs `(("freetype" ,freetype)
+ ("libx11" ,libx11)
+ ("fontconfig" ,fontconfig)
+ ("libxft" ,libxft)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-makefile ; /usr/bin doesn't show up in PATH
+ (lambda _ (substitute* "Makefile" (("usr/") "")) #t))
+ (delete 'check) ; no check included in Makefile
+ (delete 'configure))
+ #:make-flags
+ (let ((out (assoc-ref %outputs "out")))
+ (list (string-append "DESTDIR=" out)))))
+ (synopsis "Calculator for determining pixel widths of displayed text using Xft fonts")
+ (description "xftwidth is a small C program for calculating the pixel
+widths of displayed text using Xft fonts. It is especially useful in scripts
+for displaying text in graphical panels, menus, popups, and notification
+windows generated using dzen. These scripts are often used in conjunction with
+minimalistic tiling window managers such as herbstluftwm and bspwm.")
+ (home-page "http://github.com/vixus0/xftwidth")
+ (license license:expat)))
+
(define-public xcb-util-xrm
(package
(name "xcb-util-xrm")
--
2.23.0
Tobias Geerinckx-Rice wrote 5 years ago
(address . guix-patches@gnu.org)
87lfu7p180.fsf@nckx
Kyle,

Thanks for the patch.

Kyle Andrews 写道:
Toggle quote (4 lines)
> I've fixed the notes I saw from guix lint:
>
> 1. https -> http for github urls

I thought this was just a typo, but the patch agrees. Our linter
doesn't recommend HTTP over HTTPS for GitHub (or indeed any) URLs.
In fact, it should now warn about a

gnu/packages/xftwidth@20170402: permanent redirect from

Also, the GNU/Guix style is to…
- never use tabs for indentation, only spaces.
- use two spaces between prose sentences: ‘…Xft fonts. It is…’.
^^
The linter should have warned you about both of these, too.

It sounds like yours is behaving quite strangely. What, exactly,
did it say?

Kind regards,

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

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl2Qzo8ACgkQ2Imw8BjF
STw3Eg/7BpAUK6lWrea492y71yTnBSOCC9KHEWhA69lpX4J9Qn2nMRA4gnsoFCZo
bd5sY99gPIvoS+PKK/TRkhL5p1NVQI29FIUDpq/v/GDt28T2jeN5EVLZUSmmNNft
9x26aJjBuhqvQlpEI00JPGiFEvJ1981+ZvtZPz2P7wILNmzxKhQ9SClG+llT3E4R
VUsNeziqQgiS/gOa6t/G6HXUAIHNv7h9UwxH+8eqkEmcbGQtKqG7IYbMrTCksRVT
30PGtMr3IF+XcXzt0oDjlIKbd66tIxS6fBdVauVqhPjKH7PuuyzsHXSTVChXou0x
mOqs6WcYZhW5DBOzWiUZpV3Y5leRC2BQKO3Ed/O5+1hXh9CW8c96aefQx62dXq2u
yd6dMONvnOD8dMRyBxsG6tH9l94yfSg+oZoPXRIsyuDOgynZenHbMmMQtxQbhZzo
937VCvZC4fIf5r5naaXdDyhCQpaeY6HPOSUzV/Gb7+CQl8U6Jd2S7RMptx4pdVDc
8hPgt9MAyelr2SNFmskWsx1kB9uLNNazzWw2yo6ZKTdJD6RXLIeNwdVPxOTzwBNE
ymlFuSoRt4vQW/drP6qM/vgoIKYDusFHzpOrSiBmZDh/vasyKzABZS9IkVwMqBsD
eCNWVkv3tw6Ho915KLrdmMtT74V/2OSC1wTtxA74oZELkt5eGNQ=
=6/pd
-----END PGP SIGNATURE-----

Ludovic Courtès wrote 5 years ago
(name . Kyle Andrews)(address . kyle.c.andrews@gmail.com)(address . 37465-done@debbugs.gnu.org)
87d0filwbz.fsf@gnu.org
Hi Kyle,

Kyle Andrews <kyle.c.andrews@gmail.com> skribis:

Toggle quote (6 lines)
> I've fixed the notes I saw from guix lint:
>
> 1. https -> http for github urls
> 2. Removed period from synopsis
> 3. Rewrote the description using full sentences

I fixed a these additional warnings reported by ‘guix lint’ and
committed:

Toggle snippet (8 lines)
gnu/packages/xdisorg.scm:1359:17: xftwidth@20170402: sentences in description should be followed by two spaces; possible infractions at 96, 234
/home/ludo/src/guix/gnu/packages/xdisorg.scm:1335:0: xftwidth@20170402: tabulation on line 1335, column 0
/home/ludo/src/guix/gnu/packages/xdisorg.scm:1336:0: xftwidth@20170402: tabulation on line 1336, column 0
/home/ludo/src/guix/gnu/packages/xdisorg.scm:1338:0: xftwidth@20170402: tabulation on line 1338, column 0
/home/ludo/src/guix/gnu/packages/xdisorg.scm:1339:0: xftwidth@20170402: tabulation on line 1339, column 0
gnu/packages/xdisorg.scm:1364:15: xftwidth@20170402: permanent redirect from http://github.com/vixus0/xftwidth to https://github.com/vixus0/xftwidth

Thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 37465@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 37465
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help