[Nix-dev] wpa_supplicant, enableWLAN, wicd - namings ?

Marc Weber marco-oweber at gmx.de
Sun Apr 25 23:55:57 CEST 2010


Hi list.

There are three topics: A,B

patch A (patch attached):
  there are two names in all-packages.nix:
  wpa_supplicant and wpa_supplicant_gui_qt4
  The second didn't build here (x86_64 linux system)

  So this patch does
  - fix wpa_supplicant gui build.
    qt was passed. It looked like being ok but actually didn't build
  - update to from version 0.7 to 0.7.2

  - comment the old wpa_supplicant_gui_qt4 expression because it doesn't build
    The patch still keeps it because it seems to do some magic about icons?

    Sander: Can you comment on this?

  IMHO Having one derivation only is better because Lluís Batlle already
  missed updating the second one when updating wpa_supplicant from 0.6.9 to
  0.7.0.


topic B: what about renaming enableWLAN and adding WLANGUI ?

  nettworking.WLANGUI = wicd | wpa_gui | none;

  I'd like to rename enableWLAN to runWapSupplicantInstance or even
  networking.wpaSupplicant.enable

  because wpa_supplicant is not only used for wireless networks and
  because it sounds strange that you may not set both:
  WLANGUI = "wicd" and enableWLAN because wicd starts its own wpa_supplicant
  instance..

  To make things even more clear I suggest these two renamings:

    networking.WLANInterface -> networking.wpaSupplicant.WLANInterface
    networking.enableWLAN    -> networking.wpaSupplicant.enable

  The WLANGUI should enable either wicd.enable or wpaSupplicant.enable
  or nothing depending on its value.

Is this sound?

Marc Weber


patch A

commit 802ccfee43db7d9c0b28124fc7bae5772e7403c2
Author: Marc Weber <marco-oweber at gmx.de>
Date:   Sun Apr 25 20:56:59 2010 +0200

    wpa_supplicant: update to 0.7.2, enable qt gui, depreceate old broken derivation building gui

diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix
index 8920903..b4471c8 100644
--- a/pkgs/os-specific/linux/wpa_supplicant/default.nix
+++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix
@@ -1,11 +1,19 @@
-{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.0";
+  name = "wpa_supplicant-0.7.2";
 
   src = fetchurl {
     url = "http://hostap.epitest.fi/releases/${name}.tar.gz";
-    sha256 = "08aynxk842vg4if28ydza3mwkx2nvk9gw2vkbdlfn88vi1wgcd4x";
+    sha256 = "df002a75376fc3f8bc0082771d1accadf60891515e08ac5b7ca044fa9985dcbe";
   };
 
   preBuild = ''
@@ -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 7aa70d7..22cdd88 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6399,13 +6399,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;
   };
+  */
 
   xmoto = builderDefsPackage (import ../games/xmoto) {
     inherit chipmunk sqlite curl zlib bzip2 libjpeg libpng



More information about the nix-dev mailing list