Patchwork gnu: Add awesome.

login
register
mail settings
Submitter Carlo Zancanaro
Date June 13, 2016, 12:38 a.m.
Message ID <1465778333-19689-1-git-send-email-carlo@zancanaro.id.au>
Download mbox | patch
Permalink /patch/13009/
State New
Headers show

Comments

Carlo Zancanaro - June 13, 2016, 12:38 a.m.
* gnu/packages/awesome.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk             |  1 +
 gnu/packages/awesome.scm | 93 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 94 insertions(+)
 create mode 100644 gnu/packages/awesome.scm
Danny Milosavljevic - June 13, 2016, 7:53 a.m.
Hi,

thanks for the patch.

I think it would be better if it went into wm.scm . 

> +    (arguments `(#:phases (modify-phases %standard-phases
> +                            (replace 'check
> +                              (lambda* _
> +                                (zero? (system* "../build/awesome" "-v")))))))

What's up with the tests? Why disable them like this?
Carlo Zancanaro - June 13, 2016, 11:54 a.m.
Hi!

On 13 June 2016 at 17:53, Danny Milosavljevic <dannym@scratchpost.org>
wrote:

> I think it would be better if it went into wm.scm .
>

Ah, okay! I looked at ratpoison.scm, because it was the first window
manager that I thought of to look up. It was in its own file, so I followed
that example. I agree awesome fits better into wm.scm.

> +    (arguments `(#:phases (modify-phases %standard-phases
> > +                            (replace 'check
> > +                              (lambda* _
> > +                                (zero? (system* "../build/awesome"
> "-v")))))))
>
> What's up with the tests? Why disable them like this?
>

There actually aren't any tests, so if I leave the "check" phase to do the
default "make test", it fails. This way it at least checks that the awesome
binary was compiled and can be run. I'll put a comment in explaining that.
Ludovic Courtès - June 13, 2016, 3:09 p.m.
Hello!

Carlo Zancanaro <carlozancanaro@gmail.com> skribis:

> On 13 June 2016 at 17:53, Danny Milosavljevic <dannym@scratchpost.org>
> wrote:

[...]

>> What's up with the tests? Why disable them like this?
>>
>
> There actually aren't any tests, so if I leave the "check" phase to do the
> default "make test", it fails. This way it at least checks that the awesome
> binary was compiled and can be run. I'll put a comment in explaining that.

Fair enough.  In that case, could you simply add a comment with this
explanation around the ‘check’ phase?  That way, future contributors
will immediately see why we’re doing this.

Thank you!

Ludo’.
Leo Famulari - June 13, 2016, 3:46 p.m.
On Mon, Jun 13, 2016 at 10:38:53AM +1000, Carlo Zancanaro wrote:
> * gnu/packages/awesome.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Thanks for this patch!

> +              ("imagemagick" ,imagemagick)))

I think that imagemagick is only required while building, so it can be a
'native-input'.

You can check what packages the built output refers to: $ guix gc
--references $(./pre-inst-env guix build awesome)

Imagemagick is not in the list.

> +    (license license:gpl2)

I noticed that several of the files have the "or later" text. If they
are all like that, we could use gpl2+. Did you check if there are any
files with licenses besides GPL2+?
Carlo Zancanaro - June 14, 2016, 12:57 a.m.
On 14 June 2016 at 01:46, Leo Famulari <leo@famulari.name> wrote:

> I think that imagemagick is only required while building, so it can be a
> 'native-input'.
>
> You can check what packages the built output refers to: $ guix gc
> --references $(./pre-inst-env guix build awesome)
>
> Imagemagick is not in the list.
>

Thanks for this! I had assumed that the "guix lint" would tell me about
something like that, given the check "inputs-should-be-native".

Is it possible for those references to be "wrong"? For there to be
something which is required at runtime, but doesn't show up in a "guix gc
--references" check?


> I noticed that several of the files have the "or later" text. If they
> are all like that, we could use gpl2+. Did you check if there are any
> files with licenses besides GPL2+?
>

The lua files (in lib/) don't have a license heading beyond a copyright
year/author in the luadoc tags. Everything which has a license heading
seems to be gpl2+ (I had missed the "or later" text, but I've updated it
now).
Leo Famulari - June 14, 2016, 2:12 a.m.
On Tue, Jun 14, 2016 at 10:57:41AM +1000, Carlo Zancanaro wrote:
> On 14 June 2016 at 01:46, Leo Famulari <leo@famulari.name> wrote:
> 
> > I think that imagemagick is only required while building, so it can be a
> > 'native-input'.
> >
> > You can check what packages the built output refers to: $ guix gc
> > --references $(./pre-inst-env guix build awesome)
> >
> > Imagemagick is not in the list.
> >
> 
> Thanks for this! I had assumed that the "guix lint" would tell me about
> something like that, given the check "inputs-should-be-native".
> 
> Is it possible for those references to be "wrong"? For there to be
> something which is required at runtime, but doesn't show up in a "guix gc
> --references" check?

