diff mbox

gnu: awesome: Add awesome-3.5

Message ID 20160825030933.06c8d523@gmail.com
State New
Headers show

Commit Message

gno Aug. 25, 2016, 1:09 a.m. UTC
Hi guix !

Sure hope I'm doing this right as I'm new to this.
These patches add Awesome 3.5.9 to the repository. I decided against
updating since it may break peoples configurations. Awesome had API
changes in between 3.4 and 3.5.

Please have a look.

Comments

non such Aug. 25, 2016, 9:22 a.m. UTC | #1
Hi,

gno <gnopap@gmail.com> writes:

> Hi guix !
>
> Sure hope I'm doing this right as I'm new to this.
> These patches add Awesome 3.5.9 to the repository. I decided against
> updating since it may break peoples configurations. Awesome had API
> changes in between 3.4 and 3.5.
>
> Please have a look.

Awesome! Many thanks for your first patch, I will test this in the next
days, maybe even today. I still have an 3.5.9 config from another system
in a backup.

Ah. I see what you mean by you decided against updating. I think this is
tricky. In my opinion awesome should provide the latest version, while
for example awesome-3.4.15 would provide an older version. I use
awesome, and this is what I would expect. When there was a version
update, it was up to me to figure out if my config still worked and how
to make it work again.
I would vote for 3.5 as the new awesome and 3.4 inherits from this. But
this can be applied after 3.5 is added I think?

I did send in a patch to shorten the bloated description of awesome a
couple of days ago, please wait with applying my patch. I will send in
an update once we have this new awesome version update in tree.

> From cd3175f242450169b269ead777be6c7835476fba Mon Sep 17 00:00:00 2001
> From: doncatnip <gnopap@gmail.com>
> Date: Thu, 25 Aug 2016 01:43:53 +0200
> Subject: [PATCH 1/3] gnu: lua: Enable dynamic library support.
>
> * gnu/packages/lua.scm: (lua)[arguments]: Add make flags.

You do more than just adding make flags, maybe let the commit message
say that you added the CFLAGS: -DLUA_USE_POSIX, -DLUA_USE_DLOPEN and
added LDFLAGS? I'm not sure how to express that, if at all. the git log
should have other cases.
Otherwise it looks good to me, this is just a formality the person
commiting your patch(es) could also change on your behalf.

