gnu: All snippets report errors using exceptions, else return #t.
[jackhill/guix/guix.git] / gnu / packages / sawfish.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
3 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
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 sawfish)
21 #:use-module ((guix licenses) #:select (gpl2+))
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages databases)
28 #:use-module (gnu packages gettext)
29 #:use-module (gnu packages gtk)
30 #:use-module (gnu packages libffi)
31 #:use-module (gnu packages multiprecision)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages readline)
34 #:use-module (gnu packages texinfo)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages xorg))
37
38 (define-public librep
39 (package
40 (name "librep")
41 (version "0.92.7")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append "http://download.tuxfamily.org/" name "/"
45 name "_" version ".tar.xz"))
46 (sha256
47 (base32
48 "1bmcjl1x1rdh514q9z3hzyjmjmwwwkziipjpjsl301bwmiwrd8a8"))))
49 (build-system gnu-build-system)
50 (native-inputs
51 `(("makeinfo" ,texinfo)
52 ("pkg-config" ,pkg-config)
53
54 ("autoconf" ,autoconf-wrapper)
55 ("automake" ,automake)
56 ("libtool" ,libtool)))
57 (inputs
58 `(("gdbm" ,gdbm)
59 ("gmp" ,gmp)
60 ("libffi" ,libffi)
61 ("readline" ,readline)))
62 (native-search-paths
63 (list (search-path-specification
64 (variable "REP_DL_LOAD_PATH")
65 (files '("lib/rep")))))
66 (home-page "http://sawfish.wikia.com/wiki/Librep")
67 (synopsis "Lisp system for sawfish")
68 (description
69 "Librep is a dialect of Lisp, designed to be used both as an extension
70 language for applications and as a general purpose programming language. It
71 was originally written to be mostly-compatible with Emacs Lisp, but has
72 subsequently diverged markedly. Its aim is to combine the best features of
73 Scheme and Common Lisp and provide an environment that is comfortable for
74 implementing both small and large scale systems.")
75 (license gpl2+)))
76
77 (define-public rep-gtk
78 (package
79 (name "rep-gtk")
80 (version "0.90.8.2")
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "http://download.tuxfamily.org/librep/"
84 name "/" name "_" version ".tar.xz"))
85 (sha256
86 (base32
87 "0qslm2isyv22hffdpw0nh7xk8jw8cj3h5y7d40c9h5r833w7j6sz"))
88 (modules '((guix build utils)))
89 (snippet
90 '(begin
91 (substitute* "Makefile.in"
92 (("installdir=\\$\\(repexecdir\\)")
93 ;; Install libraries for librep to $out/lib/rep.
94 "installdir=$(libdir)/rep"))
95 #t))))
96 (build-system gnu-build-system)
97 (arguments '(#:tests? #f)) ; no tests
98 (native-inputs
99 `(("pkg-config" ,pkg-config)))
100 (propagated-inputs
101 ;; required by rep-gtk.pc.
102 `(("gtk+" ,gtk+-2)
103 ("librep" ,librep)))
104 (home-page "http://sawfish.wikia.com/wiki/Rep-GTK")
105 (synopsis "GTK+ binding for librep")
106 (description
107 "Rep-GTK is a GTK+ (and GLib, GDK) binding to the librep, and one of the
108 backend of Sawfish.")
109 (license gpl2+)))
110
111 (define-public sawfish
112 (package
113 (name "sawfish")
114 (version "1.11")
115 (source (origin
116 (method url-fetch)
117 (uri (string-append "http://download.tuxfamily.org/sawfish/"
118 name "_" version ".tar.xz"))
119 (sha256
120 (base32
121 "0wp4m0p836a0rysbcdqb6z5hxlxqj3rgdbks3bs44rlssx0mcvyg"))
122 (modules '((guix build utils)))
123 (snippet
124 '(begin
125 (substitute* "Makedefs.in"
126 (("/bin/sh") "@SHELL@")
127 (("REP_DL_LOAD_PATH=")
128 ;; To find rep-gtk when building sawfish.
129 "REP_DL_LOAD_PATH=$(REP_DL_LOAD_PATH):"))
130 (substitute* "src/Makefile.in"
131 ;; Install libraries for librep to $out/lib/rep.
132 (("\\$\\(repexecdir\\)") "$(libdir)/rep"))
133 #t))))
134 (build-system gnu-build-system)
135 (arguments
136 '(#:tests? #f ; no tests
137 #:phases
138 (modify-phases %standard-phases
139 (add-before 'configure 'patch-exec-rep
140 (lambda _
141 (substitute* '("lisp/sawfish/cfg/main.jl.in"
142 "scripts/sawfish-about.jl.in"
143 "scripts/sawfish-client.jl"
144 "scripts/sawfish-menu.jl")
145 (("exec rep") (string-append "exec " (which "rep"))))
146 #t))
147 (add-after 'install 'wrap-scripts
148 ;; Wrap scripts with REP_DL_LOAD_PATH for finding rep-gtk
149 ;; and sawfish.client.
150 (lambda* (#:key outputs #:allow-other-keys)
151 (define (wrap-script script)
152 (let ((out (assoc-ref outputs "out")))
153 (wrap-program (string-append out script)
154 `("REP_DL_LOAD_PATH" =
155 ,(list (getenv "REP_DL_LOAD_PATH")
156 (string-append out "/lib/rep"))))))
157 (for-each wrap-script
158 (list "/bin/sawfish-about"
159 "/bin/sawfish-client"
160 "/bin/sawfish-config"
161 "/lib/sawfish/sawfish-menu"))
162 #t)))))
163 (native-inputs
164 `(("gettext" ,gettext-minimal)
165 ("makeinfo" ,texinfo)
166 ("pkg-config" ,pkg-config)
167 ("which" ,which)))
168 (inputs
169 `(("libsm" ,libsm)
170 ("libxft" ,libxft)
171 ("libxinerama" ,libxinerama)
172 ("libxrandr" ,libxrandr)
173 ("libxtst" ,libxtst)
174 ("rep-gtk" ,rep-gtk)))
175 (home-page "http://sawfish.wikia.com/wiki/Main_Page")
176 (synopsis "Configurable window manager")
177 (description
178 "Sawfish is an extensible window manager using a Lisp-based scripting
179 language. Its policy is very minimal compared to most window managers. Its aim
180 is simply to manage windows in the most flexible and attractive manner possible.
181 All high-level WM functions are implemented in Lisp for future extensibility or
182 redefinition.")
183 (license gpl2+)))