gnu: Use 'modify-phases' syntax.
[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 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages sawfish)
20 #:use-module ((guix licenses) #:select (gpl2+))
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages autotools)
26 #:use-module (gnu packages databases)
27 #:use-module (gnu packages gettext)
28 #:use-module (gnu packages gtk)
29 #:use-module (gnu packages libffi)
30 #:use-module (gnu packages multiprecision)
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages readline)
33 #:use-module (gnu packages texinfo)
34 #:use-module (gnu packages base)
35 #:use-module (gnu packages xorg))
36
37 (define-public librep
38 (package
39 (name "librep")
40 (version "0.92.6")
41 (source (origin
42 (method url-fetch)
43 (uri (string-append "http://download.tuxfamily.org/" name "/"
44 name "_" version ".tar.xz"))
45 (sha256
46 (base32
47 "1k6c0hmyzxh8459r790slh9vv9vwy9d7w3nlmrqypbx9mk855hgy"))))
48 (build-system gnu-build-system)
49 (arguments
50 '(#:phases (modify-phases %standard-phases
51 (add-after 'unpack 'bootstrap
52 (lambda _
53 ;; The 0.92.6 tarball was not produced by 'make dist'
54 ;; and lacks generated files. Sadness.
55 (zero? (system* "autoreconf" "-vfi")))))))
56 (native-inputs
57 `(("makeinfo" ,texinfo)
58 ("pkg-config" ,pkg-config)
59
60 ("autoconf" ,(autoconf-wrapper))
61 ("automake" ,automake)
62 ("libtool" ,libtool)))
63 (inputs
64 `(("gdbm" ,gdbm)
65 ("gmp" ,gmp)
66 ("libffi" ,libffi)
67 ("readline" ,readline)))
68 (native-search-paths
69 (list (search-path-specification
70 (variable "REP_DL_LOAD_PATH")
71 (files '("lib/rep")))))
72 (home-page "http://sawfish.wikia.com/wiki/Librep")
73 (synopsis "Lisp system for sawfish")
74 (description
75 "Librep is a dialect of Lisp, designed to be used both as an extension
76 language for applications and as a general purpose programming language. It
77 was originally written to be mostly-compatible with Emacs Lisp, but has
78 subsequently diverged markedly. Its aim is to combine the best features of
79 Scheme and Common Lisp and provide an environment that is comfortable for
80 implementing both small and large scale systems.")
81 (license gpl2+)))
82
83 (define-public rep-gtk
84 (package
85 (name "rep-gtk")
86 (version "0.90.8.2")
87 (source (origin
88 (method url-fetch)
89 (uri (string-append "http://download.tuxfamily.org/librep/"
90 name "/" name "_" version ".tar.xz"))
91 (sha256
92 (base32
93 "0qslm2isyv22hffdpw0nh7xk8jw8cj3h5y7d40c9h5r833w7j6sz"))
94 (modules '((guix build utils)))
95 (snippet
96 '(substitute* "Makefile.in"
97 (("installdir=\\$\\(repexecdir\\)")
98 ;; Install libraries for librep to $out/lib/rep.
99 "installdir=$(libdir)/rep")))))
100 (build-system gnu-build-system)
101 (arguments '(#:tests? #f)) ; no tests
102 (native-inputs
103 `(("pkg-config" ,pkg-config)))
104 (propagated-inputs
105 ;; required by rep-gtk.pc.
106 `(("gtk+" ,gtk+-2)
107 ("librep" ,librep)))
108 (home-page "http://sawfish.wikia.com/wiki/Rep-GTK")
109 (synopsis "GTK+ binding for librep")
110 (description
111 "Rep-GTK is a GTK+ (and GLib, GDK) binding to the librep, and one of the
112 backend of Sawfish.")
113 (license gpl2+)))
114
115 (define-public sawfish
116 (package
117 (name "sawfish")
118 (version "1.11")
119 (source (origin
120 (method url-fetch)
121 (uri (string-append "http://download.tuxfamily.org/sawfish/"
122 name "_" version ".tar.xz"))
123 (sha256
124 (base32
125 "0wp4m0p836a0rysbcdqb6z5hxlxqj3rgdbks3bs44rlssx0mcvyg"))
126 (modules '((guix build utils)))
127 (snippet
128 '(begin
129 (substitute* "Makedefs.in"
130 (("/bin/sh") "@SHELL@")
131 (("REP_DL_LOAD_PATH=")
132 ;; To find rep-gtk when building sawfish.
133 "REP_DL_LOAD_PATH=$(REP_DL_LOAD_PATH):"))
134 (substitute* "src/Makefile.in"
135 ;; Install libraries for librep to $out/lib/rep.
136 (("\\$\\(repexecdir\\)") "$(libdir)/rep"))))))
137 (build-system gnu-build-system)
138 (arguments
139 '(#:tests? #f ; no tests
140 #:phases
141 (modify-phases %standard-phases
142 (add-before 'configure 'patch-exec-rep
143 (lambda _
144 (substitute* '("lisp/sawfish/cfg/main.jl.in"
145 "scripts/sawfish-about.jl.in"
146 "scripts/sawfish-client.jl"
147 "scripts/sawfish-menu.jl")
148 (("exec rep") (string-append "exec " (which "rep"))))
149 #t))
150 (add-after 'install 'wrap-scripts
151 ;; Wrap scripts with REP_DL_LOAD_PATH for finding rep-gtk
152 ;; and sawfish.client.
153 (lambda* (#:key outputs #:allow-other-keys)
154 (define (wrap-script script)
155 (let ((out (assoc-ref outputs "out")))
156 (wrap-program (string-append out script)
157 `("REP_DL_LOAD_PATH" =
158 ,(list (getenv "REP_DL_LOAD_PATH")
159 (string-append out "/lib/rep"))))))
160 (for-each wrap-script
161 (list "/bin/sawfish-about"
162 "/bin/sawfish-client"
163 "/bin/sawfish-config"
164 "/lib/sawfish/sawfish-menu"))
165 #t)))))
166 (native-inputs
167 `(("gettext" ,gettext-minimal)
168 ("makeinfo" ,texinfo)
169 ("pkg-config" ,pkg-config)
170 ("which" ,which)))
171 (inputs
172 `(("libsm" ,libsm)
173 ("libxft" ,libxft)
174 ("libxinerama" ,libxinerama)
175 ("libxrandr" ,libxrandr)
176 ("libxtst" ,libxtst)
177 ("rep-gtk" ,rep-gtk)))
178 (home-page "http://sawfish.wikia.com/wiki/Main_Page")
179 (synopsis "Configurable window manager")
180 (description
181 "Sawfish is an extensible window manager using a Lisp-based scripting
182 language. Its policy is very minimal compared to most window managers. Its aim
183 is simply to manage windows in the most flexible and attractive manner possible.
184 All high-level WM functions are implemented in Lisp for future extensibility or
185 redefinition.")
186 (license gpl2+)))