summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/build-managers/cargo/snapshot.nix2
-rw-r--r--pkgs/development/tools/build-managers/cmake/2.8.nix5
-rw-r--r--pkgs/development/tools/build-managers/cmake/default.nix42
-rw-r--r--pkgs/development/tools/build-managers/cmake/search-path-3.2.patch8
-rw-r--r--pkgs/development/tools/build-managers/gnumake/4.1/default.nix2
-rw-r--r--pkgs/development/tools/misc/autogen/default.nix13
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix4
-rw-r--r--pkgs/development/tools/misc/drush/default.nix2
-rw-r--r--pkgs/development/tools/misc/eggdbus/default.nix2
-rw-r--r--pkgs/development/tools/misc/global/default.nix2
-rw-r--r--pkgs/development/tools/misc/libtool/libtool2.nix3
-rw-r--r--pkgs/development/tools/misc/patchelf/default.nix2
-rw-r--r--pkgs/development/tools/misc/pkgconfig/default.nix31
-rw-r--r--pkgs/development/tools/misc/texinfo/5.2.nix4
-rw-r--r--pkgs/development/tools/node-webkit/nw11.nix4
-rw-r--r--pkgs/development/tools/node-webkit/nw12.nix4
-rw-r--r--pkgs/development/tools/node-webkit/nw9.nix4
-rw-r--r--pkgs/development/tools/phantomjs/default.nix19
-rw-r--r--pkgs/development/tools/selenium/chromedriver/default.nix4
-rw-r--r--pkgs/development/tools/vagrant/default.nix16
20 files changed, 102 insertions, 71 deletions
diff --git a/pkgs/development/tools/build-managers/cargo/snapshot.nix b/pkgs/development/tools/build-managers/cargo/snapshot.nix
index ad07148815b..8f5467f6311 100644
--- a/pkgs/development/tools/build-managers/cargo/snapshot.nix
+++ b/pkgs/development/tools/build-managers/cargo/snapshot.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation {
     mkdir -p "$out"
     ./install.sh "--prefix=$out"
   '' + (if stdenv.isLinux then ''
-    patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \
+    patchelf --interpreter "${stdenv.glibc.out}/lib/${stdenv.cc.dynamicLinker}" \
              --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/:${zlib}/lib" \
              "$out/bin/cargo"
   '' else "") + postInstall;
diff --git a/pkgs/development/tools/build-managers/cmake/2.8.nix b/pkgs/development/tools/build-managers/cmake/2.8.nix
index 60a941a6637..80fdce59607 100644
--- a/pkgs/development/tools/build-managers/cmake/2.8.nix
+++ b/pkgs/development/tools/build-managers/cmake/2.8.nix
@@ -47,8 +47,9 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = optional wantPS ps;
 
-  CMAKE_PREFIX_PATH = stdenv.lib.concatStringsSep ":" buildInputs;
-  
+  CMAKE_PREFIX_PATH = stdenv.lib.concatStringsSep ":"
+    (concatMap (p: [ p p.out ]) buildInputs);
+
   configureFlags =
     "--docdir=/share/doc/${name} --mandir=/share/man --system-libs"
     + stdenv.lib.optionalString useQt4 " --qt-gui";
diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix
index 09e54d3dfa6..f97b7b432ea 100644
--- a/pkgs/development/tools/build-managers/cmake/default.nix
+++ b/pkgs/development/tools/build-managers/cmake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ stdenv, fetchurl, pkgconfig
 , bzip2, curl, expat, libarchive, xz, zlib
 , useNcurses ? false, ncurses, useQt4 ? false, qt4
 , wantPS ? false, ps ? null
@@ -25,26 +25,34 @@ stdenv.mkDerivation rec {
     sha256 = "1shwim3gfdybjx9f11ykxz5l09rh58vmvz8ip76q3i76mkv2pf55";
   };
 
-  enableParallelBuilding = true;
-
   patches =
     # Don't search in non-Nix locations such as /usr, but do search in
     # Nixpkgs' Glibc.
     optional (stdenv ? glibc) ./search-path-3.2.patch
     ++ optional stdenv.isCygwin ./3.2.2-cygwin.patch;
 
+  outputs = [ "out" "doc" ];
+  setOutputFlags = false;
+
+  setupHook = ./setup-hook.sh;
+
   buildInputs =
-    [ bzip2 curl expat libarchive xz zlib ]
+    [ setupHook pkgconfig bzip2 curl expat libarchive xz zlib ]
     ++ optional useNcurses ncurses
     ++ optional useQt4 qt4;
 
   propagatedBuildInputs = optional wantPS ps;
 
-  CMAKE_PREFIX_PATH = stdenv.lib.concatStringsSep ":" buildInputs;
-
+  preConfigure = with stdenv; optionalString (stdenv ? glibc)
+    ''
+      fixCmakeFiles .
+      substituteInPlace Modules/Platform/UnixPaths.cmake \
+        --subst-var-by glibc_bin ${glibc.bin or glibc} \
+        --subst-var-by glibc_dev ${glibc.dev or glibc} \
+        --subst-var-by glibc_lib ${glibc.out or glibc}
+    '';
   configureFlags =
     [ "--docdir=/share/doc/${name}"
-      "--mandir=/share/man"
       "--no-system-jsoncpp"
     ]
     ++ optional (!stdenv.isCygwin) "--system-libs"
@@ -52,22 +60,18 @@ stdenv.mkDerivation rec {
     ++ ["--"]
     ++ optional (!useNcurses) "-DBUILD_CursesDialog=OFF";
 
-  setupHook = ./setup-hook.sh;
-
   dontUseCmakeConfigure = true;
 
-  preConfigure = optionalString (stdenv ? glibc)
-    ''
-      source $setupHook
-      fixCmakeFiles .
-      substituteInPlace Modules/Platform/UnixPaths.cmake \
-        --subst-var-by glibc ${stdenv.glibc}
-    '';
+  enableParallelBuilding = true;
+
+  preInstall = ''mkdir "$doc" '';
+
+  postInstall = ''moveToOutput "share/cmake-*/Help" "$doc" '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.cmake.org/;
     description = "Cross-Platform Makefile Generator";
-    platforms = if useQt4 then qt4.meta.platforms else stdenv.lib.platforms.all;
-    maintainers = with stdenv.lib.maintainers; [ urkud mornfall ttuegel ];
+    platforms = if useQt4 then qt4.meta.platforms else platforms.all;
+    maintainers = with maintainers; [ urkud mornfall ttuegel ];
   };
 }
