diff mbox series

[bug#37465] add xftwidth displayed textwidth calculator package

Message ID 4e2e655c245cfc810b0faaf4c63b8fd99b384269.camel@gmail.com
State Accepted
Headers show
Series [bug#37465] add xftwidth displayed textwidth calculator package | expand

Commit Message

Kyle Andrews Sept. 20, 2019, 12:25 a.m. UTC
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

Comments

Ludovic Courtès Sept. 25, 2019, 1:32 p.m. UTC | #1
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?

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

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

> +    (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’.
diff mbox series

Patch

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

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