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>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
31 (define-public guile-xcb
37 (uri (string-append "http://web.archive.org/web/20150803094848/"
38 "http://www.markwitmer.com/dist/guile-xcb-"
42 "04dvbqdrrs67490gn4gkq9zk8mqy3mkls2818ha4p0ckhh0pm149"))))
43 (build-system gnu-build-system)
44 (arguments '(;; Parallel builds fail.
47 #:configure-flags (list (string-append
48 "--with-guile-site-dir="
49 (assoc-ref %outputs "out")
50 "/share/guile/site/2.0")
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)
58 (home-page "http://www.markwitmer.com/guile-xcb/guile-xcb.html")
59 (synopsis "XCB bindings for Guile")
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
66 (define-public guile-wm
70 (synopsis "X11 window manager toolkit in Scheme")
73 (uri (string-append "http://web.archive.org/web/20161005084324/"
74 "http://www.markwitmer.com/dist/guile-wm-"
78 "1l9qcz236jxvryndimjy62cf8zxf8i3f8vg3zpqqjhw15j9mdk3r"))))
79 (build-system gnu-build-system)
81 `( ;; The '.scm' files go to $(datadir), so set that to the
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"
93 (string-append "wmdir = " out
94 "/share/guile/site/2.0\n")))))
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"))
103 out "/share/guile/site/2.0"))
105 (assoc-ref inputs "guile-xcb")
106 "/share/guile/site/2.0")))
109 `("GUILE_LOAD_PATH" ":" prefix (,mods ,xcb))
110 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
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")))
119 (call-with-output-file (string-append
120 xsessions "/guile-wm.desktop")
126 Exec=~a/bin/guile-wm~@
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")
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.")