My understanding is that `guix gc --references` reports the references
that it finds by scanning the store item you give as an argument (I
haven't read the code). So, if the packaged software needs to refer to
something but does not, you will not be warned by `guix gc --references`.

From ImageMagick, awesome uses the `convert` tool at build time. I
skimmed the results of `grep -r convert` and I didn't notice any other
uses of the tool, but I might have missed something. Can you
double-check?

> > I noticed that several of the files have the "or later" text. If they
> > are all like that, we could use gpl2+. Did you check if there are any
> > files with licenses besides GPL2+?
> >
> 
> The lua files (in lib/) don't have a license heading beyond a copyright
> year/author in the luadoc tags. Everything which has a license heading
> seems to be gpl2+ (I had missed the "or later" text, but I've updated it
> now).

Okay.
Leo Famulari - June 14, 2016, 2:16 a.m.
On Tue, Jun 14, 2016 at 10:57:41AM +1000, Carlo Zancanaro wrote:
> On 14 June 2016 at 01:46, Leo Famulari <leo@famulari.name> wrote:
> 
> > I think that imagemagick is only required while building, so it can be a
> > 'native-input'.
> >
> > You can check what packages the built output refers to: $ guix gc
> > --references $(./pre-inst-env guix build awesome)
> >
> > Imagemagick is not in the list.
> >
> 
> Thanks for this! I had assumed that the "guix lint" would tell me about
> something like that, given the check "inputs-should-be-native".

It appears that this check currently warns you if pkg-config is an input
type besides native-input. So, it's designed to take a list of software
that is typically only used at build time. But, it can't guess at the
proper operation of the software being packaged ;)

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 73aef0a..0d6e1c4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -49,6 +49,7 @@  GNU_SYSTEM_MODULES =				\
   %D%/packages/autotools.scm			\
   %D%/packages/avahi.scm			\
   %D%/packages/avr.scm				\
+  %D%/packages/awesome.scm			\
   %D%/packages/backup.scm			\
   %D%/packages/base.scm				\
   %D%/packages/bash.scm				\
diff --git a/gnu/packages/awesome.scm b/gnu/packages/awesome.scm
new file mode 100644
index 0000000..6aa1f93
--- /dev/null
+++ b/gnu/packages/awesome.scm
@@ -0,0 +1,93 @@ 
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages awesome)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gperf)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages libevent)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages xdisorg)
+  #:use-module (gnu packages xorg))
+
+(define-public awesome
+  (package
+    (name "awesome")
+    (version "3.4.15")
+    (source
+     (origin (method url-fetch)
+             (uri (string-append "https://awesome.naquadah.org/download/awesome-"
+                                 version ".tar.xz"))
+             (sha256
+              (base32
+               "1m910lr7wkw2dgzmirfvz7dasfswhhccdf65l21iiciv24c3w1bb"))))
+    (build-system cmake-build-system)
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs `(("cairo" ,cairo)
+              ("dbus" ,dbus)
+              ("gdk-pixbuf" ,gdk-pixbuf)
+              ("glib" ,glib)
+              ("gperf" ,gperf)
+              ("imlib2" ,imlib2)
+              ("libev" ,libev)
+              ("libxcb" ,libxcb)
+              ("libxcursor" ,libxcursor)
+              ("libxdg-basedir" ,libxdg-basedir)
+              ("lua" ,lua-5.1)
+              ("pango" ,pango)
+              ("startup-notification" ,startup-notification)
+              ("xcb-util" ,xcb-util)
+              ("xcb-util-cursor" ,xcb-util-cursor)
+              ("xcb-util-image" ,xcb-util-image)
+              ("xcb-util-keysyms" ,xcb-util-keysyms)
+              ("xcb-util-renderutil" ,xcb-util-renderutil)
+              ("xcb-util-wm" ,xcb-util-wm)
+              ("imagemagick" ,imagemagick)))
+    (arguments `(#:phases (modify-phases %standard-phases
+                            (replace 'check
+                              (lambda* _
+                                (zero? (system* "../build/awesome" "-v")))))))
+    (synopsis "Highly configurable, next generation framework window manager
+for X")
+    (description
+     "awesome is a window manager for X.  It manages windows in different
+layouts, like floating or tiled.  Any layout can be applied dynamically,
+optimizing the environment for the application in use and the task currently
+being performed.
+
+In a tiled layout, windows are managed in a master and stacking area.  The
+master area contains the windows which currently need the most attention,
+whereas the stacking area contains all other windows.  In a floating layout
+windows can be resized and moved freely.  Dialog windows are always managed as
+floating, regardless of the layout currently applied.  The spiral and dwindle
+layouts are special cases of the tiled layout where the stacking area is
+arranged in a spiral for the former or as a rectangular fractal for the later.
+
+Windows are grouped by tags in awesome.  Each window can be tagged with one or
+more tags.  Selecting certain tags displays all windows with these tags.")
+    (license license:gpl2)
+    (home-page "https://awesome.naquadah.org/")))