all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add dzen.
@ 2017-02-13 23:28 Mekeor Melire
  2017-02-14  0:41 ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Mekeor Melire @ 2017-02-13 23:28 UTC (permalink / raw)
  To: guix-devel

From 04f94c306f99a7bacc96b60ed60e9bb83a9cf767 Mon Sep 17 00:00:00 2001
From: Mekeor Melire <mekeor.melire@gmail.com>
Date: Tue, 14 Feb 2017 00:21:08 +0100
Subject: [PATCH] gnu: Add dzen.

* gnu/packages/xdisorg.scm (dzen): New variable.
---
 gnu/packages/xdisorg.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 510684a6c..7835c3660 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -16,6 +16,7 @@
 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2016 Petter <petter@mykolab.ch>
+;;; Copyright © 2017 Mekeor Melire <mekeor.melire@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,6 +37,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
@@ -1030,6 +1032,52 @@ border, and background.  It also supports multihead setups, customized mouse
 actions, a built-in clock, a battery monitor and a system tray.")
     (license license:gpl2)))
 
+(define-public dzen (package
+  (name "dzen")
+  (version "0.9.5")
+  (synopsis "General purpose messaging, notification and menuing program for X11")
+  (description "Dzen is a general purpose messaging, notification and menuing
+program for X11.  It was designed to be fast, tiny and scriptable in any language.")
+  (home-page "https://github.com/robm/dzen")
+  (license license:x11)
+  (source (origin
+      (method git-fetch)
+      (uri (git-reference
+          (url "https://github.com/robm/dzen.git")
+          (commit "488ab66019f475e35e067646621827c18a879ba1")))
+      (file-name (string-append name "-" version))
+      (sha256 (base32
+          "0y47d6ii87vf4a517gi4fh0yl06f8b085sra77immnsasbq9pxnw"))))
+  (build-system gnu-build-system)
+  (native-inputs `(("pkg-config" ,pkg-config)))
+  (inputs `(
+      ("libx11"      ,libx11)
+      ("libxft"      ,libxft)
+      ("libxpm"      ,libxpm)
+      ("libxinerama" ,libxinerama)))
+  (arguments `(
+      #:tests? #f
+      ; use our make-flags instead of `config.mk`
+      #:make-flags (list
+          (string-append "VERSION = " ,version)
+          (string-append "PREFIX = " %output)
+          "MANPREFIX = ${PREFIX}/share/man"
+          "INCS = -I."
+          "LIBS = -lc -lX11 -lXinerama -lXpm $(shell pkg-config --libs xft)"
+          "CFLAGS = -Wall -Os ${INCS} -DVERSION=\\\"${VERSION}\\\"\
+              -DDZEN_XINERAMA -DDZEN_XPM -DDZEN_XFT $(shell pkg-config --cflags xft)"
+          "LDFLAGS = ${LIBS}"
+          "CC = gcc"
+          "LD = ${CC}")
+      #:phases (modify-phases
+          %standard-phases
+          ; do not `./configure`
+          (delete 'configure)
+          ; do not `include config.mk` in `Makefile`
+          (add-before 'build 'dont-include-config-mk
+              (lambda* (#:key outputs #:allow-other-keys)
+                  (substitute* "Makefile" (("include config.mk") "")))))))))
+
 (define-public xcb-util-xrm
   (package
     (name "xcb-util-xrm")
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add dzen.
  2017-02-13 23:28 [PATCH] gnu: Add dzen Mekeor Melire
@ 2017-02-14  0:41 ` Leo Famulari
  2017-02-22  0:10   ` Mekeor Melire
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2017-02-14  0:41 UTC (permalink / raw)
  To: Mekeor Melire; +Cc: guix-devel

On Tue, Feb 14, 2017 at 12:28:28AM +0100, Mekeor Melire wrote:
> From 04f94c306f99a7bacc96b60ed60e9bb83a9cf767 Mon Sep 17 00:00:00 2001
> From: Mekeor Melire <mekeor.melire@gmail.com>
> Date: Tue, 14 Feb 2017 00:21:08 +0100
> Subject: [PATCH] gnu: Add dzen.
> 
> * gnu/packages/xdisorg.scm (dzen): New variable.

Thanks!

> +(define-public dzen (package

'(package ...' should start on the second line, underneath the 'e' of
'define'.

There is a script 'etc/indent-code.el' in our Git repo that should
handle indentation for you.

> +  (version "0.9.5")

The version string should be constructed as shown in the manual section
'Version Numbers':

https://www.gnu.org/software/guix/manual/html_node/Version-Numbers.html#Version-Numbers

This ensures that we can distinguish between different versions of
packages that are created from version control snapshots.

> +  (synopsis "General purpose messaging, notification and menuing program for X11")
> +  (description "Dzen is a general purpose messaging, notification and menuing
> +program for X11.  It was designed to be fast, tiny and scriptable in any language.")
> +  (home-page "https://github.com/robm/dzen")
> +  (license license:x11)

It's actually the Expat license:

http://directory.fsf.org/wiki/License:Expat

Also, these fields typically go at the end of the package definition. It
makes no difference technically, but adhering to a common standard helps
reading and understanding the package.

> +      #:tests? #f

We must leave a comment explaining why tests are disabled. If there are
no tests, then "No test suite." is enough.

> +      ; use our make-flags instead of `config.mk`
> +      #:make-flags (list
> +          (string-append "VERSION = " ,version)
> +          (string-append "PREFIX = " %output)
> +          "MANPREFIX = ${PREFIX}/share/man"
> +          "INCS = -I."
> +          "LIBS = -lc -lX11 -lXinerama -lXpm $(shell pkg-config --libs xft)"
> +          "CFLAGS = -Wall -Os ${INCS} -DVERSION=\\\"${VERSION}\\\"\
> +              -DDZEN_XINERAMA -DDZEN_XPM -DDZEN_XFT $(shell pkg-config --cflags xft)"

I don't think we should use the shell, but instead use (assoc-ref) and
(string-append) to get the right path.

> +      #:phases (modify-phases
> +          %standard-phases
> +          ; do not `./configure`

Instead, how about "No ./configure script.", since it communicates more
clearly why we delete this phase.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] gnu: Add dzen.
  2017-02-14  0:41 ` Leo Famulari
@ 2017-02-22  0:10   ` Mekeor Melire
  2017-03-02  2:34     ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Mekeor Melire @ 2017-02-22  0:10 UTC (permalink / raw)
  To: guix-devel

From 33d25348eb60372120e95e3bb5afd19bdad64795 Mon Sep 17 00:00:00 2001
From: Mekeor Melire <mekeor.melire@gmail.com>
Date: Tue, 21 Feb 2017 00:02:25 +0100
Subject: [PATCH] gnu: Add dzen.

* gnu/packages/xdisorg.scm (dzen): New variable.
---
 gnu/packages/xdisorg.scm | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 510684a6c..5be976b36 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -16,6 +16,7 @@
 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2016 Petter <petter@mykolab.ch>
+;;; Copyright © 2017 Mekeor Melire <mekeor.melire@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,6 +37,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
@@ -1030,6 +1032,57 @@ border, and background.  It also supports multihead setups, customized mouse
 actions, a built-in clock, a battery monitor and a system tray.")
     (license license:gpl2)))
 
+(define-public dzen
+  (let
+      ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7")
+       (revision "1"))
+    (package
+     (name "dzen")
+     (version (string-append
+               "0.9.5-" ; Taken from `config.mk`.
+               revision "-" (string-take commit 7)))
+     (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/robm/dzen.git")
+                    (commit commit)))
+              (file-name (string-append name "-" version))
+              (sha256 (base32
+                       "0y47d6ii87vf4a517gi4fh0yl06f8b085sra77immnsasbq9pxnw"))))
+     (build-system gnu-build-system)
+     (arguments
+      `(#:tests? #f ; No test suite.
+        #:make-flags ; Replacement for `config.mk`.
+        (list
+         (string-append "VERSION = " ,version)
+         (string-append "PREFIX = " %output)
+         "MANPREFIX = ${PREFIX}/share/man"
+         "INCS = -I."
+         "LIBS = -lc -lX11 -lXinerama -lXpm $(shell pkg-config --libs xft)"
+         "CFLAGS = -Wall -Os ${INCS} -DVERSION=\\\"${VERSION}\\\"\
+         -DDZEN_XINERAMA -DDZEN_XPM -DDZEN_XFT $(shell pkg-config --cflags xft)"
+         "LDFLAGS = ${LIBS}"
+         "CC = gcc"
+         "LD = ${CC}")
+        #:phases
+        (modify-phases %standard-phases
+          (delete 'configure) ; No configuration script.
+          ;; Use own make-flags instead of `config.mk`.
+          (add-before 'build 'dont-include-config-mk
+            (lambda* (#:key outputs #:allow-other-keys)
+              (substitute* "Makefile" (("include config.mk") "")))))))
+     (inputs
+      `(("libx11"      ,libx11)
+        ("libxft"      ,libxft)
+        ("libxpm"      ,libxpm)
+        ("libxinerama" ,libxinerama)))
+     (native-inputs `(("pkg-config" ,pkg-config)))
+     (synopsis "General purpose messaging, notification and menuing program for X11")
+     (description "Dzen is a general purpose messaging, notification and menuing
+program for X11.  It was designed to be fast, tiny and scriptable in any language.")
+     (home-page "https://github.com/robm/dzen")
+     (license license:expat))))
+
 (define-public xcb-util-xrm
   (package
     (name "xcb-util-xrm")
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add dzen.
  2017-02-22  0:10   ` Mekeor Melire
@ 2017-03-02  2:34     ` Leo Famulari
  2017-03-02  2:35       ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2017-03-02  2:34 UTC (permalink / raw)
  To: Mekeor Melire; +Cc: guix-devel

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

On Wed, Feb 22, 2017 at 01:10:10AM +0100, Mekeor Melire wrote:

Hi!

> From 33d25348eb60372120e95e3bb5afd19bdad64795 Mon Sep 17 00:00:00 2001
> From: Mekeor Melire <mekeor.melire@gmail.com>
> Date: Tue, 21 Feb 2017 00:02:25 +0100
> Subject: [PATCH] gnu: Add dzen.
> 
> * gnu/packages/xdisorg.scm (dzen): New variable.

Sorry for the slow review :/

I attached a diff of the cosmetic changes I will make before pushing.

> +(define-public dzen
> +  (let
> +      ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7")

However, this commit does not seem to exist in the dzen repo. I get this
error when building with Guix:

@ build-started /gnu/store/fpnrq0d1nxxjpjffxcvgryjipimypw81-dzen-0.9.5-1.c3f29bc.drv - x86_64-linux /var/log/guix/drvs/fp//nrq0d1nxxjpjffxcvgryjipimypw81-dzen-0.9.5-1.c3f29bc.drv.bz2
Cloning into '/gnu/store/fyjzqhhi00j02nik1pbm1lvh28p4mgdl-dzen-0.9.5-1.c3f29bc'...
fatal: reference is not a tree: c3f29bc928d5900971f65965feaae59e1272a3f7
environment variable `PATH' unset
output path `/gnu/store/fyjzqhhi00j02nik1pbm1lvh28p4mgdl-dzen-0.9.5-1.c3f29bc' should have r:sha256 hash `0y47d6ii87vf4a517gi4fh0yl06f8b085sra77immnsasbq9pxnw', instead has `15c71cd3j64c9jvyljmcq2jacb0v019fbbiagnx0z2pc6lgz1f3y'
@ build-failed /gnu/store/fpnrq0d1nxxjpjffxcvgryjipimypw81-dzen-0.9.5-1.c3f29bc.drv - 1 output path `/gnu/store/fyjzqhhi00j02nik1pbm1lvh28p4mgdl-dzen-0.9.5-1.c3f29bc' should have r:sha256 hash `0y47d6ii87vf4a517gi4fh0yl06f8b085sra77immnsasbq9pxnw', instead has `15c71cd3j64c9jvyljmcq2jacb0v019fbbiagnx0z2pc6lgz1f3y'
cannot build derivation `/gnu/store/1yxygykzbb3nw135yx330fa2hh2yy6y1-dzen-0.9.5-1.c3f29bc.drv': 1 dependencies couldn't be built
guix build: error: build failed: build of `/gnu/store/1yxygykzbb3nw135yx330fa2hh2yy6y1-dzen-0.9.5-1.c3f29bc.drv' failed

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add dzen.
  2017-03-02  2:34     ` Leo Famulari
@ 2017-03-02  2:35       ` Leo Famulari
  2017-03-02 23:25         ` Mekeor Melire
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2017-03-02  2:35 UTC (permalink / raw)
  To: Mekeor Melire; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 170 bytes --]

On Wed, Mar 01, 2017 at 09:34:01PM -0500, Leo Famulari wrote:
> I attached a diff of the cosmetic changes I will make before pushing.

I forgot to attach it. Here it is.

[-- Attachment #1.2: diff --]
[-- Type: text/plain, Size: 1400 bytes --]

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 631d545fb..b015f5a35 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -1026,22 +1026,21 @@ actions, a built-in clock, a battery monitor and a system tray.")
     (license license:gpl2)))
 
 (define-public dzen
-  (let
-      ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7")
-       (revision "1"))
+  (let ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7")
+        (revision "1"))
     (package
      (name "dzen")
-     (version (string-append
-               "0.9.5-" ; Taken from `config.mk`.
-               revision "-" (string-take commit 7)))
+     (version (string-append "0.9.5-" ; Taken from `config.mk`.
+                             revision "." (string-take commit 7)))
      (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/robm/dzen.git")
                     (commit commit)))
               (file-name (string-append name "-" version))
-              (sha256 (base32
-                       "0y47d6ii87vf4a517gi4fh0yl06f8b085sra77immnsasbq9pxnw"))))
+              (sha256
+               (base32
+                "0y47d6ii87vf4a517gi4fh0yl06f8b085sra77immnsasbq9pxnw"))))
      (build-system gnu-build-system)
      (arguments
       `(#:tests? #f ; No test suite.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add dzen.
  2017-03-02  2:35       ` Leo Famulari
@ 2017-03-02 23:25         ` Mekeor Melire
  2017-03-02 23:51           ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Mekeor Melire @ 2017-03-02 23:25 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

[-- Attachment #1: gnu: Add dzen. --]
[-- Type: text/plain, Size: 3537 bytes --]

From d235a347a21d50902d42f161a6c840516eff9d42 Mon Sep 17 00:00:00 2001
From: Mekeor Melire <mekeor.melire@gmail.com>
Date: Fri, 3 Mar 2017 00:22:47 +0100
Subject: [PATCH] gnu: Add dzen.

* gnu/packages/xdisorg.scm (dzen): New variable.
---
 gnu/packages/xdisorg.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 3d69661ba..e729bcac2 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -16,6 +16,7 @@
 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2016 Petter <petter@mykolab.ch>
+;;; Copyright © 2017 Mekeor Melire <mekeor.melire@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,6 +37,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
@@ -1023,6 +1025,56 @@ border, and background.  It also supports multihead setups, customized mouse
 actions, a built-in clock, a battery monitor and a system tray.")
     (license license:gpl2)))
 
+(define-public dzen
+  (let ((commit "488ab66019f475e35e067646621827c18a879ba1")
+        (revision "1"))
+    (package
+     (name "dzen")
+     (version (string-append "0.9.5-" ; Taken from `config.mk`.
+                             revision "." (string-take commit 7)))
+     (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/robm/dzen.git")
+                    (commit commit)))
+              (file-name (string-append name "-" version))
+              (sha256
+               (base32
+                "0y47d6ii87vf4a517gi4fh0yl06f8b085sra77immnsasbq9pxnw"))))
+     (build-system gnu-build-system)
+     (arguments
+      `(#:tests? #f ; No test suite.
+        #:make-flags ; Replacement for `config.mk`.
+        (list
+         (string-append "VERSION = " ,version)
+         (string-append "PREFIX = " %output)
+         "MANPREFIX = ${PREFIX}/share/man"
+         "INCS = -I."
+         "LIBS = -lc -lX11 -lXinerama -lXpm $(shell pkg-config --libs xft)"
+         "CFLAGS = -Wall -Os ${INCS} -DVERSION=\\\"${VERSION}\\\"\
+         -DDZEN_XINERAMA -DDZEN_XPM -DDZEN_XFT $(shell pkg-config --cflags xft)"
+         "LDFLAGS = ${LIBS}"
+         "CC = gcc"
+         "LD = ${CC}")
+        #:phases
+        (modify-phases %standard-phases
+          (delete 'configure) ; No configuration script.
+          ;; Use own make-flags instead of `config.mk`.
+          (add-before 'build 'dont-include-config-mk
+            (lambda* (#:key outputs #:allow-other-keys)
+              (substitute* "Makefile" (("include config.mk") "")))))))
+     (inputs
+      `(("libx11"      ,libx11)
+        ("libxft"      ,libxft)
+        ("libxpm"      ,libxpm)
+        ("libxinerama" ,libxinerama)))
+     (native-inputs `(("pkg-config" ,pkg-config)))
+     (synopsis "General purpose messaging, notification and menuing program for X11")
+     (description "Dzen is a general purpose messaging, notification and menuing
+program for X11.  It was designed to be fast, tiny and scriptable in any language.")
+     (home-page "https://github.com/robm/dzen")
+     (license license:expat))))
+
 (define-public xcb-util-xrm
   (package
     (name "xcb-util-xrm")
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add dzen.
  2017-03-02 23:25         ` Mekeor Melire
@ 2017-03-02 23:51           ` Leo Famulari
  0 siblings, 0 replies; 7+ messages in thread
From: Leo Famulari @ 2017-03-02 23:51 UTC (permalink / raw)
  To: Mekeor Melire; +Cc: guix-devel

On Fri, Mar 03, 2017 at 12:25:14AM +0100, Mekeor Melire wrote:
> From d235a347a21d50902d42f161a6c840516eff9d42 Mon Sep 17 00:00:00 2001
> From: Mekeor Melire <mekeor.melire@gmail.com>
> Date: Fri, 3 Mar 2017 00:22:47 +0100
> Subject: [PATCH] gnu: Add dzen.
> 
> * gnu/packages/xdisorg.scm (dzen): New variable.

Thanks, pushed!

> +          ;; Use own make-flags instead of `config.mk`.
> +          (add-before 'build 'dont-include-config-mk
> +            (lambda* (#:key outputs #:allow-other-keys)
> +              (substitute* "Makefile" (("include config.mk") "")))))))

I also simplified this a bit and made the phase return #t. We like all
build phases to return #t or to fail, but (substitute*)'s return value
is unspecified, so we return #t from this sort of phase.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-02 23:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-13 23:28 [PATCH] gnu: Add dzen Mekeor Melire
2017-02-14  0:41 ` Leo Famulari
2017-02-22  0:10   ` Mekeor Melire
2017-03-02  2:34     ` Leo Famulari
2017-03-02  2:35       ` Leo Famulari
2017-03-02 23:25         ` Mekeor Melire
2017-03-02 23:51           ` Leo Famulari

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.