gnu: system: Build /etc/localtime.
[jackhill/guix/guix.git] / gnu / packages / guile-wm.scm
CommitLineData
0af626ff
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages guile-wm)
20 #:use-module (guix licenses)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages xorg)
23 #:use-module (gnu packages guile)
24 #:use-module (gnu packages pkg-config)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu))
28
29(define-public guile-xcb
30 (package
31 (name "guile-xcb")
32 (version "1.2")
33 (source (origin
34 (method url-fetch)
35 (uri (string-append "http://www.markwitmer.com/dist/guile-xcb-"
36 version ".tar.gz"))
37 (sha256
38 (base32
39 "009qrw46ay74z3mw8gz7jqvn90z9ilyhy00801w5vpyias02730y"))))
40 (build-system gnu-build-system)
41 (arguments '(;; Parallel builds fail.
42 #:parallel-build? #f
43
44 ;; The '.scm' files go to $(datadir), so set that to the
45 ;; standard value.
46 #:configure-flags (list (string-append
47 "--datadir="
48 (assoc-ref %outputs "out")
49 "/share/guile/site/2.0"))
50 #:phases (alist-cons-before
51 'configure 'set-go-directory
52 (lambda* (#:key outputs #:allow-other-keys)
53 ;; The makefile sets the .go directory to Guile's
54 ;; own .go site directory, which is read-only.
55 ;; Change it to point to $out/share/guile/site/2.0.
56 (let ((out (assoc-ref outputs "out")))
57 (substitute* "Makefile.in"
58 (("^godir = .*$")
59 (string-append "godir = " out
60 "/share/guile/site/2.0\n")))))
61 %standard-phases)))
62 (native-inputs `(("pkg-config" ,pkg-config)))
63 (inputs `(("guile" ,guile-2.0)
64 ("xcb" ,xcb-proto)))
65 (home-page "http://www.markwitmer.com/guile-xcb/guile-xcb.html")
66 (synopsis "XCB bindings for Guile")
67 (description
68 "Guile-XCB implements the XCB protocol and provides all the tools
69necessary to write X client code in Guile Scheme without any external
70dependencies.")
71 (license gpl3+)))
901eee2c
LC
72
73(define-public guile-wm
74 (package
75 (name "guile-wm")
76 (version "0.2")
77 (source (origin
78 (method url-fetch)
79 (uri (string-append "http://www.markwitmer.com/dist/guile-wm-"
80 version ".tar.gz"))
81 (sha256
82 (base32
83 "0vv6avpkl6lgrhy2a16z470fqjhvzi4r93qwl87xw9v5dvldf08p"))))
84 (build-system gnu-build-system)
85 (arguments '(;; The '.scm' files go to $(datadir), so set that to the
86 ;; standard value.
87 #:configure-flags (list (string-append "--datadir="
88 (assoc-ref %outputs "out")
89 "/share/guile/site/2.0"))
90 #:phases (alist-cons-before
91 'configure 'set-go-directory
92 (lambda* (#:key outputs #:allow-other-keys)
93 ;; Install .go files to $out/share/guile/site/2.0.
94 (let ((out (assoc-ref outputs "out")))
95 (substitute* "module/Makefile.in"
96 (("^wmdir = .*$")
97 (string-append "wmdir = " out
98 "/share/guile/site/2.0\n")))))
99 (alist-cons-after
100 'install 'set-load-path
101 (lambda* (#:key inputs outputs #:allow-other-keys)
102 ;; Put Guile-XCB's and Guile-WM's modules in the
103 ;; search path of PROG.
104 (let* ((out (assoc-ref outputs "out"))
105 (prog (string-append out "/bin/guile-wm"))
106 (mods (string-append
107 out "/share/guile/site/2.0"))
108 (xcb (string-append
109 (assoc-ref inputs "guile-xcb")
110 "/share/guile/site/2.0")))
111 (wrap-program
112 prog
113 `("GUILE_LOAD_PATH" ":" prefix (,mods ,xcb))
114 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
115 (,mods ,xcb)))))
116 %standard-phases))))
117 (native-inputs `(("pkg-config" ,pkg-config)))
118 (inputs `(("guile" ,guile-2.0)
119 ("guile-xcb" ,guile-xcb)))
120 (home-page "http://www.markwitmer.com/guile-xcb/guile-wm.html")
121 (synopsis "X11 window manager toolkit in Scheme")
122 (description
123 "Guile-WM is a simple window manager that's completely customizable—you
124have total control of what it does by choosing which modules to include.
125Included with it are a few modules that provide basic TinyWM-like window
126management, some window record-keeping, multi-monitor support, and emacs-like
127keymaps and minibuffer. At this point, it's just enough to get you started.")
128 (license gpl3+)))