2010-01-07 18:49:45 +01:00
|
|
|
{stdenv, fetchurl, python, pygobject, pycairo, pyGtkGlade, pythonDBus,
|
|
|
|
wpa_supplicant, dhcp, wirelesstools, nettools, iproute,
|
2010-01-10 21:27:28 +01:00
|
|
|
locale ? "C" }:
|
2010-01-07 18:49:45 +01:00
|
|
|
|
2010-01-10 21:27:28 +01:00
|
|
|
# Wicd has a ncurses interface that we do not build because it depends
|
|
|
|
# on urwid which has not been packaged at this time (2009-12-27).
|
2010-01-07 18:49:45 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2011-04-07 00:06:00 +02:00
|
|
|
name = "wicd-1.7.1-beta2";
|
2010-01-07 18:49:45 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2011-04-07 00:06:00 +02:00
|
|
|
url = "mirror://sourceforge/wicd/wicd-1.7.1b2.tar.bz2";
|
|
|
|
sha256 = "13ga6a2ip8dy8h49wvv02jxxfvpk5q5sm2wz76dy62y1xsrm23c1";
|
2010-01-07 18:49:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ python ];
|
|
|
|
|
2011-04-07 17:39:53 +02:00
|
|
|
patches = [ ./no-var-install.patch ./mkdir-networks.patch ./pygtk.patch ./no-optimization.patch ];
|
2010-01-07 18:49:45 +01:00
|
|
|
|
|
|
|
# Should I be using pygtk's propogated build inputs?
|
2011-04-07 00:06:00 +02:00
|
|
|
# !!! Should use makeWrapper.
|
2010-01-07 18:49:45 +01:00
|
|
|
postPatch = ''
|
2011-04-07 00:06:00 +02:00
|
|
|
# We don't have "python2".
|
|
|
|
substituteInPlace wicd/wicd-daemon.py --replace 'misc.find_path("python2")' "'${python}/bin/python'"
|
|
|
|
|
2010-11-29 21:15:44 +01:00
|
|
|
substituteInPlace in/scripts=wicd.in --subst-var-by TEMPLATE-DEFAULT $out/share/other/dhclient.conf.template.default
|
2011-04-07 00:06:00 +02:00
|
|
|
|
2010-01-07 18:49:45 +01:00
|
|
|
sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin:${wpa_supplicant}/sbin:${dhcp}/sbin:${wirelesstools}/sbin:${nettools}/sbin:${iproute}/sbin" in/scripts=wicd.in
|
|
|
|
sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pythonDBus})" in/scripts=wicd.in
|
2010-01-10 21:27:28 +01:00
|
|
|
sed -i "4iexport LC_ALL=\\\"${locale}\\\"" in/scripts=wicd.in
|
2010-01-07 18:49:45 +01:00
|
|
|
sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin" in/scripts=wicd-client.in
|
|
|
|
sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-client.in
|
2010-11-29 21:15:44 +01:00
|
|
|
sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin" in/scripts=wicd-gtk.in
|
|
|
|
sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-gtk.in
|
|
|
|
sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin" in/scripts=wicd-cli.in
|
|
|
|
sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-cli.in
|
2010-01-07 18:49:45 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
python setup.py configure \
|
|
|
|
--lib=$out/lib/ \
|
|
|
|
--share=$out/share/ \
|
2010-11-29 21:15:44 +01:00
|
|
|
--etc=/var/lib/wicd/ \
|
2010-01-07 18:49:45 +01:00
|
|
|
--scripts=$out/etc/scripts/ \
|
2010-11-29 21:15:44 +01:00
|
|
|
--pixmaps=$out/share/pixmaps/ \
|
|
|
|
--images=$out/share/pixmaps/wicd/ \
|
2010-01-07 18:49:45 +01:00
|
|
|
--encryption=$out/etc/encryption/templates/ \
|
|
|
|
--bin=$out/bin/ \
|
|
|
|
--sbin=$out/sbin/ \
|
2010-11-29 21:15:44 +01:00
|
|
|
--backends=$out/share/backends/ \
|
|
|
|
--daemon=$out/share/daemon/ \
|
|
|
|
--curses=$out/share/curses/ \
|
|
|
|
--gtk=$out/share/gtk/ \
|
|
|
|
--cli=$out/share/cli/ \
|
2010-01-07 18:49:45 +01:00
|
|
|
--networks=/var/lib/wicd/configurations/ \
|
|
|
|
--resume=$out/etc/acpi/resume.d/ \
|
|
|
|
--suspend=$out/etc/acpi/suspend.d/ \
|
|
|
|
--pmutils=$out/lib/pm-utils/sleep.d/ \
|
|
|
|
--dbus=$out/etc/dbus-1/system.d/ \
|
|
|
|
--desktop=$out/share/applications/ \
|
|
|
|
--icons=$out/share/icons/hicolour/ \
|
|
|
|
--translations=$out/share/locale/ \
|
|
|
|
--autostart=$out/etc/xdg/autostart/ \
|
2011-04-07 17:39:53 +02:00
|
|
|
--varlib=/var/lib/wicd/ \
|
2010-01-07 18:49:45 +01:00
|
|
|
--docdir=$out/share/doc/ \
|
|
|
|
--mandir=$out/share/man/ \
|
|
|
|
--kdedir=$out/share/autostart/ \
|
|
|
|
--python=${python}/bin/python \
|
|
|
|
--distro=nix \
|
|
|
|
--wicdgroup=users \
|
|
|
|
--no-install-init \
|
|
|
|
--no-install-kde \
|
|
|
|
--no-install-acpi \
|
|
|
|
--no-install-pmutils \
|
|
|
|
--no-install-ncurses \
|
|
|
|
'';
|
|
|
|
|
2010-11-29 21:15:44 +01:00
|
|
|
installPhase = ''
|
|
|
|
python setup.py install --prefix=$out
|
|
|
|
ensureDir $out/share/other
|
|
|
|
cp other/dhclient.conf.template.default $out/share/other/dhclient.conf.template.default
|
2011-01-13 11:03:20 +01:00
|
|
|
|
|
|
|
# Add a template for "WPA2 Enterprise" encryption as used, e.g., by the
|
|
|
|
# Eduroam network. Taken and adapted from
|
|
|
|
# <http://wicd.net/punbb/viewtopic.php?id=87>.
|
|
|
|
cp -v "${./wpa2-ttls}" "$out/etc/encryption/templates/wpa2-ttls"
|
|
|
|
echo "wpa2-ttls" >> "$out/etc/encryption/templates/active"
|
2012-01-18 21:38:34 +01:00
|
|
|
|
|
|
|
# have wicd generate upstart events
|
|
|
|
echo '#!/bin/sh
|
|
|
|
initctl emit -n wicd-preconnect ITYPE="$1" ESSID="$2" BSSID="$3"' > $out/etc/scripts/preconnect/upstart-emit
|
|
|
|
echo '#!/bin/sh
|
|
|
|
initctl emit -n wicd-postconnect ITYPE="$1" ESSID="$2" BSSID="$3"' > $out/etc/scripts/postconnect/upstart-emit
|
|
|
|
echo '#!/bin/sh
|
|
|
|
initctl emit -n wicd-predisconnect ITYPE="$1" ESSID="$2" BSSID="$3"' > $out/etc/scripts/predisconnect/upstart-emit
|
|
|
|
echo '#!/bin/sh
|
|
|
|
initctl emit -n wicd-postdisconnect ITYPE="$1" ESSID="$2" BSSID="$3"' > $out/etc/scripts/postdisconnect/upstart-emit
|
|
|
|
chmod a+x $out/etc/scripts/*/upstart-emit
|
2010-11-29 21:15:44 +01:00
|
|
|
'';
|
2010-01-07 18:49:45 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://wicd.net/;
|
|
|
|
description = "A wiredless and wired network manager";
|
2010-01-10 21:27:28 +01:00
|
|
|
longDescription=''
|
|
|
|
A complete network connection manager
|
|
|
|
Wicd supports wired and wireless networks, and capable of
|
|
|
|
creating and tracking profiles for both. It has a
|
|
|
|
template-based wireless encryption system, which allows the user
|
|
|
|
to easily add encryption methods used. It ships with some common
|
|
|
|
encryption types, such as WPA and WEP. Wicd will automatically
|
|
|
|
connect at startup to any preferred network within range.
|
|
|
|
'';
|
2010-11-29 21:15:44 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.roconnor ];
|
2010-01-10 21:27:28 +01:00
|
|
|
license="GPLv2";
|
2010-01-07 18:49:45 +01:00
|
|
|
};
|
|
|
|
}
|