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