gnu: dealii: Update to 8.5.0.
[jackhill/guix/guix.git] / gnu / packages / wicd.scm
CommitLineData
10b60c04
MW
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3;;; Copyright © 2015 Pierre-Antoine Rault <par@rigelk.eu>
2e88d113 4;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
915363a3 5;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
10b60c04
MW
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 wicd)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system python)
26 #:use-module (guix licenses)
27 #:use-module (guix utils)
7747c4ca 28 #:use-module (gnu packages)
10b60c04
MW
29 #:use-module (gnu packages glib)
30 #:use-module (gnu packages gtk)
800d8d40 31 #:use-module (gnu packages gnome)
10b60c04
MW
32 #:use-module (gnu packages gettext)
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages admin)
35 #:use-module (gnu packages python))
36
37(define-public wicd
38 (package
39 (name "wicd")
f5480572 40 (version "1.7.4")
10b60c04
MW
41 (source
42 (origin
43 (method url-fetch)
44 (uri (string-append "https://launchpad.net/wicd/"
45 (version-major+minor version) "/" version
46 "/+download/wicd-" version ".tar.gz"))
47 (sha256
f5480572 48 (base32 "0qpbwwsrqdp40mm3a8djpn2d055rxxspdhwijwsdnws700a9d637"))
fc1adab1
AK
49 (patches (search-patches
50 "wicd-bitrate-none-fix.patch"
51 "wicd-get-selected-profile-fix.patch"
52 "wicd-urwid-1.3.patch"
53 "wicd-wpa2-ttls.patch"))))
10b60c04 54 (build-system python-build-system)
b94a6ca0 55 (native-inputs `(("gettext" ,gettext-minimal)))
2e88d113 56 (inputs `(("dbus-glib" ,dbus-glib)
10b60c04
MW
57 ("python2-dbus" ,python2-dbus)
58 ("python2-pygtk" ,python2-pygtk)
59 ("python2-urwid" ,python2-urwid)
60 ("python2-babel" ,python2-babel)
61 ("wireless-tools" ,wireless-tools)
62 ("wpa-supplicant" ,wpa-supplicant)
63 ("net-tools" ,net-tools)
64 ("isc-dhcp" ,isc-dhcp)
800d8d40
MW
65 ("iproute" ,iproute)
66 ("hicolor-icon-theme" ,hicolor-icon-theme)))
10b60c04
MW
67 (arguments
68 `(#:python ,python-2
69 #:tests? #f ; test suite requires networking
2cb64f3b
HG
70 ;; wicd directly extends distutils command classes,
71 ;; we can't easily make setup.py use setuptools.
72 #:use-setuptools? #f
10b60c04
MW
73 #:phases
74 (alist-cons-before
75 'build 'configure
76 (lambda* (#:key inputs outputs #:allow-other-keys)
77 (let ((out (assoc-ref outputs "out"))
78 (python (assoc-ref inputs "python")))
79 (define (which* cmd)
80 (cond ((string=? cmd "ping")
81 "/run/setuid-programs/ping")
82 ((which cmd)
83 => identity)
84 (else
85 (format (current-error-port)
86 "WARNING: Unable to find absolute path for ~s~%"
87 cmd)
88 #f)))
89 (substitute* "setup.py"
90 ;; The handling of unrecognized distros in setup.py is
91 ;; broken. Work around the problem.
92 (("\\('init=', " all)
93 (string-append "#" all))
94 ;; Inhibit attempts to install in /var or /etc.
95 (("\\(wpath\\.(log|etc|networks|.*scripts), " all)
96 (string-append "#" all)))
97
98 ;; Patch references to subprograms with absolute pathnames.
99 (substitute* "wicd/wnettools.py"
100 (("(misc\\.Run\\(\\[?[\"'])([^\"' ]*)" all pre cmd)
101 (string-append pre (which* cmd)))
102 (("(self\\._find_program_path|misc\\.find_path)\\([\"']([^\"']*)[\"']\\)"
103 all dummy cmd)
104 (let ((pathname (which* cmd)))
105 (if pathname
106 (string-append "'" pathname "'")
107 "None")))
108 (("([\"'])(ifconfig|route|wpa_cli|wpa_supplicant|iwconfig|iwpriv|iwlist|ping)"
109 all open-quote cmd)
110 (string-append open-quote (which* cmd))))
111
112 ;; setup.py cannot cope without LANG
113 (setenv "LANG" "C")
114
115 (let ((params
116 (list
117 (string-append "--python=" python "/bin/python")
118 "--no-install-init"
119 "--no-install-docs"
120 "--no-install-acpi"
121 "--no-install-pmutils"
122 "--no-install-kde"
123 "--no-install-gnome-shell-extensions"
124
125 "--distro=guixsd"
126 "--wicdgroup=netdev"
127 "--loggroup=root"
128 "--logperms=0640"
129
130 ;; XXX setup.py configure asks us to pass --init=,
131 ;; but if we do it says "no such option 'init'".
132 ;; (string-append "--init=" out "/etc/init.d")
133
134 (string-append "--initfile=" out "/etc/init.d/wicd")
135 (string-append "--lib=" out "/lib/wicd")
136 (string-append "--share=" out "/share/wicd")
137
138 "--etc=/etc/wicd"
139 "--scripts=/etc/wicd/scripts"
140 "--pmutils=/etc/pm-utils/sleep.d"
141
142 (string-append "--encryption="
143 out "/etc/encryption/templates")
144 (string-append "--bin=" out "/bin")
145 (string-append "--sbin=" out "/sbin")
146 (string-append "--daemon=" out "/share/wicd/daemon")
147 (string-append "--backends=" out "/share/wicd/backends")
148 (string-append "--curses=" out "/share/wicd/curses")
149 (string-append "--gtk=" out "/share/wicd/gtk")
150 (string-append "--cli=" out "/share/wicd/cli")
151 (string-append "--gnome-shell-extensions="
152 out "/share/gnome-shell-extensions")
153 (string-append "--icons=" out "/share/icons/hicolor")
154 (string-append "--pixmaps=" out "/share/pixmaps")
800d8d40 155 (string-append "--images=" out "/share/icons")
10b60c04
MW
156 (string-append "--dbus=" out "/etc/dbus-1/system.d")
157 (string-append "--dbus-service="
158 out "/share/dbus-1/system-services")
159 (string-append "--systemd=" out "/lib/systemd/system")
160 (string-append "--logrotate=" out "/etc/logrotate.d")
161 (string-append "--desktop=" out "/share/applications")
162 (string-append "--translations=" out "/share/locale")
163 (string-append "--autostart=" out "/etc/xdg/autostart")
164 (string-append "--docdir=" out "/share/doc/wicd")
165 (string-append "--mandir=" out "/share/man")
166 (string-append "--kdedir=" out "/share/autostart"))))
167 (format #t
168 "running ~s with command ~s and parameters ~s~%"
169 "python setup.py" "configure" params)
170 (zero? (apply system* "python" "setup.py" "configure" params)))))
171 (alist-cons-after
800d8d40
MW
172 'install 'post-install
173 (lambda* (#:key inputs outputs #:allow-other-keys)
174 (let ((out (assoc-ref outputs "out")))
175 ;; wicd's installer tries to put dhclient.conf.template.default
176 ;; in /etc/wicd/other, which is not available in the build
177 ;; environment, so here we install it manually in the output
178 ;; directory.
179 (let ((dest-dir (string-append out "/etc/wicd"))
180 (name "dhclient.conf.template.default"))
96c46210 181 (install-file (string-append "other/" name) dest-dir))
800d8d40
MW
182
183 ;; Copy index.theme from hicolor-icon-theme. This is needed to
184 ;; allow wicd-gtk to find its icons.
185 (let ((hicolor (assoc-ref inputs "hicolor-icon-theme"))
186 (name "/share/icons/hicolor/index.theme"))
f18bd3f6
SB
187 (install-file (string-append hicolor name)
188 (string-append out "/share/icons/hicolor")))
10b60c04
MW
189 #t))
190 %standard-phases))))
191 (synopsis "Network connection manager")
192 (description "Wicd is a network manager that aims to simplify wired and
193wireless networking.")
194 (home-page "https://launchpad.net/wicd")
195 (license gpl2+)))