diff --git a/pkgs/development/tools/build-managers/cmake/search-path-3.2.patch b/pkgs/development/tools/build-managers/cmake/search-path-3.2.patch
index b0447e70607..0a2d4ad43ab 100644
--- a/pkgs/development/tools/build-managers/cmake/search-path-3.2.patch
+++ b/pkgs/development/tools/build-managers/cmake/search-path-3.2.patch
@@ -53,21 +53,21 @@ index 20ee1d1..39834e6 100644
 -
 -list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
 -  /usr/pkg/bin
-+  "@glibc@"
++  "@glibc_bin@"
    )
  
  list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
 -  /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
-+  "@glibc@/lib"
++  "@glibc_lib@/lib"
    )
  
  list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
 -  /usr/include
-+  "@glibc@/include"
++  "@glibc_dev@/include"
    )
  list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
 -  /usr/include
-+  "@glibc@/include"
++  "@glibc_dev@/include"
    )
  
  # Enable use of lib64 search path variants by default.
diff --git a/pkgs/development/tools/build-managers/gnumake/4.1/default.nix b/pkgs/development/tools/build-managers/gnumake/4.1/default.nix
index 9ac20107018..de6f96ce99f 100644
--- a/pkgs/development/tools/build-managers/gnumake/4.1/default.nix
+++ b/pkgs/development/tools/build-managers/gnumake/4.1/default.nix
@@ -22,6 +22,8 @@ stdenv.mkDerivation {
     ./no-tty-name.patch
   ];
 
+  outputs = [ "out" "doc" ];
+
   meta = {
     homepage = http://www.gnu.org/software/make/;
     description = "A tool to control the generation of non-source files from sources";
diff --git a/pkgs/development/tools/misc/autogen/default.nix b/pkgs/development/tools/misc/autogen/default.nix
index bba50b32089..d2ddcabc0b1 100644
--- a/pkgs/development/tools/misc/autogen/default.nix
+++ b/pkgs/development/tools/misc/autogen/default.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "0sfmmy19k9z0j3f738fyk6ljf6b66410cvd5zzyplxi2683j10qs";
   };
 