> ---
>  gnu/packages/lua.scm | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
> index b4b5dee..c68a3ff 100644
> --- a/gnu/packages/lua.scm
> +++ b/gnu/packages/lua.scm
> @@ -4,6 +4,7 @@
>  ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
>  ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
> +;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -51,7 +52,10 @@
>         (modify-phases %standard-phases
>           (delete 'configure)
>           (replace 'build
> -           (lambda _ (zero? (system* "make" "CFLAGS=-fPIC" "linux"))))
> +           (lambda _ (zero? (system*
> +                              "make" "LDFLAGS=-ldl"
> +                              "CFLAGS=-fPIC -DLUA_USE_DLOPEN -DLUA_USE_POSIX"
> +                              "linux"))))
>           (replace 'install
>             (lambda* (#:key outputs #:allow-other-keys)
>               (let ((out (assoc-ref outputs "out")))
> -- 
> 2.9.3
>
> From 995b67847508a70782eb522cda52b0aa36a20bd2 Mon Sep 17 00:00:00 2001
> From: doncatnip <gnopap@gmail.com>
> Date: Thu, 25 Aug 2016 02:22:37 +0200
> Subject: [PATCH 2/3] gnu: lua: Add lua-lgi.
>
> * gnu/packages/lua.scm (lua-lgi): New variable.
> ---
>  gnu/packages/lua.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 70 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
> index c68a3ff..8af0318 100644
> --- a/gnu/packages/lua.scm
> +++ b/gnu/packages/lua.scm
> @@ -27,7 +27,12 @@
>    #:use-module (guix download)
>    #:use-module (guix build-system gnu)
>    #:use-module (gnu packages)
> -  #:use-module (gnu packages readline))
> +  #:use-module (gnu packages readline)
> +  #:use-module (gnu packages glib)
> +  #:use-module (gnu packages libffi)
> +  #:use-module (gnu packages xorg)
> +  #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages gtk))
>  
>  (define-public lua
>    (package
> @@ -111,3 +116,67 @@ programming language.  Lua is a powerful, dynamic and light-weight programming
>  language.  It may be embedded or used as a general-purpose, stand-alone
>  language.")
>      (license x11)))
> +
> +(define-public lua-lgi
> +  (package
> +    (name "lua-lgi")
> +    (version "0.9.1")
> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (string-append
> +              "https://github.com/pavouk/lgi/archive/"
> +              version ".tar.gz"))
> +        (file-name (string-append name "-" version ".tar.gz"))
> +        (sha256 (base32 "1fmgdl5y4ph3yc6ycg865s3vai1rjkyda61cgqxk6zd13hmznw0c"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         (replace 'configure
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             ; needs to load cairo dynamically
> +             (let* ((cairo (string-append
> +                             (assoc-ref inputs "cairo") "/lib" )))
> +               (setenv "LD_LIBRARY_PATH" cairo ))
> +
> +             ; FIXME: Skip GTK tests:
> +             ;   gtk3 - can't get it to run with the xorg-server config below
> +             ;          and some non-gtk tests will also fail
> +             ;   gtk2 - lots of functions aren't implemented
> +             ; We choose gtk2 as the lesser evil and simply skip the test.
> +             ; as of 22/08/2016 awesome is the only package dependent on lgi but
> +             ; it doesn't need or interact with gtk using lgi.
> +             (substitute* "./tests/test.lua"
> +                        (("'gtk.lua',") "-- 'gtk.lua',"))
> +             ; lua version and therefore install directories are hardcoded
> +             (substitute* "./lgi/Makefile"
> +                        (("LUA_VERSION=5.1") "LUA_VERSION=5.2"))
> +
> +             ;; There must be a running X server during tests.
> +             (system (format #f "~a/bin/Xvfb :1 &" (assoc-ref inputs "xorg-server")))
> +             (setenv "DISPLAY" ":1"))))
> +
> +       #:make-flags
> +         (let ((out (assoc-ref %outputs "out")))
> +           (list "CC=gcc"
> +             (string-append "PREFIX=" (assoc-ref %outputs "out"))))))
> +
> +    (inputs
> +     `(("gobject-introspection" ,gobject-introspection)
> +       ("glib" ,glib)
> +       ("pango", pango)
> +       ("gtk", gtk+-2)
> +       ("lua" ,lua)
> +       ("cairo" ,cairo)
> +       ("libffi" ,libffi)
> +       ("xorg-server", xorg-server)))
> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)))
> +    (home-page "https://github.com/pavouk/lgi/")
> +    (synopsis "Lua bridge to GObject based libraries")
> +    (description
> +     "LGI is gobject-introspection based dynamic Lua binding to GObject
> +based libraries.  It allows using GObject-based libraries directly from Lua.
> +Notable examples are GTK+, GStreamer and Webkit.")
> +    (license expat)))
> -- 
> 2.9.3
>
> From f75ac65b1eeafe333b486a98cc0bb4ad55d67ee7 Mon Sep 17 00:00:00 2001
> From: doncatnip <gnopap@gmail.com>
> Date: Thu, 25 Aug 2016 02:31:07 +0200
> Subject: [PATCH 3/3] gnu: wm: Add awesome-3.5.
>
> * gnu/packages/wm.scm (awesome-3.5): New variable.
> ---
>  gnu/packages/wm.scm | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 89 insertions(+)
>
> diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
> index 2cc9f44..ff21da8 100644
> --- a/gnu/packages/wm.scm
> +++ b/gnu/packages/wm.scm
> @@ -9,6 +9,7 @@
>  ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
>  ;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
>  ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -465,3 +466,91 @@ 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/")))
> +
> +(define-public awesome-3.5
> +  (package (inherit awesome)
> +    (version "3.5.9")
> +    (source (origin
> +      (method url-fetch)
> +      (uri (string-append
> +            "https://awesome.naquadah.org/download/awesome-"
> +            version ".tar.xz"))
> +      (sha256 (base32 "0kynair1ykr74b39a4gcm2y24viial64337cf26nhlc7azjbby67"))
> +      (modules '((guix build utils)
> +                 (srfi srfi-19)))
> +      (snippet
> +              ;; Remove non-reproducible timestamp and use the date of the
> +              ;; source file instead.
> +              '(substitute* "common/version.c"
> +                 (("__DATE__ \" \" __TIME__")
> +                  (date->string
> +                   (time-utc->date
> +                    (make-time time-utc 0
> +                               (stat:mtime (stat "awesome.c"))))
> +                   "\"~c\""))))
> +             (patches (search-patches "awesome-reproducible-png.patch"))))
> +
> +    (inputs `(("gobject-introspection" ,gobject-introspection)
> +              ("lua-lgi",lua-lgi)
> +              ("cairo" ,cairo)
> +              ("dbus" ,dbus)
> +              ("gdk-pixbuf" ,gdk-pixbuf)
> +              ("glib" ,glib)
> +              ("imlib2" ,imlib2)
> +              ("libev" ,libev)
> +              ("libxcb" ,libxcb)
> +              ("libxcursor" ,libxcursor)
> +              ("libxdg-basedir" ,libxdg-basedir)
> +              ("lua" ,lua)
> +              ("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)))
> +
> +    (arguments
> +     `(;; Let compression happen in our 'compress-documentation' phase so that
> +       ;; '--no-name' is used, which removes timestamps from gzip output.
> +       #:configure-flags '("-DCOMPRESS_MANPAGES=off")
> +
> +       #:phases (modify-phases %standard-phases
> +                  (add-before 'build 'xmlto-skip-validation
> +                    (lambda _
> +                      ;; We can't download the necessary schema, so so skip
> +                      ;; validation and assume they're valid.
> +                      (substitute* "../build/CMakeFiles/man.dir/build.make"
> +                        (("/xmlto")
> +                         (string-append "/xmlto --skip-validation")))
> +                      #t))
> +                  (add-before 'configure 'set-lua-paths
> +                    (lambda* (#:key inputs #:allow-other-keys)
> +                      ; needs to load cairo dynamically
> +                      (let* ((cairo (string-append
> +                                      (assoc-ref inputs "cairo") "/lib" ))
> +                             (lua-lgi (assoc-ref inputs "lua-lgi") ))
> +                        (setenv "LD_LIBRARY_PATH" cairo )
> +                        (setenv "LUA_PATH" (string-append
> +                                    lua-lgi "/share/lua/5.2/?.lua"))
> +                        (setenv "LUA_CPATH" (string-append
> +                                    lua-lgi "/lib/lua/5.2/?.so")))))
> +                  (replace 'check
> +                    (lambda _
> +                      ;; There aren't any tests, so just make sure the binary
> +                      ;; gets built and can be run successfully.
> +                      (zero? (system* "../build/awesome" "-v"))))
> +                  (add-after 'install 'wrap
> +                    (lambda* (#:key inputs outputs #:allow-other-keys)
> +                      (let* ((awesome (assoc-ref outputs "out"))
> +                             (cairo (string-append
> +                                      (assoc-ref inputs "cairo") "/lib" ))
> +                             (lua-lgi (assoc-ref inputs "lua-lgi") ))
> +                        (wrap-program (string-append awesome "/bin/awesome")
> +                          `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))
> +                          `("LD_LIBRARY_PATH" suffix (, cairo))
> +                          `("LUA_PATH" suffix (,(string-append
> +                                lua-lgi "/share/lua/5.2/?.lua")))
> +                          `("LUA_CPATH" suffix (,(string-append
> +                                lua-lgi "/lib/lua/5.2/?.so"))))))))))))
> -- 
> 2.9.3
>
non such Aug. 25, 2016, 9:37 a.m. UTC | #2
ng0 <ng0@we.make.ritual.n0.is> writes:

> Hi,
>
> gno <gnopap@gmail.com> writes:
>
>> Hi guix !
>>
>> Sure hope I'm doing this right as I'm new to this.
>> These patches add Awesome 3.5.9 to the repository. I decided against
>> updating since it may break peoples configurations. Awesome had API
>> changes in between 3.4 and 3.5.
>>
>> Please have a look.
>
> Awesome! Many thanks for your first patch, I will test this in the next
> days, maybe even today. I still have an 3.5.9 config from another system
> in a backup.
>
> Ah. I see what you mean by you decided against updating. I think this is
> tricky. In my opinion awesome should provide the latest version, while
> for example awesome-3.4.15 would provide an older version. I use
> awesome, and this is what I would expect. When there was a version
> update, it was up to me to figure out if my config still worked and how
> to make it work again.
> I would vote for 3.5 as the new awesome and 3.4 inherits from this. But
> this can be applied after 3.5 is added I think?
>
> I did send in a patch to shorten the bloated description of awesome a
> couple of days ago, please wait with applying my patch. I will send in
> an update once we have this new awesome version update in tree.
>
>> From cd3175f242450169b269ead777be6c7835476fba Mon Sep 17 00:00:00 2001
>> From: doncatnip <gnopap@gmail.com>
>> Date: Thu, 25 Aug 2016 01:43:53 +0200
>> Subject: [PATCH 1/3] gnu: lua: Enable dynamic library support.
>>
>> * gnu/packages/lua.scm: (lua)[arguments]: Add make flags.
>
> You do more than just adding make flags, maybe let the commit message
> say that you added the CFLAGS: -DLUA_USE_POSIX, -DLUA_USE_DLOPEN and
> added LDFLAGS? I'm not sure how to express that, if at all. the git log
> should have other cases.
> Otherwise it looks good to me, this is just a formality the person
> commiting your patch(es) could also change on your behalf.
>
>> ---
>>  gnu/packages/lua.scm | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
>> index b4b5dee..c68a3ff 100644
>> --- a/gnu/packages/lua.scm
>> +++ b/gnu/packages/lua.scm
>> @@ -4,6 +4,7 @@
>>  ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
>>  ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
>>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>> +;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -51,7 +52,10 @@
>>         (modify-phases %standard-phases
>>           (delete 'configure)
>>           (replace 'build
>> -           (lambda _ (zero? (system* "make" "CFLAGS=-fPIC" "linux"))))
>> +           (lambda _ (zero? (system*
>> +                              "make" "LDFLAGS=-ldl"
>> +                              "CFLAGS=-fPIC -DLUA_USE_DLOPEN -DLUA_USE_POSIX"
>> +                              "linux"))))
>>           (replace 'install
>>             (lambda* (#:key outputs #:allow-other-keys)
>>               (let ((out (assoc-ref outputs "out")))
>> -- 
>> 2.9.3
>>
>> From 995b67847508a70782eb522cda52b0aa36a20bd2 Mon Sep 17 00:00:00 2001
>> From: doncatnip <gnopap@gmail.com>
>> Date: Thu, 25 Aug 2016 02:22:37 +0200
>> Subject: [PATCH 2/3] gnu: lua: Add lua-lgi.
>>
>> * gnu/packages/lua.scm (lua-lgi): New variable.
>> ---
>>  gnu/packages/lua.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++-
>>  1 file changed, 70 insertions(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
>> index c68a3ff..8af0318 100644
>> --- a/gnu/packages/lua.scm
>> +++ b/gnu/packages/lua.scm
>> @@ -27,7 +27,12 @@
>>    #:use-module (guix download)
>>    #:use-module (guix build-system gnu)
>>    #:use-module (gnu packages)
>> -  #:use-module (gnu packages readline))
>> +  #:use-module (gnu packages readline)
>> +  #:use-module (gnu packages glib)
>> +  #:use-module (gnu packages libffi)
>> +  #:use-module (gnu packages xorg)
>> +  #:use-module (gnu packages pkg-config)
>> +  #:use-module (gnu packages gtk))
>>  
>>  (define-public lua
>>    (package
>> @@ -111,3 +116,67 @@ programming language.  Lua is a powerful, dynamic and light-weight programming
>>  language.  It may be embedded or used as a general-purpose, stand-alone
>>  language.")
>>      (license x11)))
>> +
>> +(define-public lua-lgi
>> +  (package
>> +    (name "lua-lgi")
>> +    (version "0.9.1")
>> +    (source
>> +      (origin
>> +        (method url-fetch)
>> +        (uri (string-append
>> +              "https://github.com/pavouk/lgi/archive/"
>> +              version ".tar.gz"))
>> +        (file-name (string-append name "-" version ".tar.gz"))
>> +        (sha256 (base32 "1fmgdl5y4ph3yc6ycg865s3vai1rjkyda61cgqxk6zd13hmznw0c"))))
>> +    (build-system gnu-build-system)
>> +    (arguments
>> +     '(#:phases
>> +       (modify-phases %standard-phases
>> +         (replace 'configure
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             ; needs to load cairo dynamically
>> +             (let* ((cairo (string-append
>> +                             (assoc-ref inputs "cairo") "/lib" )))
>> +               (setenv "LD_LIBRARY_PATH" cairo ))
>> +
>> +             ; FIXME: Skip GTK tests:
>> +             ;   gtk3 - can't get it to run with the xorg-server config below
>> +             ;          and some non-gtk tests will also fail
>> +             ;   gtk2 - lots of functions aren't implemented
>> +             ; We choose gtk2 as the lesser evil and simply skip the test.
>> +             ; as of 22/08/2016 awesome is the only package dependent on lgi but
>> +             ; it doesn't need or interact with gtk using lgi.
>> +             (substitute* "./tests/test.lua"
>> +                        (("'gtk.lua',") "-- 'gtk.lua',"))
>> +             ; lua version and therefore install directories are hardcoded
>> +             (substitute* "./lgi/Makefile"
>> +                        (("LUA_VERSION=5.1") "LUA_VERSION=5.2"))
>> +
>> +             ;; There must be a running X server during tests.
>> +             (system (format #f "~a/bin/Xvfb :1 &" (assoc-ref inputs "xorg-server")))
>> +             (setenv "DISPLAY" ":1"))))
>> +
>> +       #:make-flags
>> +         (let ((out (assoc-ref %outputs "out")))
>> +           (list "CC=gcc"
>> +             (string-append "PREFIX=" (assoc-ref %outputs "out"))))))
>> +
>> +    (inputs
>> +     `(("gobject-introspection" ,gobject-introspection)
>> +       ("glib" ,glib)
>> +       ("pango", pango)
>> +       ("gtk", gtk+-2)
>> +       ("lua" ,lua)
>> +       ("cairo" ,cairo)
>> +       ("libffi" ,libffi)
>> +       ("xorg-server", xorg-server)))
>> +    (native-inputs
>> +     `(("pkg-config" ,pkg-config)))
>> +    (home-page "https://github.com/pavouk/lgi/")
>> +    (synopsis "Lua bridge to GObject based libraries")
>> +    (description
>> +     "LGI is gobject-introspection based dynamic Lua binding to GObject
>> +based libraries.  It allows using GObject-based libraries directly from Lua.
>> +Notable examples are GTK+, GStreamer and Webkit.")
>> +    (license expat)))
>> -- 
>> 2.9.3
>>
>> From f75ac65b1eeafe333b486a98cc0bb4ad55d67ee7 Mon Sep 17 00:00:00 2001
>> From: doncatnip <gnopap@gmail.com>
>> Date: Thu, 25 Aug 2016 02:31:07 +0200
>> Subject: [PATCH 3/3] gnu: wm: Add awesome-3.5.
>>
>> * gnu/packages/wm.scm (awesome-3.5): New variable.
>> ---
>>  gnu/packages/wm.scm | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 89 insertions(+)
>>
>> diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
>> index 2cc9f44..ff21da8 100644
>> --- a/gnu/packages/wm.scm
>> +++ b/gnu/packages/wm.scm
>> @@ -9,6 +9,7 @@
>>  ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
>>  ;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
>>  ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
>> +;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -465,3 +466,91 @@ 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/")))
>> +
>> +(define-public awesome-3.5
>> +  (package (inherit awesome)
>> +    (version "3.5.9")
>> +    (source (origin
>> +      (method url-fetch)
>> +      (uri (string-append
>> +            "https://awesome.naquadah.org/download/awesome-"
>> +            version ".tar.xz"))
>> +      (sha256 (base32 "0kynair1ykr74b39a4gcm2y24viial64337cf26nhlc7azjbby67"))
>> +      (modules '((guix build utils)
>> +                 (srfi srfi-19)))
>> +      (snippet
>> +              ;; Remove non-reproducible timestamp and use the date of the
>> +              ;; source file instead.
>> +              '(substitute* "common/version.c"
>> +                 (("__DATE__ \" \" __TIME__")
>> +                  (date->string
>> +                   (time-utc->date
>> +                    (make-time time-utc 0
>> +                               (stat:mtime (stat "awesome.c"))))
>> +                   "\"~c\""))))
>> +             (patches (search-patches "awesome-reproducible-png.patch"))))
>> +
>> +    (inputs `(("gobject-introspection" ,gobject-introspection)
>> +              ("lua-lgi",lua-lgi)
>> +              ("cairo" ,cairo)
>> +              ("dbus" ,dbus)
>> +              ("gdk-pixbuf" ,gdk-pixbuf)
>> +              ("glib" ,glib)
>> +              ("imlib2" ,imlib2)
>> +              ("libev" ,libev)
>> +              ("libxcb" ,libxcb)
>> +              ("libxcursor" ,libxcursor)
>> +              ("libxdg-basedir" ,libxdg-basedir)
>> +              ("lua" ,lua)
>> +              ("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)))
>> +
>> +    (arguments
>> +     `(;; Let compression happen in our 'compress-documentation' phase so that
>> +       ;; '--no-name' is used, which removes timestamps from gzip output.
>> +       #:configure-flags '("-DCOMPRESS_MANPAGES=off")
>> +
>> +       #:phases (modify-phases %standard-phases
>> +                  (add-before 'build 'xmlto-skip-validation
>> +                    (lambda _
>> +                      ;; We can't download the necessary schema, so so skip
>> +                      ;; validation and assume they're valid.
>> +                      (substitute* "../build/CMakeFiles/man.dir/build.make"
>> +                        (("/xmlto")
>> +                         (string-append "/xmlto --skip-validation")))
>> +                      #t))
>> +                  (add-before 'configure 'set-lua-paths
>> +                    (lambda* (#:key inputs #:allow-other-keys)
>> +                      ; needs to load cairo dynamically
>> +                      (let* ((cairo (string-append
>> +                                      (assoc-ref inputs "cairo") "/lib" ))
>> +                             (lua-lgi (assoc-ref inputs "lua-lgi") ))
>> +                        (setenv "LD_LIBRARY_PATH" cairo )
>> +                        (setenv "LUA_PATH" (string-append
>> +                                    lua-lgi "/share/lua/5.2/?.lua"))
>> +                        (setenv "LUA_CPATH" (string-append
>> +                                    lua-lgi "/lib/lua/5.2/?.so")))))
>> +                  (replace 'check
>> +                    (lambda _
>> +                      ;; There aren't any tests, so just make sure the binary
>> +                      ;; gets built and can be run successfully.
>> +                      (zero? (system* "../build/awesome" "-v"))))
>> +                  (add-after 'install 'wrap
>> +                    (lambda* (#:key inputs outputs #:allow-other-keys)
>> +                      (let* ((awesome (assoc-ref outputs "out"))
>> +                             (cairo (string-append
>> +                                      (assoc-ref inputs "cairo") "/lib" ))
>> +                             (lua-lgi (assoc-ref inputs "lua-lgi") ))
>> +                        (wrap-program (string-append awesome "/bin/awesome")
>> +                          `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))
>> +                          `("LD_LIBRARY_PATH" suffix (, cairo))
>> +                          `("LUA_PATH" suffix (,(string-append
>> +                                lua-lgi "/share/lua/5.2/?.lua")))
>> +                          `("LUA_CPATH" suffix (,(string-append
>> +                                lua-lgi "/lib/lua/5.2/?.so"))))))))))))
>> -- 
>> 2.9.3
>>

Works for me (written from inside a running awesome-3.5.9).
non such Aug. 25, 2016, 9:59 a.m. UTC | #3
> Works for me (written from inside a running awesome-3.5.9).

ng0@shadowwalker ~$ awesome --version
awesome v3.5.9 (Mighty Ravendark)
• Build: Sun Mar 06 14:05:54Z 2016 for x86_64 by gcc version 4.9.3 (@)
• Compiled against Lua 5.2.4 (running with Lua 5.2)
• D-Bus support: ✔

Having no dbus support will help with eventual hardening of Guix,
but why do we not have it in awesome? 
And why would we we need it (dbus support) at all? I don't even know why
I used to build it with dbus support before. Works either way.
non such Aug. 25, 2016, 2:47 p.m. UTC | #4
ng0 <ng0@we.make.ritual.n0.is> writes:

>> Works for me (written from inside a running awesome-3.5.9).
>
> ng0@shadowwalker ~$ awesome --version
> awesome v3.5.9 (Mighty Ravendark)
> • Build: Sun Mar 06 14:05:54Z 2016 for x86_64 by gcc version 4.9.3 (@)
> • Compiled against Lua 5.2.4 (running with Lua 5.2)
> • D-Bus support: ✔

Great, the joy of a limited font... Nevermind this message then for
obvious reasons but rather take it as a note that dbus and hardening is
something we need to watch in the future ;)

> Having no dbus support will help with eventual hardening of Guix,
> but why do we not have it in awesome? 
> And why would we we need it (dbus support) at all? I don't even know why
> I used to build it with dbus support before. Works either way.
non such Aug. 25, 2016, 2:50 p.m. UTC | #5
(Sending this back as a copy to the thread on the list.)

Hi,

Can you please CC the guix-devel@gnu.org list or just reply-to the list
when replying with the intention to not message offlist?

I think gnu.org does not set a reply-to thing, my email client does not
care or know about such settings though.

doncatnip <gnopap@gmail.com> writes:

> On Thu, 25 Aug 2016 09:22:38 +0000
> ng0 <ng0@we.make.ritual.n0.is> wrote:
>
>> Hi,
>> 
>> gno <gnopap@gmail.com> writes:
>> 
>> > Hi guix !
>> >
>> > Sure hope I'm doing this right as I'm new to this.
>> > These patches add Awesome 3.5.9 to the repository. I decided against
>> > updating since it may break peoples configurations. Awesome had API
>> > changes in between 3.4 and 3.5.
>> >
>> > Please have a look.  
>> 
>> Awesome! Many thanks for your first patch, I will test this in the
>> next days, maybe even today. I still have an 3.5.9 config from
>> another system in a backup.
>> 
>> Ah. I see what you mean by you decided against updating. I think this
>> is tricky. In my opinion awesome should provide the latest version,
>> while for example awesome-3.4.15 would provide an older version. I use
>> awesome, and this is what I would expect. When there was a version
>> update, it was up to me to figure out if my config still worked and
>> how to make it work again.
>> I would vote for 3.5 as the new awesome and 3.4 inherits from this.
>> But this can be applied after 3.5 is added I think?
>
> Yea, there might be a better (guix) way to do this. I just thought it
> might be good if those changes don't interfere at all with current
> system configs yet. Should be easy to change later on.
>
>> I did send in a patch to shorten the bloated description of awesome a
>> couple of days ago, please wait with applying my patch. I will send in
>> an update once we have this new awesome version update in tree.
>> 
>> > From cd3175f242450169b269ead777be6c7835476fba Mon Sep 17 00:00:00
>> > 2001 From: doncatnip <gnopap@gmail.com>
>> > Date: Thu, 25 Aug 2016 01:43:53 +0200
>> > Subject: [PATCH 1/3] gnu: lua: Enable dynamic library support.
>> >
>> > * gnu/packages/lua.scm: (lua)[arguments]: Add make flags.  
>> 
>> You do more than just adding make flags, maybe let the commit message
>> say that you added the CFLAGS: -DLUA_USE_POSIX, -DLUA_USE_DLOPEN and
>> added LDFLAGS? I'm not sure how to express that, if at all. the git
>> log should have other cases.
>> Otherwise it looks good to me, this is just a formality the person
>> commiting your patch(es) could also change on your behalf.
>
> Add make flags which enable ld support as per headline, but yea maybe
> it's not descriptive enough. I took example from another patch recently
> posted in this list. I'd apperciate the person commiting the patch
> changing it to something more appropriate.
>
> Thanks for testing this !
>
>> > ---
>> >  gnu/packages/lua.scm | 6 +++++-
>> >  1 file changed, 5 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
>> > index b4b5dee..c68a3ff 100644
>> > --- a/gnu/packages/lua.scm
>> > +++ b/gnu/packages/lua.scm
>> > @@ -4,6 +4,7 @@
>> >  ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
>> >  ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
>> >  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>> > +;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
>> >  ;;;
>> >  ;;; This file is part of GNU Guix.
>> >  ;;;
>> > @@ -51,7 +52,10 @@
>> >         (modify-phases %standard-phases
>> >           (delete 'configure)
>> >           (replace 'build
>> > -           (lambda _ (zero? (system* "make" "CFLAGS=-fPIC"
>> > "linux"))))
>> > +           (lambda _ (zero? (system*
>> > +                              "make" "LDFLAGS=-ldl"
>> > +                              "CFLAGS=-fPIC -DLUA_USE_DLOPEN
>> > -DLUA_USE_POSIX"
>> > +                              "linux"))))
>> >           (replace 'install
>> >             (lambda* (#:key outputs #:allow-other-keys)
>> >               (let ((out (assoc-ref outputs "out")))
>> > -- 
>> > 2.9.3
>> >
>> > From 995b67847508a70782eb522cda52b0aa36a20bd2 Mon Sep 17 00:00:00
>> > 2001 From: doncatnip <gnopap@gmail.com>
>> > Date: Thu, 25 Aug 2016 02:22:37 +0200
>> > Subject: [PATCH 2/3] gnu: lua: Add lua-lgi.
>> >
>> > * gnu/packages/lua.scm (lua-lgi): New variable.
>> > ---
>> >  gnu/packages/lua.scm | 71
>> > +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file
>> > changed, 70 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
>> > index c68a3ff..8af0318 100644
>> > --- a/gnu/packages/lua.scm
>> > +++ b/gnu/packages/lua.scm
>> > @@ -27,7 +27,12 @@
>> >    #:use-module (guix download)
>> >    #:use-module (guix build-system gnu)
>> >    #:use-module (gnu packages)
>> > -  #:use-module (gnu packages readline))
>> > +  #:use-module (gnu packages readline)
>> > +  #:use-module (gnu packages glib)
>> > +  #:use-module (gnu packages libffi)
>> > +  #:use-module (gnu packages xorg)
>> > +  #:use-module (gnu packages pkg-config)
>> > +  #:use-module (gnu packages gtk))
>> >  
>> >  (define-public lua
>> >    (package
>> > @@ -111,3 +116,67 @@ programming language.  Lua is a powerful,
>> > dynamic and light-weight programming language.  It may be embedded
>> > or used as a general-purpose, stand-alone language.")
>> >      (license x11)))
>> > +
>> > +(define-public lua-lgi
>> > +  (package
>> > +    (name "lua-lgi")
>> > +    (version "0.9.1")
>> > +    (source
>> > +      (origin
>> > +        (method url-fetch)
>> > +        (uri (string-append
>> > +              "https://github.com/pavouk/lgi/archive/"
>> > +              version ".tar.gz"))
>> > +        (file-name (string-append name "-" version ".tar.gz"))
>> > +        (sha256 (base32
>> > "1fmgdl5y4ph3yc6ycg865s3vai1rjkyda61cgqxk6zd13hmznw0c"))))
>> > +    (build-system gnu-build-system)
>> > +    (arguments
>> > +     '(#:phases
>> > +       (modify-phases %standard-phases
>> > +         (replace 'configure
>> > +           (lambda* (#:key inputs #:allow-other-keys)
>> > +             ; needs to load cairo dynamically
>> > +             (let* ((cairo (string-append
>> > +                             (assoc-ref inputs "cairo") "/lib" )))
>> > +               (setenv "LD_LIBRARY_PATH" cairo ))
>> > +
>> > +             ; FIXME: Skip GTK tests:
>> > +             ;   gtk3 - can't get it to run with the xorg-server
>> > config below
>> > +             ;          and some non-gtk tests will also fail
>> > +             ;   gtk2 - lots of functions aren't implemented
>> > +             ; We choose gtk2 as the lesser evil and simply skip
>> > the test.
>> > +             ; as of 22/08/2016 awesome is the only package
>> > dependent on lgi but
>> > +             ; it doesn't need or interact with gtk using lgi.
>> > +             (substitute* "./tests/test.lua"
>> > +                        (("'gtk.lua',") "-- 'gtk.lua',"))
>> > +             ; lua version and therefore install directories are
>> > hardcoded
>> > +             (substitute* "./lgi/Makefile"
>> > +                        (("LUA_VERSION=5.1") "LUA_VERSION=5.2"))
>> > +
>> > +             ;; There must be a running X server during tests.
>> > +             (system (format #f "~a/bin/Xvfb :1 &" (assoc-ref
>> > inputs "xorg-server")))
>> > +             (setenv "DISPLAY" ":1"))))
>> > +
>> > +       #:make-flags
>> > +         (let ((out (assoc-ref %outputs "out")))
>> > +           (list "CC=gcc"
>> > +             (string-append "PREFIX=" (assoc-ref %outputs
>> > "out")))))) +
>> > +    (inputs
>> > +     `(("gobject-introspection" ,gobject-introspection)
>> > +       ("glib" ,glib)
>> > +       ("pango", pango)
>> > +       ("gtk", gtk+-2)
>> > +       ("lua" ,lua)
>> > +       ("cairo" ,cairo)
>> > +       ("libffi" ,libffi)
>> > +       ("xorg-server", xorg-server)))
>> > +    (native-inputs
>> > +     `(("pkg-config" ,pkg-config)))
>> > +    (home-page "https://github.com/pavouk/lgi/")
>> > +    (synopsis "Lua bridge to GObject based libraries")
>> > +    (description
>> > +     "LGI is gobject-introspection based dynamic Lua binding to
>> > GObject +based libraries.  It allows using GObject-based libraries
>> > directly from Lua. +Notable examples are GTK+, GStreamer and
>> > Webkit.")
>> > +    (license expat)))
>> > -- 
>> > 2.9.3
>> >
>> > From f75ac65b1eeafe333b486a98cc0bb4ad55d67ee7 Mon Sep 17 00:00:00
>> > 2001 From: doncatnip <gnopap@gmail.com>
>> > Date: Thu, 25 Aug 2016 02:31:07 +0200
>> > Subject: [PATCH 3/3] gnu: wm: Add awesome-3.5.
>> >
>> > * gnu/packages/wm.scm (awesome-3.5): New variable.
>> > ---
>> >  gnu/packages/wm.scm | 89
>> > +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file
>> > changed, 89 insertions(+)
>> >
>> > diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
>> > index 2cc9f44..ff21da8 100644
>> > --- a/gnu/packages/wm.scm
>> > +++ b/gnu/packages/wm.scm
>> > @@ -9,6 +9,7 @@
>> >  ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
>> >  ;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
>> >  ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
>> > +;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
>> >  ;;;
>> >  ;;; This file is part of GNU Guix.
>> >  ;;;
>> > @@ -465,3 +466,91 @@ 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/")))
>> > +
>> > +(define-public awesome-3.5
>> > +  (package (inherit awesome)
>> > +    (version "3.5.9")
>> > +    (source (origin
>> > +      (method url-fetch)
>> > +      (uri (string-append
>> > +            "https://awesome.naquadah.org/download/awesome-"
>> > +            version ".tar.xz"))
>> > +      (sha256 (base32
>> > "0kynair1ykr74b39a4gcm2y24viial64337cf26nhlc7azjbby67"))
>> > +      (modules '((guix build utils)
>> > +                 (srfi srfi-19)))
>> > +      (snippet
>> > +              ;; Remove non-reproducible timestamp and use the
>> > date of the
>> > +              ;; source file instead.
>> > +              '(substitute* "common/version.c"
>> > +                 (("__DATE__ \" \" __TIME__")
>> > +                  (date->string
>> > +                   (time-utc->date
>> > +                    (make-time time-utc 0
>> > +                               (stat:mtime (stat "awesome.c"))))
>> > +                   "\"~c\""))))
>> > +             (patches (search-patches
>> > "awesome-reproducible-png.patch")))) +
>> > +    (inputs `(("gobject-introspection" ,gobject-introspection)
>> > +              ("lua-lgi",lua-lgi)
>> > +              ("cairo" ,cairo)
>> > +              ("dbus" ,dbus)
>> > +              ("gdk-pixbuf" ,gdk-pixbuf)
>> > +              ("glib" ,glib)
>> > +              ("imlib2" ,imlib2)
>> > +              ("libev" ,libev)
>> > +              ("libxcb" ,libxcb)
>> > +              ("libxcursor" ,libxcursor)
>> > +              ("libxdg-basedir" ,libxdg-basedir)
>> > +              ("lua" ,lua)
>> > +              ("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)))
>> > +
>> > +    (arguments
>> > +     `(;; Let compression happen in our 'compress-documentation'
>> > phase so that
>> > +       ;; '--no-name' is used, which removes timestamps from gzip
>> > output.
>> > +       #:configure-flags '("-DCOMPRESS_MANPAGES=off")
>> > +
>> > +       #:phases (modify-phases %standard-phases
>> > +                  (add-before 'build 'xmlto-skip-validation
>> > +                    (lambda _
>> > +                      ;; We can't download the necessary schema,
>> > so so skip
>> > +                      ;; validation and assume they're valid.
>> > +                      (substitute*
>> > "../build/CMakeFiles/man.dir/build.make"
>> > +                        (("/xmlto")
>> > +                         (string-append "/xmlto
>> > --skip-validation")))
>> > +                      #t))
>> > +                  (add-before 'configure 'set-lua-paths
>> > +                    (lambda* (#:key inputs #:allow-other-keys)
>> > +                      ; needs to load cairo dynamically
>> > +                      (let* ((cairo (string-append
>> > +                                      (assoc-ref inputs "cairo")
>> > "/lib" ))
>> > +                             (lua-lgi (assoc-ref inputs "lua-lgi")
>> > ))
>> > +                        (setenv "LD_LIBRARY_PATH" cairo )
>> > +                        (setenv "LUA_PATH" (string-append
>> > +                                    lua-lgi
>> > "/share/lua/5.2/?.lua"))
>> > +                        (setenv "LUA_CPATH" (string-append
>> > +                                    lua-lgi
>> > "/lib/lua/5.2/?.so")))))
>> > +                  (replace 'check
>> > +                    (lambda _
>> > +                      ;; There aren't any tests, so just make sure
>> > the binary
>> > +                      ;; gets built and can be run successfully.
>> > +                      (zero? (system* "../build/awesome" "-v"))))
>> > +                  (add-after 'install 'wrap
>> > +                    (lambda* (#:key inputs outputs
>> > #:allow-other-keys)
>> > +                      (let* ((awesome (assoc-ref outputs "out"))
>> > +                             (cairo (string-append
>> > +                                      (assoc-ref inputs "cairo")
>> > "/lib" ))
>> > +                             (lua-lgi (assoc-ref inputs "lua-lgi")
>> > ))
>> > +                        (wrap-program (string-append awesome
>> > "/bin/awesome")
>> > +                          `("GI_TYPELIB_PATH" ":" prefix (,(getenv
>> > "GI_TYPELIB_PATH")))
>> > +                          `("LD_LIBRARY_PATH" suffix (, cairo))
>> > +                          `("LUA_PATH" suffix (,(string-append
>> > +                                lua-lgi "/share/lua/5.2/?.lua")))
>> > +                          `("LUA_CPATH" suffix (,(string-append
>> > +                                lua-lgi
>> > "/lib/lua/5.2/?.so")))))))))))) -- 
>> > 2.9.3
>> >  
>> 
>
gno Aug. 25, 2016, 5:24 p.m. UTC | #6
On Thu, 25 Aug 2016 14:50:29 +0000
ng0 <ng0@we.make.ritual.n0.is> wrote:

Hi !
Of course. I didn't notice.

> (Sending this back as a copy to the thread on the list.)
> 
> Hi,
> 
> Can you please CC the guix-devel@gnu.org list or just reply-to the
> list when replying with the intention to not message offlist?
> 
> I think gnu.org does not set a reply-to thing, my email client does
> not care or know about such settings though.
> 
> doncatnip <gnopap@gmail.com> writes:
> 
> > On Thu, 25 Aug 2016 09:22:38 +0000
> > ng0 <ng0@we.make.ritual.n0.is> wrote:
> >  
> >> Hi,
> >> 
> >> gno <gnopap@gmail.com> writes:
> >>   
> >> > Hi guix !
> >> >
> >> > Sure hope I'm doing this right as I'm new to this.
> >> > These patches add Awesome 3.5.9 to the repository. I decided
> >> > against updating since it may break peoples configurations.
> >> > Awesome had API changes in between 3.4 and 3.5.
> >> >
> >> > Please have a look.    
> >> 
> >> Awesome! Many thanks for your first patch, I will test this in the
> >> next days, maybe even today. I still have an 3.5.9 config from
> >> another system in a backup.
> >> 
> >> Ah. I see what you mean by you decided against updating. I think
> >> this is tricky. In my opinion awesome should provide the latest
> >> version, while for example awesome-3.4.15 would provide an older
> >> version. I use awesome, and this is what I would expect. When
> >> there was a version update, it was up to me to figure out if my
> >> config still worked and how to make it work again.
> >> I would vote for 3.5 as the new awesome and 3.4 inherits from this.
> >> But this can be applied after 3.5 is added I think?  
> >
> > Yea, there might be a better (guix) way to do this. I just thought
> > it might be good if those changes don't interfere at all with
> > current system configs yet. Should be easy to change later on.
> >  
> >> I did send in a patch to shorten the bloated description of
> >> awesome a couple of days ago, please wait with applying my patch.
> >> I will send in an update once we have this new awesome version
> >> update in tree. 
> >> > From cd3175f242450169b269ead777be6c7835476fba Mon Sep 17 00:00:00
> >> > 2001 From: doncatnip <gnopap@gmail.com>
> >> > Date: Thu, 25 Aug 2016 01:43:53 +0200
> >> > Subject: [PATCH 1/3] gnu: lua: Enable dynamic library support.
> >> >
> >> > * gnu/packages/lua.scm: (lua)[arguments]: Add make flags.    
> >> 
> >> You do more than just adding make flags, maybe let the commit
> >> message say that you added the CFLAGS: -DLUA_USE_POSIX,
> >> -DLUA_USE_DLOPEN and added LDFLAGS? I'm not sure how to express
> >> that, if at all. the git log should have other cases.
> >> Otherwise it looks good to me, this is just a formality the person
> >> commiting your patch(es) could also change on your behalf.  
> >
> > Add make flags which enable ld support as per headline, but yea
> > maybe it's not descriptive enough. I took example from another
> > patch recently posted in this list. I'd apperciate the person
> > commiting the patch changing it to something more appropriate.
> >
> > Thanks for testing this !
> >  
> >> > ---
> >> >  gnu/packages/lua.scm | 6 +++++-
> >> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
> >> > index b4b5dee..c68a3ff 100644
> >> > --- a/gnu/packages/lua.scm
> >> > +++ b/gnu/packages/lua.scm
> >> > @@ -4,6 +4,7 @@
> >> >  ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
> >> >  ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
> >> >  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
> >> > +;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
> >> >  ;;;
> >> >  ;;; This file is part of GNU Guix.
> >> >  ;;;
> >> > @@ -51,7 +52,10 @@
> >> >         (modify-phases %standard-phases
> >> >           (delete 'configure)
> >> >           (replace 'build
> >> > -           (lambda _ (zero? (system* "make" "CFLAGS=-fPIC"
> >> > "linux"))))
> >> > +           (lambda _ (zero? (system*
> >> > +                              "make" "LDFLAGS=-ldl"
> >> > +                              "CFLAGS=-fPIC -DLUA_USE_DLOPEN
> >> > -DLUA_USE_POSIX"
> >> > +                              "linux"))))
> >> >           (replace 'install
> >> >             (lambda* (#:key outputs #:allow-other-keys)
> >> >               (let ((out (assoc-ref outputs "out")))
> >> > -- 
> >> > 2.9.3
> >> >
> >> > From 995b67847508a70782eb522cda52b0aa36a20bd2 Mon Sep 17 00:00:00
> >> > 2001 From: doncatnip <gnopap@gmail.com>
> >> > Date: Thu, 25 Aug 2016 02:22:37 +0200
> >> > Subject: [PATCH 2/3] gnu: lua: Add lua-lgi.
> >> >
> >> > * gnu/packages/lua.scm (lua-lgi): New variable.
> >> > ---
> >> >  gnu/packages/lua.scm | 71
> >> > +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file
> >> > changed, 70 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
> >> > index c68a3ff..8af0318 100644
> >> > --- a/gnu/packages/lua.scm
> >> > +++ b/gnu/packages/lua.scm
> >> > @@ -27,7 +27,12 @@
> >> >    #:use-module (guix download)
> >> >    #:use-module (guix build-system gnu)
> >> >    #:use-module (gnu packages)
> >> > -  #:use-module (gnu packages readline))
> >> > +  #:use-module (gnu packages readline)
> >> > +  #:use-module (gnu packages glib)
> >> > +  #:use-module (gnu packages libffi)
> >> > +  #:use-module (gnu packages xorg)
> >> > +  #:use-module (gnu packages pkg-config)
> >> > +  #:use-module (gnu packages gtk))
> >> >  
> >> >  (define-public lua
> >> >    (package
> >> > @@ -111,3 +116,67 @@ programming language.  Lua is a powerful,
> >> > dynamic and light-weight programming language.  It may be
> >> > embedded or used as a general-purpose, stand-alone language.")
> >> >      (license x11)))
> >> > +
> >> > +(define-public lua-lgi
> >> > +  (package
> >> > +    (name "lua-lgi")
> >> > +    (version "0.9.1")
> >> > +    (source
> >> > +      (origin
> >> > +        (method url-fetch)
> >> > +        (uri (string-append
> >> > +              "https://github.com/pavouk/lgi/archive/"
> >> > +              version ".tar.gz"))
> >> > +        (file-name (string-append name "-" version ".tar.gz"))
> >> > +        (sha256 (base32
> >> > "1fmgdl5y4ph3yc6ycg865s3vai1rjkyda61cgqxk6zd13hmznw0c"))))
> >> > +    (build-system gnu-build-system)
> >> > +    (arguments
> >> > +     '(#:phases
> >> > +       (modify-phases %standard-phases
> >> > +         (replace 'configure
> >> > +           (lambda* (#:key inputs #:allow-other-keys)
> >> > +             ; needs to load cairo dynamically
> >> > +             (let* ((cairo (string-append
> >> > +                             (assoc-ref inputs "cairo") "/lib"
> >> > )))
> >> > +               (setenv "LD_LIBRARY_PATH" cairo ))
> >> > +
> >> > +             ; FIXME: Skip GTK tests:
> >> > +             ;   gtk3 - can't get it to run with the xorg-server
> >> > config below
> >> > +             ;          and some non-gtk tests will also fail
> >> > +             ;   gtk2 - lots of functions aren't implemented
> >> > +             ; We choose gtk2 as the lesser evil and simply skip
> >> > the test.
> >> > +             ; as of 22/08/2016 awesome is the only package
> >> > dependent on lgi but
> >> > +             ; it doesn't need or interact with gtk using lgi.
> >> > +             (substitute* "./tests/test.lua"
> >> > +                        (("'gtk.lua',") "-- 'gtk.lua',"))
> >> > +             ; lua version and therefore install directories are
> >> > hardcoded
> >> > +             (substitute* "./lgi/Makefile"
> >> > +                        (("LUA_VERSION=5.1") "LUA_VERSION=5.2"))
> >> > +
> >> > +             ;; There must be a running X server during tests.
> >> > +             (system (format #f "~a/bin/Xvfb :1 &" (assoc-ref
> >> > inputs "xorg-server")))
> >> > +             (setenv "DISPLAY" ":1"))))
> >> > +
> >> > +       #:make-flags
> >> > +         (let ((out (assoc-ref %outputs "out")))
> >> > +           (list "CC=gcc"
> >> > +             (string-append "PREFIX=" (assoc-ref %outputs
> >> > "out")))))) +
> >> > +    (inputs
> >> > +     `(("gobject-introspection" ,gobject-introspection)
> >> > +       ("glib" ,glib)
> >> > +       ("pango", pango)
> >> > +       ("gtk", gtk+-2)
> >> > +       ("lua" ,lua)
> >> > +       ("cairo" ,cairo)
> >> > +       ("libffi" ,libffi)
> >> > +       ("xorg-server", xorg-server)))
> >> > +    (native-inputs
> >> > +     `(("pkg-config" ,pkg-config)))
> >> > +    (home-page "https://github.com/pavouk/lgi/")
> >> > +    (synopsis "Lua bridge to GObject based libraries")
> >> > +    (description
> >> > +     "LGI is gobject-introspection based dynamic Lua binding to
> >> > GObject +based libraries.  It allows using GObject-based
> >> > libraries directly from Lua. +Notable examples are GTK+,
> >> > GStreamer and Webkit.")
> >> > +    (license expat)))
> >> > -- 
> >> > 2.9.3
> >> >
> >> > From f75ac65b1eeafe333b486a98cc0bb4ad55d67ee7 Mon Sep 17 00:00:00
> >> > 2001 From: doncatnip <gnopap@gmail.com>
> >> > Date: Thu, 25 Aug 2016 02:31:07 +0200
> >> > Subject: [PATCH 3/3] gnu: wm: Add awesome-3.5.
> >> >
> >> > * gnu/packages/wm.scm (awesome-3.5): New variable.
> >> > ---
> >> >  gnu/packages/wm.scm | 89
> >> > +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file
> >> > changed, 89 insertions(+)
> >> >
> >> > diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
> >> > index 2cc9f44..ff21da8 100644
> >> > --- a/gnu/packages/wm.scm
> >> > +++ b/gnu/packages/wm.scm
> >> > @@ -9,6 +9,7 @@
> >> >  ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
> >> >  ;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
> >> >  ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
> >> > +;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
> >> >  ;;;
> >> >  ;;; This file is part of GNU Guix.
> >> >  ;;;
> >> > @@ -465,3 +466,91 @@ 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/")))
> >> > +
> >> > +(define-public awesome-3.5
> >> > +  (package (inherit awesome)
> >> > +    (version "3.5.9")
> >> > +    (source (origin
> >> > +      (method url-fetch)
> >> > +      (uri (string-append
> >> > +            "https://awesome.naquadah.org/download/awesome-"
> >> > +            version ".tar.xz"))
> >> > +      (sha256 (base32
> >> > "0kynair1ykr74b39a4gcm2y24viial64337cf26nhlc7azjbby67"))
> >> > +      (modules '((guix build utils)
> >> > +                 (srfi srfi-19)))
> >> > +      (snippet
> >> > +              ;; Remove non-reproducible timestamp and use the
> >> > date of the
> >> > +              ;; source file instead.
> >> > +              '(substitute* "common/version.c"
> >> > +                 (("__DATE__ \" \" __TIME__")
> >> > +                  (date->string
> >> > +                   (time-utc->date
> >> > +                    (make-time time-utc 0
> >> > +                               (stat:mtime (stat "awesome.c"))))
> >> > +                   "\"~c\""))))
> >> > +             (patches (search-patches
> >> > "awesome-reproducible-png.patch")))) +
> >> > +    (inputs `(("gobject-introspection" ,gobject-introspection)
> >> > +              ("lua-lgi",lua-lgi)
> >> > +              ("cairo" ,cairo)
> >> > +              ("dbus" ,dbus)
> >> > +              ("gdk-pixbuf" ,gdk-pixbuf)
> >> > +              ("glib" ,glib)
> >> > +              ("imlib2" ,imlib2)
> >> > +              ("libev" ,libev)
> >> > +              ("libxcb" ,libxcb)
> >> > +              ("libxcursor" ,libxcursor)
> >> > +              ("libxdg-basedir" ,libxdg-basedir)
> >> > +              ("lua" ,lua)
> >> > +              ("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)))
> >> > +
> >> > +    (arguments
> >> > +     `(;; Let compression happen in our 'compress-documentation'
> >> > phase so that
> >> > +       ;; '--no-name' is used, which removes timestamps from
> >> > gzip output.
> >> > +       #:configure-flags '("-DCOMPRESS_MANPAGES=off")
> >> > +
> >> > +       #:phases (modify-phases %standard-phases
> >> > +                  (add-before 'build 'xmlto-skip-validation
> >> > +                    (lambda _
> >> > +                      ;; We can't download the necessary schema,
> >> > so so skip
> >> > +                      ;; validation and assume they're valid.
> >> > +                      (substitute*
> >> > "../build/CMakeFiles/man.dir/build.make"
> >> > +                        (("/xmlto")
> >> > +                         (string-append "/xmlto
> >> > --skip-validation")))
> >> > +                      #t))
> >> > +                  (add-before 'configure 'set-lua-paths
> >> > +                    (lambda* (#:key inputs #:allow-other-keys)
> >> > +                      ; needs to load cairo dynamically
> >> > +                      (let* ((cairo (string-append
> >> > +                                      (assoc-ref inputs "cairo")
> >> > "/lib" ))
> >> > +                             (lua-lgi (assoc-ref inputs
> >> > "lua-lgi") ))
> >> > +                        (setenv "LD_LIBRARY_PATH" cairo )
> >> > +                        (setenv "LUA_PATH" (string-append
> >> > +                                    lua-lgi
> >> > "/share/lua/5.2/?.lua"))
> >> > +                        (setenv "LUA_CPATH" (string-append
> >> > +                                    lua-lgi
> >> > "/lib/lua/5.2/?.so")))))
> >> > +                  (replace 'check
> >> > +                    (lambda _
> >> > +                      ;; There aren't any tests, so just make
> >> > sure the binary
> >> > +                      ;; gets built and can be run successfully.
> >> > +                      (zero? (system* "../build/awesome"
> >> > "-v"))))
> >> > +                  (add-after 'install 'wrap
> >> > +                    (lambda* (#:key inputs outputs
> >> > #:allow-other-keys)
> >> > +                      (let* ((awesome (assoc-ref outputs "out"))
> >> > +                             (cairo (string-append
> >> > +                                      (assoc-ref inputs "cairo")
> >> > "/lib" ))
> >> > +                             (lua-lgi (assoc-ref inputs
> >> > "lua-lgi") ))
> >> > +                        (wrap-program (string-append awesome
> >> > "/bin/awesome")
> >> > +                          `("GI_TYPELIB_PATH" ":" prefix
> >> > (,(getenv "GI_TYPELIB_PATH")))
> >> > +                          `("LD_LIBRARY_PATH" suffix (, cairo))
> >> > +                          `("LUA_PATH" suffix (,(string-append
> >> > +                                lua-lgi
> >> > "/share/lua/5.2/?.lua")))
> >> > +                          `("LUA_CPATH" suffix (,(string-append
> >> > +                                lua-lgi
> >> > "/lib/lua/5.2/?.so")))))))))))) -- 
> >> > 2.9.3
> >> >    
> >>   
> >  
>
gno Aug. 25, 2016, 5:26 p.m. UTC | #7
On Thu, 25 Aug 2016 14:47:19 +0000
ng0 <ng0@we.make.ritual.n0.is> wrote:

I'm sorry, I just don't really know what to say about this as my
experience with hardening is rather non-existant. I can sure find out
how to disable dbus and submit another patch.

> ng0 <ng0@we.make.ritual.n0.is> writes:
> 
> >> Works for me (written from inside a running awesome-3.5.9).  
> >
> > ng0@shadowwalker ~$ awesome --version
> > awesome v3.5.9 (Mighty Ravendark)
> > • Build: Sun Mar 06 14:05:54Z 2016 for x86_64 by gcc version 4.9.3
> > (@) • Compiled against Lua 5.2.4 (running with Lua 5.2)
> > • D-Bus support: ✔  
> 
> Great, the joy of a limited font... Nevermind this message then for
> obvious reasons but rather take it as a note that dbus and hardening
> is something we need to watch in the future ;)
> 
> > Having no dbus support will help with eventual hardening of Guix,
> > but why do we not have it in awesome? 
> > And why would we we need it (dbus support) at all? I don't even
> > know why I used to build it with dbus support before. Works either
> > way.  
>
non such Aug. 26, 2016, 1:33 p.m. UTC | #8
doncatnip <gnopap@gmail.com> writes:

> On Thu, 25 Aug 2016 14:47:19 +0000
> ng0 <ng0@we.make.ritual.n0.is> wrote:
>
> I'm sorry, I just don't really know what to say about this as my
> experience with hardening is rather non-existant. I can sure find out
> how to disable dbus and submit another patch.

No, this was not my intention. The patch looks good to me.
Now only someone with commit access needs to review, as I do not have
commit access.

>> ng0 <ng0@we.make.ritual.n0.is> writes:
>> 
>> >> Works for me (written from inside a running awesome-3.5.9).  
>> >
>> > ng0@shadowwalker ~$ awesome --version
>> > awesome v3.5.9 (Mighty Ravendark)
>> > • Build: Sun Mar 06 14:05:54Z 2016 for x86_64 by gcc version 4.9.3
>> > (@) • Compiled against Lua 5.2.4 (running with Lua 5.2)
>> > • D-Bus support: ✔  
>> 
>> Great, the joy of a limited font... Nevermind this message then for
>> obvious reasons but rather take it as a note that dbus and hardening
>> is something we need to watch in the future ;)
>> 
>> > Having no dbus support will help with eventual hardening of Guix,
>> > but why do we not have it in awesome? 
>> > And why would we we need it (dbus support) at all? I don't even
>> > know why I used to build it with dbus support before. Works either
>> > way.  
>> 
>
gno Aug. 26, 2016, 3:19 p.m. UTC | #9
On Thu, 25 Aug 2016 09:59:51 +0000
ng0 <ng0@we.make.ritual.n0.is> wrote:

> > Works for me (written from inside a running awesome-3.5.9).  
> 
> ng0@shadowwalker ~$ awesome --version
> awesome v3.5.9 (Mighty Ravendark)
> • Build: Sun Mar 06 14:05:54Z 2016 for x86_64 by gcc version 4.9.3 (@)
> • Compiled against Lua 5.2.4 (running with Lua 5.2)
> • D-Bus support: ✔
> 
> Having no dbus support will help with eventual hardening of Guix,
> but why do we not have it in awesome? 
> And why would we we need it (dbus support) at all? I don't even know
> why I used to build it with dbus support before. Works either way.

Actually, personally I'd perefer keeping dbus support for
notifications. Different variants would be nice. Something akin to
gentoo make flags, no ?
Leo Famulari Aug. 30, 2016, 6:56 a.m. UTC | #10
On Thu, Aug 25, 2016 at 03:09:33AM +0200, gno wrote:
> Sure hope I'm doing this right as I'm new to this.
> These patches add Awesome 3.5.9 to the repository. I decided against
> updating since it may break peoples configurations. Awesome had API
> changes in between 3.4 and 3.5.
> 
> Please have a look.

Thanks for these patches! We need to figure out the Lua issue, and I've
replied in the Lua / Prosody thread.

> Subject: [PATCH 2/3] gnu: lua: Add lua-lgi.
> 
> * gnu/packages/lua.scm (lua-lgi): New variable.

> +         (replace 'configure

I think we should just delete the configure phase if there is no
'./configure' script.

> +           (lambda* (#:key inputs #:allow-other-keys)
> +             ; needs to load cairo dynamically
> +             (let* ((cairo (string-append
> +                             (assoc-ref inputs "cairo") "/lib" )))
> +               (setenv "LD_LIBRARY_PATH" cairo ))

This can go in a 'set-env' phase.

> +
> +             ; FIXME: Skip GTK tests:
> +             ;   gtk3 - can't get it to run with the xorg-server config below
> +             ;          and some non-gtk tests will also fail
> +             ;   gtk2 - lots of functions aren't implemented
> +             ; We choose gtk2 as the lesser evil and simply skip the test.
> +             ; as of 22/08/2016 awesome is the only package dependent on lgi but
> +             ; it doesn't need or interact with gtk using lgi.
> +             (substitute* "./tests/test.lua"
> +                        (("'gtk.lua',") "-- 'gtk.lua',"))

This should go in a 'disable-tests' phase.

> +             ; lua version and therefore install directories are hardcoded
> +             (substitute* "./lgi/Makefile"
> +                        (("LUA_VERSION=5.1") "LUA_VERSION=5.2"))

Again, in its own phase. I'm not sure what to call it :)

> +             ;; There must be a running X server during tests.
> +             (system (format #f "~a/bin/Xvfb :1 &" (assoc-ref inputs "xorg-server")))
> +             (setenv "DISPLAY" ":1"))))

This should go in a phase with a name like "start-x-server' before the
check phase.

> +       #:make-flags
> +         (let ((out (assoc-ref %outputs "out")))

Is binding this 'out' variable necessary when it gets recreated in the
string-append below?

> +           (list "CC=gcc"
> +             (string-append "PREFIX=" (assoc-ref %outputs "out"))))))

> Subject: [PATCH 3/3] gnu: wm: Add awesome-3.5.
> 
> * gnu/packages/wm.scm (awesome-3.5): New variable.

> +(define-public awesome-3.5
> +  (package (inherit awesome)
> +    (version "3.5.9")

Is there upstream support for the 3.4 series? We shouldn't keep it if
it's unsupported, in my opinion.

> +      (snippet
> +              ;; Remove non-reproducible timestamp and use the date of the
> +              ;; source file instead.

Thanks for paying attention to this issue. Our unwritten convention is
to take the value of the environment SOURCE_DATE_EPOCH. Can you do that
instead? There are examples in the Erlang package if you need them.

Thanks again for these patches!

Let's fix our Lua packaging. And, can you send revised versions of
patches 2 and 3 from this series?
gno Aug. 30, 2016, 8:52 a.m. UTC | #11
On 8/30/2016 8:56 AM, Leo Famulari wrote:

> On Thu, Aug 25, 2016 at 03:09:33AM +0200, gno wrote:
>> Sure hope I'm doing this right as I'm new to this.
>> These patches add Awesome 3.5.9 to the repository. I decided against
>> updating since it may break peoples configurations. Awesome had API
>> changes in between 3.4 and 3.5.
>>
>> Please have a look.
> Thanks for these patches! We need to figure out the Lua issue, and I've
> replied in the Lua / Prosody thread.
>
>> Subject: [PATCH 2/3] gnu: lua: Add lua-lgi.
>>
>> * gnu/packages/lua.scm (lua-lgi): New variable.
>> +         (replace 'configure
> I think we should just delete the configure phase if there is no
> './configure' script.
>
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             ; needs to load cairo dynamically
>> +             (let* ((cairo (string-append
>> +                             (assoc-ref inputs "cairo") "/lib" )))
>> +               (setenv "LD_LIBRARY_PATH" cairo ))
> This can go in a 'set-env' phase.
>
>> +
>> +             ; FIXME: Skip GTK tests:
>> +             ;   gtk3 - can't get it to run with the xorg-server config below
>> +             ;          and some non-gtk tests will also fail
>> +             ;   gtk2 - lots of functions aren't implemented
>> +             ; We choose gtk2 as the lesser evil and simply skip the test.
>> +             ; as of 22/08/2016 awesome is the only package dependent on lgi but
>> +             ; it doesn't need or interact with gtk using lgi.
>> +             (substitute* "./tests/test.lua"
>> +                        (("'gtk.lua',") "-- 'gtk.lua',"))
> This should go in a 'disable-tests' phase.
>
>> +             ; lua version and therefore install directories are hardcoded
>> +             (substitute* "./lgi/Makefile"
>> +                        (("LUA_VERSION=5.1") "LUA_VERSION=5.2"))
> Again, in its own phase. I'm not sure what to call it :)
>
>> +             ;; There must be a running X server during tests.
>> +             (system (format #f "~a/bin/Xvfb :1 &" (assoc-ref inputs "xorg-server")))
>> +             (setenv "DISPLAY" ":1"))))
> This should go in a phase with a name like "start-x-server' before the
> check phase.
>
>> +       #:make-flags
>> +         (let ((out (assoc-ref %outputs "out")))
> Is binding this 'out' variable necessary when it gets recreated in the
> string-append below?
>
>> +           (list "CC=gcc"
>> +             (string-append "PREFIX=" (assoc-ref %outputs "out"))))))
>> Subject: [PATCH 3/3] gnu: wm: Add awesome-3.5.
>>
>> * gnu/packages/wm.scm (awesome-3.5): New variable.
>> +(define-public awesome-3.5
>> +  (package (inherit awesome)
>> +    (version "3.5.9")
> Is there upstream support for the 3.4 series? We shouldn't keep it if
> it's unsupported, in my opinion.
Personally, I'd be fine with a replacement instead. I just recently 
figured awesome was only added like a month or two ago. I didn't want to 
break peoples desktop, but I guess there aren't that many yet.
>
>> +      (snippet
>> +              ;; Remove non-reproducible timestamp and use the date of the
>> +              ;; source file instead.
> Thanks for paying attention to this issue. Our unwritten convention is
> to take the value of the environment SOURCE_DATE_EPOCH. Can you do that
> instead? There are examples in the Erlang package if you need them.
>
> Thanks again for these patches!
>
> Let's fix our Lua packaging. And, can you send revised versions of
> patches 2 and 3 from this series?

Working on it. I might nag you with questions soon. The snippet is just 
a lazy copy-paste from awesome 3.4 since my knowledge isn't where it 
should be yet.

Thanks for all the advice ! :)
Leo Famulari Aug. 30, 2016, 6:26 p.m. UTC | #12
On Tue, Aug 30, 2016 at 10:52:08AM +0200, gno wrote:
> > Let's fix our Lua packaging. And, can you send revised versions of
> > patches 2 and 3 from this series?
> 
> Working on it. I might nag you with questions soon. The snippet is just a
> lazy copy-paste from awesome 3.4 since my knowledge isn't where it should be
> yet.

Okay, looking forward to it :)
diff mbox

Patch

From f75ac65b1eeafe333b486a98cc0bb4ad55d67ee7 Mon Sep 17 00:00:00 2001
From: doncatnip <gnopap@gmail.com>
Date: Thu, 25 Aug 2016 02:31:07 +0200
Subject: [PATCH 3/3] gnu: wm: Add awesome-3.5.

* gnu/packages/wm.scm (awesome-3.5): New variable.
---
 gnu/packages/wm.scm | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 2cc9f44..ff21da8 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -9,6 +9,7 @@ 
 ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
 ;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -465,3 +466,91 @@  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/")))
+
+(define-public awesome-3.5
+  (package (inherit awesome)
+    (version "3.5.9")
+    (source (origin
+      (method url-fetch)
+      (uri (string-append
+            "https://awesome.naquadah.org/download/awesome-"
+            version ".tar.xz"))
+      (sha256 (base32 "0kynair1ykr74b39a4gcm2y24viial64337cf26nhlc7azjbby67"))
+      (modules '((guix build utils)
+                 (srfi srfi-19)))
+      (snippet
+              ;; Remove non-reproducible timestamp and use the date of the
+              ;; source file instead.
+              '(substitute* "common/version.c"
+                 (("__DATE__ \" \" __TIME__")
+                  (date->string
+                   (time-utc->date
+                    (make-time time-utc 0
+                               (stat:mtime (stat "awesome.c"))))
+                   "\"~c\""))))
+             (patches (search-patches "awesome-reproducible-png.patch"))))
+
+    (inputs `(("gobject-introspection" ,gobject-introspection)
+              ("lua-lgi",lua-lgi)
+              ("cairo" ,cairo)
+              ("dbus" ,dbus)
+              ("gdk-pixbuf" ,gdk-pixbuf)
+              ("glib" ,glib)
+              ("imlib2" ,imlib2)
+              ("libev" ,libev)
+              ("libxcb" ,libxcb)
+              ("libxcursor" ,libxcursor)
+              ("libxdg-basedir" ,libxdg-basedir)
+              ("lua" ,lua)
+              ("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)))
+
+    (arguments
+     `(;; Let compression happen in our 'compress-documentation' phase so that
+       ;; '--no-name' is used, which removes timestamps from gzip output.
+       #:configure-flags '("-DCOMPRESS_MANPAGES=off")
+
+       #:phases (modify-phases %standard-phases
+                  (add-before 'build 'xmlto-skip-validation
+                    (lambda _
+                      ;; We can't download the necessary schema, so so skip
+                      ;; validation and assume they're valid.
+                      (substitute* "../build/CMakeFiles/man.dir/build.make"
+                        (("/xmlto")
+                         (string-append "/xmlto --skip-validation")))
+                      #t))
+                  (add-before 'configure 'set-lua-paths
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      ; needs to load cairo dynamically
+                      (let* ((cairo (string-append
+                                      (assoc-ref inputs "cairo") "/lib" ))
+                             (lua-lgi (assoc-ref inputs "lua-lgi") ))
+                        (setenv "LD_LIBRARY_PATH" cairo )
+                        (setenv "LUA_PATH" (string-append
+                                    lua-lgi "/share/lua/5.2/?.lua"))
+                        (setenv "LUA_CPATH" (string-append
+                                    lua-lgi "/lib/lua/5.2/?.so")))))
+                  (replace 'check
+                    (lambda _
+                      ;; There aren't any tests, so just make sure the binary
+                      ;; gets built and can be run successfully.
+                      (zero? (system* "../build/awesome" "-v"))))
+                  (add-after 'install 'wrap
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let* ((awesome (assoc-ref outputs "out"))
+                             (cairo (string-append
+                                      (assoc-ref inputs "cairo") "/lib" ))
+                             (lua-lgi (assoc-ref inputs "lua-lgi") ))
+                        (wrap-program (string-append awesome "/bin/awesome")
+                          `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))
+                          `("LD_LIBRARY_PATH" suffix (, cairo))
+                          `("LUA_PATH" suffix (,(string-append
+                                lua-lgi "/share/lua/5.2/?.lua")))
+                          `("LUA_CPATH" suffix (,(string-append
+                                lua-lgi "/lib/lua/5.2/?.so"))))))))))))
-- 
2.9.3