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