+  outputs = [ "dev" "bin" "lib" "out" "man" "info" ];
+
   nativeBuildInputs = [ which pkgconfig perl ];
   buildInputs = [ guile libxml2 ];
 
@@ -20,6 +22,17 @@ stdenv.mkDerivation rec {
     substituteInPlace pkg/libopts/mklibsrc.sh --replace /tmp $TMPDIR
   '';
 
+  postInstall = ''
+    mkdir -p $dev/bin
+    mv $bin/bin/autoopts-config $dev/bin
+
+    for f in $lib/lib/autogen/tpl-config.tlib $out/share/autogen/tpl-config.tlib; do
+      sed -e "s|$dev/include|/no-such-autogen-include-path|" -i $f
+      sed -e "s|$bin/bin|/no-such-autogen-bin-path|" -i $f
+      sed -e "s|$lib/lib|/no-such-autogen-lib-path|" -i $f
+    done
+  '';
+
   #doCheck = true; # 2 tests fail because of missing /dev/tty
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 61824eb607b..ceec956004f 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -34,6 +34,8 @@ stdenv.mkDerivation rec {
     ./pt-pax-flags-20121023.patch
   ];
 
+  outputs = (optional (cross == null) "dev") ++ [ "out" "info" ];
+
   nativeBuildInputs = optional gold bison;
   buildInputs = [ zlib ];
 
@@ -67,6 +69,8 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  postFixup = optionalString (cross == null) "ln -s $out/bin $dev/bin"; # tools needed for development
+
   meta = {
     description = "Tools for manipulating binaries (linker, assembler, etc.)";
 
diff --git a/pkgs/development/tools/misc/drush/default.nix b/pkgs/development/tools/misc/drush/default.nix
index cb534d511ea..0751f51281d 100644
--- a/pkgs/development/tools/misc/drush/default.nix
+++ b/pkgs/development/tools/misc/drush/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     mkdir -p "$out"
     cp -r . "$out/src"
     mkdir "$out/bin"
-    wrapProgram "$out/src/drush" --prefix PATH : "${which}/bin:${php}/bin:${bash}/bin:${coreutils}/bin:${ncurses}/bin"
+    wrapProgram "$out/src/drush" --prefix PATH : "${which}/bin:${php}/bin:${bash}/bin:${coreutils}/bin:${ncurses.dev}/bin"
     ln -s "$out/src/drush" "$out/bin/drush"
   '';
 }
diff --git a/pkgs/development/tools/misc/eggdbus/default.nix b/pkgs/development/tools/misc/eggdbus/default.nix
index 97031a533fa..9f04e283722 100644
--- a/pkgs/development/tools/misc/eggdbus/default.nix
+++ b/pkgs/development/tools/misc/eggdbus/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "118hj63ac65zlg71kydv4607qcg1qpdlql4kvhnwnnhar421jnq4";
   };
   
-  buildInputs = [ pkgconfig glib dbus.libs dbus_glib ];
+  buildInputs = [ pkgconfig glib dbus dbus_glib ];
 
   meta = {
     homepage = http://hal.freedesktop.org/releases/;
diff --git a/pkgs/development/tools/misc/global/default.nix b/pkgs/development/tools/misc/global/default.nix
index 63b29fccd52..741b494ec39 100644
--- a/pkgs/development/tools/misc/global/default.nix
+++ b/pkgs/development/tools/misc/global/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--with-ltdl-include=${libtool}/include"
-    "--with-ltdl-lib=${libtool}/lib"
+    "--with-ltdl-lib=${libtool.lib}/lib"
     "--with-ncurses=${ncurses}"
     "--with-sqlite3=${sqlite}"
     "--with-exuberant-ctags=${ctags}/bin/ctags"
diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix
index 5d27b469680..27ec2772e09 100644
--- a/pkgs/development/tools/misc/libtool/libtool2.nix
+++ b/pkgs/development/tools/misc/libtool/libtool2.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "1qq61k6lp1fp75xs398yzi6wvbx232l7xbyn3p13cnh27mflvgg3";
   };
 
+  outputs = [ "out" "lib" ];
+
   propagatedNativeBuildInputs = [ m4 ];
   nativeBuildInputs = [ perl help2man ];
 
@@ -43,4 +45,3 @@ stdenv.mkDerivation rec {
     maintainers = [ ];
   };
 }
