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