diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix index 5e2e4b2972c6..be7c5a38c2a6 100644 --- a/pkgs/os-specific/linux/wpa_supplicant/default.nix +++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix @@ -1,4 +1,12 @@ -{stdenv, fetchurl, openssl, qt4 ? null}: +{stdenv, fetchurl, openssl +, guiSupport ? false +, qt4}: + +assert !guiSupport || qt4 != null; + +let + buildDirs = "wpa_supplicant wpa_passphrase wpa_cli"; +in stdenv.mkDerivation rec { name = "wpa_supplicant-0.7.2"; @@ -13,19 +21,33 @@ stdenv.mkDerivation rec { cp defconfig .config echo CONFIG_DEBUG_SYSLOG=y >> .config substituteInPlace Makefile --replace /usr/local $out - makeFlagsArray=(ALL="wpa_supplicant wpa_passphrase wpa_cli ${if qt4 == null then "" else "wpa_gui-qt4"}") + makeFlagsArray=(ALL="${buildDirs} ${if guiSupport then "wpa_gui-qt4" else ""}") ''; - buildInputs = [openssl qt4]; + 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; 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/ - ''; + '' + + (if guiSupport then '' + pwd + cp wpa_gui-qt4/wpa_gui $out/sbin + '' else ""); meta = { homepage = http://hostap.epitest.fi/wpa_supplicant/; description = "A tool for connecting to WPA and WPA2-protected wireless networks"; + maintainers = [stdenv.lib.maintainers.marcweber]; + platforms = stdenv.lib.platforms.linux; }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6bd998df1a35..4a09fcc26173 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6547,13 +6547,20 @@ let inherit fetchurl stdenv; }; - wpa_supplicant = import ../os-specific/linux/wpa_supplicant { + wpa_supplicant = makeOverridable (import ../os-specific/linux/wpa_supplicant) { inherit fetchurl stdenv openssl; + inherit qt4; + guiSupport = false; }; + # prebuild binaries: + wpa_supplicant_gui = wpa_supplicant.override { guiSupport = true; }; - wpa_supplicant_gui_qt4 = import ../os-specific/linux/wpa_supplicant/gui-qt4.nix { + # deprecated, but contains icon ? Does no longer build + /* didn't build Sun Apr 25 20:34:18 CEST 2010 + wpa_supplicant_gui_qt4_old = import ../os-specific/linux/wpa_supplicant/gui-qt4.nix { inherit fetchurl stdenv qt4 imagemagick inkscape; }; + */ xf86_input_wacom = import ../os-specific/linux/xf86-input-wacom { inherit stdenv fetchurl ncurses pkgconfig file;