diff options
author | Yury G. Kudryashov <urkud.urkud@gmail.com> | 2011-06-07 21:48:41 +0000 |
---|---|---|
committer | Yury G. Kudryashov <urkud.urkud@gmail.com> | 2011-06-07 21:48:41 +0000 |
commit | 4c1267546f790ec505cd95849f2278b710b106d0 (patch) | |
tree | a8f5761c3d3fa73057af6aedb816e9984825e3e1 /pkgs/os-specific/linux/wpa_supplicant | |
parent | 4157b7709721f922bd943b59a5d40953a2eae9bc (diff) | |
download | nixpkgs-4c1267546f790ec505cd95849f2278b710b106d0.tar nixpkgs-4c1267546f790ec505cd95849f2278b710b106d0.tar.gz nixpkgs-4c1267546f790ec505cd95849f2278b710b106d0.tar.bz2 nixpkgs-4c1267546f790ec505cd95849f2278b710b106d0.tar.lz nixpkgs-4c1267546f790ec505cd95849f2278b710b106d0.tar.xz nixpkgs-4c1267546f790ec505cd95849f2278b710b106d0.tar.zst nixpkgs-4c1267546f790ec505cd95849f2278b710b106d0.zip |
wpa_supplicant: split wpa_gui from main package, install .desktop file and icons
svn path=/nixpkgs/trunk/; revision=27369
Diffstat (limited to 'pkgs/os-specific/linux/wpa_supplicant')
-rw-r--r-- | pkgs/os-specific/linux/wpa_supplicant/builder-gui-qt4.sh | 17 | ||||
-rw-r--r-- | pkgs/os-specific/linux/wpa_supplicant/default.nix | 77 |
2 files changed, 46 insertions, 48 deletions
diff --git a/pkgs/os-specific/linux/wpa_supplicant/builder-gui-qt4.sh b/pkgs/os-specific/linux/wpa_supplicant/builder-gui-qt4.sh deleted file mode 100644 index 728b5837b16..00000000000 --- a/pkgs/os-specific/linux/wpa_supplicant/builder-gui-qt4.sh +++ /dev/null @@ -1,17 +0,0 @@ -source $stdenv/setup - -tar xfvz $src -cd $pkgname-$version/wpa_supplicant -cp defconfig .config -substituteInPlace Makefile --replace /usr/local $out -make wpa_gui-qt4 -cd wpa_gui-qt4 -cd icons -make -ensureDir $out/share/icons -cp -av hicolor $out/share/icons -cd .. -ensureDir $out/bin -cp wpa_gui $out/bin -ensureDir $out/share/applications -cp wpa_gui.desktop $out/share/applications diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix index be7c5a38c2a..875a4811f92 100644 --- a/pkgs/os-specific/linux/wpa_supplicant/default.nix +++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix @@ -1,53 +1,68 @@ -{stdenv, fetchurl, openssl -, guiSupport ? false -, qt4}: - -assert !guiSupport || qt4 != null; +{stdenv, fetchurl, openssl, qt4, inkscape}: let - buildDirs = "wpa_supplicant wpa_passphrase wpa_cli"; -in - -stdenv.mkDerivation rec { - name = "wpa_supplicant-0.7.2"; - + version = "0.7.2"; src = fetchurl { - url = "http://hostap.epitest.fi/releases/${name}.tar.gz"; + url = "http://hostap.epitest.fi/releases/wpa_supplicant-${version}.tar.gz"; sha256 = "1gnwhnczli50gidsq22ya68hixmdrhd1sxw202ygihvg6xsjl06z"; }; +in + +(stdenv.mkDerivation rec { + name = "wpa_supplicant-${version}"; + inherit src; preBuild = '' cd wpa_supplicant - cp defconfig .config - echo CONFIG_DEBUG_SYSLOG=y >> .config + cp -v defconfig .config + echo CONFIG_DEBUG_SYSLOG=y | tee -a .config substituteInPlace Makefile --replace /usr/local $out - makeFlagsArray=(ALL="${buildDirs} ${if guiSupport then "wpa_gui-qt4" else ""}") ''; - 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; + buildInputs = [openssl]; 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 ""); + cp -v doc/docbook/*.5 $out/share/man/man5/ + cp -v doc/docbook/*.8 $out/share/man/man8/ + ''; 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]; + maintainers = with stdenv.lib.maintainers; [marcweber urkud]; platforms = stdenv.lib.platforms.linux; }; +}) // { +gui = stdenv.mkDerivation { + name = "wpa_gui-${version}"; + inherit src; + + buildInputs = [ qt4 ]; + + buildNativeInputs = [ inkscape ]; + + prePatch = "cd wpa_supplicant/wpa_gui-qt4"; + + configurePhase = '' + lrelease wpa_gui.pro + qmake''; + +# We do not install .xpm icons. First of all, I don't know where they should +# be install. Second, this allows us to drop imagemagick build-time dependency. + postBuild = '' + sed -e '/ICONS.*xpm/d' -i icons/Makefile + make -C icons + ''; + + installPhase = '' + mkdir -pv $out/bin + cp -v wpa_gui $out/bin + mkdir -pv $out/share/applications + cp -v wpa_gui.desktop $out/share/applications + mkdir -pv $out/share/icons + cp -av icons/hicolor $out/share/icons + ''; +}; } |