-
diff --git a/pkgs/development/tools/misc/patchelf/default.nix b/pkgs/development/tools/misc/patchelf/default.nix
index 5aa81e46bed..b3121ac7944 100644
--- a/pkgs/development/tools/misc/patchelf/default.nix
+++ b/pkgs/development/tools/misc/patchelf/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
 
   setupHook = [ ./setup-hook.sh ];
 
+  #doCheck = true; # problems when loading libc.so.6
+
   meta = {
     homepage = http://nixos.org/patchelf.html;
     license = "GPL";
diff --git a/pkgs/development/tools/misc/pkgconfig/default.nix b/pkgs/development/tools/misc/pkgconfig/default.nix
index c82a626336f..c98bddf53c0 100644
--- a/pkgs/development/tools/misc/pkgconfig/default.nix
+++ b/pkgs/development/tools/misc/pkgconfig/default.nix
@@ -1,25 +1,30 @@
-{stdenv, fetchurl, automake, libiconv, vanilla ? false}:
+{stdenv, fetchurl, automake, libiconv, vanilla ? false }:
 
-stdenv.mkDerivation (rec {
+let
+  inherit (stdenv.lib) optional;
+in
+stdenv.mkDerivation rec {
   name = "pkg-config-0.29";
-  
+
   setupHook = ./setup-hook.sh;
-  
+
   src = fetchurl {
     url = "http://pkgconfig.freedesktop.org/releases/${name}.tar.gz";
     sha256 = "0sq09a39wj4cxf8l2jvkq067g08ywfma4v6nhprnf351s82pfl68";
   };
+    # Process Requires.private properly, see
+    # http://bugs.freedesktop.org/show_bug.cgi?id=4738.
+  patches = optional (!vanilla) ./requires-private.patch
+    ++ optional stdenv.isCygwin ./2.36.3-not-win32.patch;
 
+  preConfigure = stdenv.lib.optionalString (stdenv.system == "mips64el-linux")
+    ''cp -v ${automake}/share/automake*/config.{sub,guess} .'';
   buildInputs = stdenv.lib.optional (stdenv.isCygwin || stdenv.isDarwin || stdenv.isSunOS) libiconv;
 
   configureFlags = [ "--with-internal-glib" ]
     ++ stdenv.lib.optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ];
 
-  patches = (if vanilla then [] else [
-    # Process Requires.private properly, see
-    # http://bugs.freedesktop.org/show_bug.cgi?id=4738.
-    ./requires-private.patch
-  ]) ++ stdenv.lib.optional stdenv.isCygwin ./2.36.3-not-win32.patch;
+  postInstall = ''rm "$out"/bin/*-pkg-config''; # clean the duplicate file
 
   meta = {
     description = "A tool that allows packages to find out information about other packages";
@@ -27,9 +32,5 @@ stdenv.mkDerivation (rec {
     platforms = stdenv.lib.platforms.all;
   };
 
-} // (if stdenv.system == "mips64el-linux" then
-  {
-    preConfigure = ''
-      cp -v ${automake}/share/automake*/config.{sub,guess} .
-    '';
-  } else {}))
+}
+
diff --git a/pkgs/development/tools/misc/texinfo/5.2.nix b/pkgs/development/tools/misc/texinfo/5.2.nix
index c43ebcd2de2..a9edccbd200 100644
--- a/pkgs/development/tools/misc/texinfo/5.2.nix
+++ b/pkgs/development/tools/misc/texinfo/5.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses, perl, xz, interactive ? false }:
+{ stdenv, fetchurl, xz, ncurses, perl, interactive ? false }:
 
 stdenv.mkDerivation rec {
   name = "texinfo-5.2";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal";
   };
 
-  buildInputs = [ perl xz ]
+  buildInputs = [ perl xz.bin ]
     ++ stdenv.lib.optional interactive ncurses;
 
   preInstall = ''
diff --git a/pkgs/development/tools/node-webkit/nw11.nix b/pkgs/development/tools/node-webkit/nw11.nix
index ed3b99aad00..2fe1ddf42d4 100644
--- a/pkgs/development/tools/node-webkit/nw11.nix
+++ b/pkgs/development/tools/node-webkit/nw11.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, buildEnv, makeWrapper
 , xorg, alsaLib, dbus, glib, gtk, atk, pango, freetype, fontconfig
-, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, udev, libcap
+, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, libudev, libcap
 , libnotify}:
 let
   bits = if stdenv.system == "x86_64-linux" then "x64"
