Commit | Line | Data |
---|---|---|
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> |
47956fa0 | 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")) | |
17acac51 | 37 | (package |
38 | (name "guile-xcb") | |
39 | (version (git-version "1.3" revision commit)) | |
40 | (source (origin | |
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)) | |
46 | (sha256 | |
47 | (base32 | |
48 | "16w4vgzbmnwih4bgfn8rw85ryfvzhc6hyly6bic9sd7hhc82rcnd")))) | |
49 | (build-system gnu-build-system) | |
50 | (arguments '(;; Parallel builds fail. | |
51 | #:parallel-build? #f | |
52 | #:configure-flags (list (string-append | |
53 | "--with-guile-site-dir=" | |
54 | (assoc-ref %outputs "out") | |
55 | "/share/guile/site/2.2") | |
56 | (string-append | |
57 | "--with-guile-site-ccache-dir=" | |
58 | (assoc-ref %outputs "out") | |
f2d49440 | 59 | "/lib/guile/2.2/site-ccache")))) |
17acac51 | 60 | (native-inputs `(("pkg-config" ,pkg-config) |
61 | ("texinfo" ,texinfo))) | |
62 | (inputs `(("guile" ,guile-2.2) | |
63 | ("xcb" ,xcb-proto))) | |
64 | (home-page "https://github.com/mwitmer/guile-xcb") | |
65 | (synopsis "XCB bindings for Guile") | |
66 | (description | |
67 | "Guile-XCB implements the XCB protocol and provides all the tools | |
0af626ff LC |
68 | necessary to write X client code in Guile Scheme without any external |
69 | dependencies.") | |
17acac51 | 70 | (license gpl3+)))) |
901eee2c LC |
71 | |
72 | (define-public guile-wm | |
7b453926 | 73 | (let ((commit "f3c7b3be719f425ffb87265d34855a73366351be") |
74 | (revision "1")) | |
5b4e0957 | 75 | (package |
76 | (name "guile-wm") | |
77 | (version (git-version "1.0" revision commit)) | |
78 | (synopsis "X11 window manager toolkit in Scheme") | |
79 | (source (origin | |
80 | (method git-fetch) | |
81 | (uri (git-reference | |
82 | (url "https://github.com/mwitmer/guile-wm") | |
83 | (commit commit))) | |
84 | (file-name (git-file-name name version)) | |
85 | (sha256 | |
86 | (base32 | |
87 | "086dijnpl5dpglf70d6f9sizyakr313y7blpdjrmbi687j1x3qcl")))) | |
88 | (build-system gnu-build-system) | |
89 | (arguments | |
90 | `( ;; The '.scm' files go to $(datadir), so set that to the | |
91 | ;; standard value. | |
92 | #:configure-flags (list (string-append "--datadir=" | |
93 | (assoc-ref %outputs "out") | |
94 | "/share/guile/site/2.2")) | |
95 | #:phases | |
96 | (modify-phases %standard-phases | |
97 | (add-before 'configure 'set-go-directory | |
98 | (lambda* (#:key outputs #:allow-other-keys) | |
99 | ;; Install .go files to $out/share/guile/site/2.2. | |
100 | (let ((out (assoc-ref outputs "out"))) | |
101 | (substitute* "module/Makefile.in" | |
102 | (("^wmdir = .*$") | |
103 | (string-append "wmdir = " out | |
104 | "/share/guile/site/2.2\n")))) | |
105 | #t)) | |
106 | (add-after 'install 'set-load-path | |
107 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
108 | ;; Put Guile-XCB's and Guile-WM's modules in the | |
109 | ;; search path of PROG. | |
110 | (let* ((out (assoc-ref outputs "out")) | |
111 | (prog (string-append out "/bin/guile-wm")) | |
112 | (mods (string-append | |
113 | out "/share/guile/site/2.2")) | |
114 | (xcb (string-append | |
115 | (assoc-ref inputs "guile-xcb") | |
116 | "/share/guile/site/2.2"))) | |
117 | (wrap-program | |
118 | prog | |
119 | `("GUILE_LOAD_PATH" ":" prefix (,mods ,xcb)) | |
120 | `("GUILE_LOAD_COMPILED_PATH" ":" prefix | |
121 | (,mods ,xcb)))) | |
122 | #t)) | |
123 | (add-after 'install 'install-xsession | |
124 | (lambda* (#:key outputs #:allow-other-keys) | |
125 | ;; add a .desktop file to xsessions | |
126 | (let ((xsessions (string-append | |
127 | %output "/share/xsessions"))) | |
128 | (mkdir-p xsessions) | |
129 | (call-with-output-file (string-append | |
130 | xsessions "/guile-wm.desktop") | |
131 | (lambda (port) | |
132 | (format port | |
133 | "[Desktop Entry]~@ | |
23de5cbd AW |
134 | Name=~a~@ |
135 | Comment=~a~@ | |
136 | Exec=~a/bin/guile-wm~@ | |
137 | Type=Application~%" | |
5b4e0957 | 138 | ,name ,synopsis %output)))) |
139 | #t))))) | |
140 | (native-inputs `(("pkg-config" ,pkg-config) | |
141 | ("texinfo" ,texinfo))) | |
142 | (inputs `(("guile" ,guile-2.2) | |
143 | ("guile-xcb" ,guile-xcb))) | |
144 | (home-page "https://github.com/mwitmer/guile-wm/releases") | |
145 | (description | |
146 | "Guile-WM is a simple window manager that's completely customizable—you | |
901eee2c LC |
147 | have total control of what it does by choosing which modules to include. |
148 | Included with it are a few modules that provide basic TinyWM-like window | |
149 | management, some window record-keeping, multi-monitor support, and emacs-like | |
35b9e423 | 150 | keymaps and minibuffer. At this point, it's just enough to get you started.") |
5b4e0957 | 151 | (license gpl3+)))) |