unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Kyle Andrews <kyle.c.andrews@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 37465@debbugs.gnu.org
Subject: [bug#37465] add xftwidth displayed textwidth calculator package
Date: Sun, 29 Sep 2019 10:24:32 -0400	[thread overview]
Message-ID: <c848b277852137e37670a1c4db0c795f2136897d.camel@gmail.com> (raw)
In-Reply-To: <87wodwlcwf.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1925 bytes --]

Hi Ludo,

On Wed, 2019-09-25 at 15:32 +0200, Ludovic Courtès wrote:
> 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.

> > +    (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.

> > +    (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

[-- Attachment #2: 0001-gnu-Add-xftwidth.patch --]
[-- Type: text/x-patch, Size: 2983 bytes --]

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(+)

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


  reply	other threads:[~2019-09-29 14:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20  0:25 [bug#37465] add xftwidth displayed textwidth calculator package Kyle Andrews
2019-09-25 13:32 ` Ludovic Courtès
2019-09-29 14:24   ` Kyle Andrews [this message]
2019-09-29 15:32     ` Tobias Geerinckx-Rice via Guix-patches via
2019-09-29 19:46     ` bug#37465: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c848b277852137e37670a1c4db0c795f2136897d.camel@gmail.com \
    --to=kyle.c.andrews@gmail.com \
    --cc=37465@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).