@@ -35,7 +35,7 @@ in stdenv.mkDerivation rec {
     patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nw
     patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nwsnapshot
 
-    ln -s ${udev}/lib/libudev.so $out/share/node-webkit/libudev.so.0
+    ln -s ${libudev.out}/lib/libudev.so $out/share/node-webkit/libudev.so.0
 
     patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nw
     patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nwsnapshot
diff --git a/pkgs/development/tools/node-webkit/nw12.nix b/pkgs/development/tools/node-webkit/nw12.nix
index 7492acb1367..4cacc75d777 100644
--- a/pkgs/development/tools/node-webkit/nw12.nix
+++ b/pkgs/development/tools/node-webkit/nw12.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, buildEnv, makeWrapper
 , xorg, alsaLib, dbus, glib, gtk, atk, pango, freetype, fontconfig
-, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, udev, libcap
+, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, libudev, libcap
 , libnotify}:
 let
   bits = if stdenv.system == "x86_64-linux" then "x64"
@@ -37,7 +37,7 @@ in stdenv.mkDerivation rec {
     patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/nwjs/nw
     patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/nwjs/nwjc
 
-    ln -s ${udev}/lib/libudev.so $out/share/nwjs/libudev.so.0
+    ln -s ${libudev.out}/lib/libudev.so $out/share/nwjs/libudev.so.0
 
     patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/nwjs" $out/share/nwjs/nw
     patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/nwjs" $out/share/nwjs/nwjc
diff --git a/pkgs/development/tools/node-webkit/nw9.nix b/pkgs/development/tools/node-webkit/nw9.nix
index 213b94102b0..d8601865c6d 100644
--- a/pkgs/development/tools/node-webkit/nw9.nix
+++ b/pkgs/development/tools/node-webkit/nw9.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, buildEnv, makeWrapper
 , xorg, alsaLib, dbus, glib, gtk, atk, pango, freetype, fontconfig
-, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, udev}:
+, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, libudev }:
 let
   bits = if stdenv.system == "x86_64-linux" then "x64"
          else "ia32";
