unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: awesome: Add awesome-3.5
@ 2016-08-25  1:09 gno
  2016-08-25  9:22 ` ng0
  2016-08-30  6:56 ` Leo Famulari
  0 siblings, 2 replies; 13+ messages in thread
From: gno @ 2016-08-25  1:09 UTC (permalink / raw)
  To: guix-devel

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

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-lua-Enable-dynamic-library-support.patch --]
[-- Type: text/x-patch, Size: 1363 bytes --]

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


[-- Attachment #3: 0002-gnu-lua-Add-lua-lgi.patch --]
[-- Type: text/x-patch, Size: 3753 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-gnu-wm-Add-awesome-3.5.patch --]
[-- Type: text/x-patch, Size: 5513 bytes --]

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


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

end of thread, other threads:[~2016-08-30 18:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-25  1:09 [PATCH] gnu: awesome: Add awesome-3.5 gno
2016-08-25  9:22 ` ng0
2016-08-25  9:37   ` ng0
2016-08-25  9:59     ` ng0
2016-08-25 14:47       ` ng0
2016-08-25 17:26         ` doncatnip
2016-08-26 13:33           ` ng0
2016-08-26 15:19       ` doncatnip
     [not found]   ` <20160825172521.19de318e@gmail.com>
2016-08-25 14:50     ` ng0
2016-08-25 17:24       ` doncatnip
2016-08-30  6:56 ` Leo Famulari
2016-08-30  8:52   ` gno
2016-08-30 18:26     ` Leo Famulari

Code repositories for project(s) associated with this public inbox

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

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