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