@@ -33,7 +33,7 @@ in stdenv.mkDerivation rec {
     patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nw
     patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nwsnapshot
 
-    ln -s ${udev}/lib/libudev.so $out/share/node-webkit/libudev.so.0
+    ln -s ${libudev.out}/lib/libudev.so $out/share/node-webkit/libudev.so.0
 
     patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nw
     patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nwsnapshot
diff --git a/pkgs/development/tools/phantomjs/default.nix b/pkgs/development/tools/phantomjs/default.nix
index 77bc1e5a885..8b6b655b6a5 100644
--- a/pkgs/development/tools/phantomjs/default.nix
+++ b/pkgs/development/tools/phantomjs/default.nix
@@ -1,6 +1,9 @@
-{ stdenv, fetchurl, freetype, fontconfig, openssl, unzip }:
+{ stdenv, lib, fetchurl, freetype, fontconfig, openssl, unzip }:
 
-assert stdenv.lib.elem stdenv.system [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
+let
+  platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
+in
+assert lib.elem stdenv.system platforms;
 
 stdenv.mkDerivation rec {
   name = "phantomjs-1.9.8";
@@ -27,12 +30,12 @@ stdenv.mkDerivation rec {
               sha256 = "0j0aq8dgzmb210xdrh0v3d4nblskl3zsckl8bzf1a603wcx085cg";
             };
 
-  buildInputs = if stdenv.isDarwin then [ unzip ] else [];
+  buildInputs = lib.optional stdenv.isDarwin unzip;
 
-  buildPhase = if stdenv.isDarwin then "" else ''
+  buildPhase = lib.optionalString (!stdenv.isDarwin) ''
     patchelf \
       --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-      --set-rpath "${freetype}/lib:${fontconfig}/lib:${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib:${openssl}/lib" \
+      --set-rpath "${stdenv.lib.makeLibraryPath [ freetype fontconfig stdenv.cc.cc stdenv.cc.cc openssl ]}" \
       bin/phantomjs
   '';
 
@@ -60,9 +63,9 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = http://phantomjs.org/;
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
 
-    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
-    platforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" ];
+    maintainers = [ lib.maintainers.bluescreen303 ];
+    inherit platforms;
   };
 }
diff --git a/pkgs/development/tools/selenium/chromedriver/default.nix b/pkgs/development/tools/selenium/chromedriver/default.nix
index 8d9db34446d..b2f566ece8d 100644
--- a/pkgs/development/tools/selenium/chromedriver/default.nix
+++ b/pkgs/development/tools/selenium/chromedriver/default.nix
@@ -23,9 +23,9 @@ stdenv.mkDerivation rec {
   installPhase = ''
     mkdir -p $out/bin
     mv chromedriver $out/bin
-    patchelf --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 $out/bin/chromedriver
+    patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 $out/bin/chromedriver
     wrapProgram "$out/bin/chromedriver" \
-      --prefix LD_LIBRARY_PATH : "$(cat ${stdenv.cc}/nix-support/orig-cc)/lib64:${cairo}/lib:${fontconfig}/lib:${freetype}/lib:${gdk_pixbuf}/lib:${glib}/lib:${gtk}/lib:${libX11}/lib:${nspr}/lib:${nss}/lib:${pango}/lib:${libXrender}/lib:${gconf}/lib:${libXext}/lib:${libXi}/lib:\$LD_LIBRARY_PATH"
+      --prefix LD_LIBRARY_PATH : "$(cat ${stdenv.cc}/nix-support/orig-cc)/lib64:${stdenv.lib.makeLibraryPath [ cairo fontconfig freetype gdk_pixbuf glib gtk libX11 nspr nss pango libXrender gconf libXext libXi ]}:\$LD_LIBRARY_PATH"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/tools/vagrant/default.nix b/pkgs/development/tools/vagrant/default.nix
index 085807e1bfa..7d980287629 100644
--- a/pkgs/development/tools/vagrant/default.nix
+++ b/pkgs/development/tools/vagrant/default.nix
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
 
     # curl: curl
     rm opt/vagrant/embedded/bin/curl
-    ln -s ${curl}/bin/curl opt/vagrant/embedded/bin
+    ln -s ${curl.bin}/bin/curl opt/vagrant/embedded/bin
 
     # libarchive: bsdtar, bsdcpio
     rm opt/vagrant/embedded/bin/{bsdtar,bsdcpio}
@@ -57,8 +57,8 @@ stdenv.mkDerivation rec {
 
     # openssl: c_rehash, openssl
     rm opt/vagrant/embedded/bin/{c_rehash,openssl}
-    ln -s ${openssl}/bin/c_rehash opt/vagrant/embedded/bin
-    ln -s ${openssl}/bin/openssl opt/vagrant/embedded/bin
+    ln -s ${openssl.bin}/bin/c_rehash opt/vagrant/embedded/bin
+    ln -s ${openssl.bin}/bin/openssl opt/vagrant/embedded/bin
 
     # ruby: erb, gem, irb, rake, rdoc, ri, ruby, testrb
     rm opt/vagrant/embedded/bin/{erb,gem,irb,rake,rdoc,ri,ruby,testrb}
@@ -77,14 +77,14 @@ stdenv.mkDerivation rec {
 
     # libxml: xml2-config, xmlcatalog, xmllint
     rm opt/vagrant/embedded/bin/{xml2-config,xmlcatalog,xmllint}
-    ln -s ${libxml2}/bin/xml2-config opt/vagrant/embedded/bin
-    ln -s ${libxml2}/bin/xmlcatalog opt/vagrant/embedded/bin
-    ln -s ${libxml2}/bin/xmllint opt/vagrant/embedded/bin
+    ln -s ${libxml2.dev}/bin/xml2-config opt/vagrant/embedded/bin
+    ln -s ${libxml2.bin}/bin/xmlcatalog opt/vagrant/embedded/bin
+    ln -s ${libxml2.bin}/bin/xmllint opt/vagrant/embedded/bin
 
     # libxslt: xslt-config, xsltproc
     rm opt/vagrant/embedded/bin/{xslt-config,xsltproc}
-    ln -s ${libxslt}/bin/xslt-config opt/vagrant/embedded/bin
-    ln -s ${libxslt}/bin/xsltproc opt/vagrant/embedded/bin
+    ln -s ${libxslt.dev}/bin/xslt-config opt/vagrant/embedded/bin
+    ln -s ${libxslt.bin}/bin/xsltproc opt/vagrant/embedded/bin
 
     mkdir -p "$out"
     cp -r opt "$out"