2010-04-27 06:38:41 +02:00
|
|
|
{stdenv, fetchurl, openssl
|
|
|
|
, guiSupport ? false
|
|
|
|
, qt4}:
|
|
|
|
|
|
|
|
assert !guiSupport || qt4 != null;
|
|
|
|
|
|
|
|
let
|
|
|
|
buildDirs = "wpa_supplicant wpa_passphrase wpa_cli";
|
|
|
|
in
|
2007-04-08 22:20:21 +02:00
|
|
|
|
2009-04-04 02:21:21 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2010-04-21 13:37:15 +02:00
|
|
|
name = "wpa_supplicant-0.7.2";
|
2007-04-08 22:20:21 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2009-04-04 02:21:21 +02:00
|
|
|
url = "http://hostap.epitest.fi/releases/${name}.tar.gz";
|
2010-04-21 13:37:15 +02:00
|
|
|
sha256 = "1gnwhnczli50gidsq22ya68hixmdrhd1sxw202ygihvg6xsjl06z";
|
2007-04-08 22:20:21 +02:00
|
|
|
};
|
|
|
|
|
2009-04-04 02:21:21 +02:00
|
|
|
preBuild = ''
|
2008-04-21 10:32:30 +02:00
|
|
|
cd wpa_supplicant
|
2007-04-08 22:20:21 +02:00
|
|
|
cp defconfig .config
|
2009-12-16 20:45:00 +01:00
|
|
|
echo CONFIG_DEBUG_SYSLOG=y >> .config
|
2007-04-08 22:20:21 +02:00
|
|
|
substituteInPlace Makefile --replace /usr/local $out
|
2010-04-27 06:38:41 +02:00
|
|
|
makeFlagsArray=(ALL="${buildDirs} ${if guiSupport then "wpa_gui-qt4" else ""}")
|
2009-04-04 02:21:21 +02:00
|
|
|
'';
|
2007-04-08 22:20:21 +02:00
|
|
|
|
2010-04-27 06:38:41 +02:00
|
|
|
buildInputs = [openssl]
|
|
|
|
++ stdenv.lib.optional guiSupport qt4;
|
|
|
|
|
|
|
|
# qt gui doesn't install because the executable is named differently from directory name
|
|
|
|
# so never include wpa_gui_-qt4 in buildDirs when running make install
|
|
|
|
preInstall = if guiSupport then ''
|
|
|
|
makeFlagsArray=(ALL="${buildDirs}")
|
|
|
|
'' else null;
|
2009-04-04 02:21:21 +02:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
ensureDir $out/share/man/man5 $out/share/man/man8
|
|
|
|
cp doc/docbook/*.5 $out/share/man/man5/
|
|
|
|
cp doc/docbook/*.8 $out/share/man/man8/
|
2010-04-27 06:38:41 +02:00
|
|
|
''
|
|
|
|
+ (if guiSupport then ''
|
|
|
|
pwd
|
|
|
|
cp wpa_gui-qt4/wpa_gui $out/sbin
|
|
|
|
'' else "");
|
2009-04-04 02:21:21 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://hostap.epitest.fi/wpa_supplicant/;
|
|
|
|
description = "A tool for connecting to WPA and WPA2-protected wireless networks";
|
2010-04-27 06:38:41 +02:00
|
|
|
maintainers = [stdenv.lib.maintainers.marcweber];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2009-04-04 02:21:21 +02:00
|
|
|
};
|
2010-04-27 06:38:41 +02:00
|
|
|
|
2007-04-08 22:20:21 +02:00
|
|
|
}
|