summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/gcc/4.2-apple64/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.8/builder.sh27
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix30
-rw-r--r--pkgs/development/compilers/gcc/4.8/no-sys-dirs.patch41
-rw-r--r--pkgs/development/compilers/ghdl/default.nix6
-rw-r--r--pkgs/development/compilers/go/1.3.nix2
-rw-r--r--pkgs/development/compilers/go/gox.nix2
-rw-r--r--pkgs/development/compilers/gwt/2.4.0.nix2
-rw-r--r--pkgs/development/compilers/mercury/default.nix2
-rw-r--r--pkgs/development/compilers/ocaml/3.11.2.nix2
-rw-r--r--pkgs/development/compilers/openjdk-darwin/default.nix14
-rw-r--r--pkgs/development/compilers/pakcs/default.nix8
-rw-r--r--pkgs/development/compilers/sbcl/bootstrap.nix4
-rw-r--r--pkgs/development/compilers/sbcl/default.nix2
-rw-r--r--pkgs/development/compilers/smlnj/bootstrap.nix4
-rw-r--r--pkgs/development/eclipse/ecj/default.nix2
-rw-r--r--pkgs/development/interpreters/perl/5.16/default.nix24
-rw-r--r--pkgs/development/libraries/aacskeys/default.nix2
-rw-r--r--pkgs/development/libraries/apache-activemq/default.nix2
-rw-r--r--pkgs/development/libraries/at-spi2-atk/default.nix21
-rw-r--r--pkgs/development/libraries/at-spi2-core/default.nix32
-rw-r--r--pkgs/development/libraries/boost/1.55.nix1
-rw-r--r--pkgs/development/libraries/bwidget/default.nix2
-rw-r--r--pkgs/development/libraries/fontconfig/default.nix3
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/glib/darwin-compilation.patch24
-rw-r--r--pkgs/development/libraries/glib/default.nix7
-rw-r--r--pkgs/development/libraries/glibc/2.19/common.nix2
-rw-r--r--pkgs/development/libraries/glibc/2.19/cve-2014-0475.patch170
-rw-r--r--pkgs/development/libraries/haskell/ghc-heap-view/default.nix2
-rw-r--r--pkgs/development/libraries/haskell/ghc-mod/default.nix2
-rw-r--r--pkgs/development/libraries/haskell/ghc-vis/default.nix2
-rw-r--r--pkgs/development/libraries/haskell/hoogle/local.nix2
-rw-r--r--pkgs/development/libraries/java/junixsocket/default.nix5
-rw-r--r--pkgs/development/libraries/libav/default.nix2
-rw-r--r--pkgs/development/libraries/libsamplerate/default.nix12
-rw-r--r--pkgs/development/libraries/libsndfile/default.nix9
-rw-r--r--pkgs/development/libraries/mesa/default.nix4
-rw-r--r--pkgs/development/libraries/ncurses/default.nix28
-rw-r--r--pkgs/development/libraries/opencv/default.nix10
-rw-r--r--pkgs/development/libraries/openssl/default.nix6
-rw-r--r--pkgs/development/libraries/readline/no-arch_only-6.3.patch13
-rw-r--r--pkgs/development/libraries/readline/no-arch_only.patch14
-rw-r--r--pkgs/development/libraries/readline/readline6.3.nix4
-rw-r--r--pkgs/development/libraries/readline/readline6.nix4
-rw-r--r--pkgs/development/mobile/androidenv/androidsdk.nix2
-rw-r--r--pkgs/development/mobile/xcodeenv/simulate-app.nix2
-rw-r--r--pkgs/development/mobile/xcodeenv/xcodewrapper.nix2
-rw-r--r--pkgs/development/ocaml-modules/ocamlmake/default.nix2
-rw-r--r--pkgs/development/tools/apktool/default.nix2
-rw-r--r--pkgs/development/tools/etcdctl/default.nix2
-rw-r--r--pkgs/development/tools/gocode/default.nix2
-rw-r--r--pkgs/development/tools/literate-programming/noweb/default.nix2
-rw-r--r--pkgs/development/tools/misc/autoconf/default.nix3
-rw-r--r--pkgs/development/tools/misc/distcc/masq.nix2
-rw-r--r--pkgs/development/tools/misc/grafana/default.nix2
-rw-r--r--pkgs/development/tools/misc/opengrok/default.nix2
-rw-r--r--pkgs/development/tools/node-webkit/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/deriving/default.nix2
-rw-r--r--pkgs/development/tools/packer/default.nix2
-rw-r--r--pkgs/development/tools/yuicompressor/default.nix2
61 files changed, 422 insertions, 174 deletions
diff --git a/pkgs/development/compilers/gcc/4.2-apple64/default.nix b/pkgs/development/compilers/gcc/4.2-apple64/default.nix
index 229f68fd841..f5496cb5ef7 100644
--- a/pkgs/development/compilers/gcc/4.2-apple64/default.nix
+++ b/pkgs/development/compilers/gcc/4.2-apple64/default.nix
@@ -44,4 +44,6 @@ stdenv.mkDerivation rec {
   langC = true;
 
   buildInputs = stdenv.lib.optionals langF77 [ gmp mpfr bison flex ];
+
+  meta.broken = true;
 }
diff --git a/pkgs/development/compilers/gcc/4.8/builder.sh b/pkgs/development/compilers/gcc/4.8/builder.sh
index 7c9b9420dda..3d24d34a2f2 100644
--- a/pkgs/development/compilers/gcc/4.8/builder.sh
+++ b/pkgs/development/compilers/gcc/4.8/builder.sh
@@ -109,13 +109,11 @@ if test "$noSysDirs" = "1"; then
         fi
     fi
 
-
     # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
     # the startfiles.
     # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
     # for the startfiles.
-    makeFlagsArray=( \
-        "${makeFlagsArray[@]}" \
+    makeFlagsArray+=( \
         NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
         SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
         CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
@@ -128,8 +126,7 @@ if test "$noSysDirs" = "1"; then
         )
 
     if test -z "$targetConfig"; then
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
+        makeFlagsArray+=( \
             BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
             BOOT_LDFLAGS="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
             )
@@ -138,13 +135,11 @@ if test "$noSysDirs" = "1"; then
     if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
         # We don't want the gcc build to assume there will be a libc providing
         # limits.h in this stagae
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
+        makeFlagsArray+=( \
             LIMITS_H_TEST=false \
             )
     else
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
+        makeFlagsArray+=( \
             LIMITS_H_TEST=true \
             )
     fi
@@ -163,6 +158,7 @@ preConfigure() {
         # Patch to get armvt5el working:
         sed -i -e 's/ arm)/ arm*)/' newlib/configure.host
     fi
+
     # Bug - they packaged zlib
     if test -d "zlib"; then
         # This breaks the build without-headers, which should build only
@@ -189,8 +185,8 @@ preConfigure() {
     fi
 
     # Eval the preConfigure script from nix expression.
-    eval $providedPreConfigure;
-    env;
+    eval "$providedPreConfigure"
+
     # Perform the build in a different directory.
     mkdir ../build
     cd ../build
@@ -204,6 +200,15 @@ postConfigure() {
 }
 
 
+preInstall() {
+    # Make ‘lib64’ a symlink to ‘lib’.
+    if [ -n "$is64bit" -a -z "$enableMultilib" ]; then
+        mkdir -p $out/lib
+        ln -s lib $out/lib64
+    fi
+}
+
+
 postInstall() {
     # Remove precompiled headers for now.  They are very big and
     # probably not very useful yet.
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index 62dbad74758..2fb8f9d73b5 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -67,7 +67,6 @@ let version = "4.8.3";
     patches = []
       ++ optional enableParallelBuilding ./parallel-bconfig.patch
       ++ optional (cross != null) ./libstdc++-target.patch
-      # ++ optional noSysDirs ./no-sys-dirs.patch
       # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
       # target libraries and tools.
       ++ optional langAda ./gnat-cflags.patch
@@ -304,14 +303,21 @@ stdenv.mkDerivation ({
         "\"--with-host-libstdcxx=-Wl,-rpath,\$prefix/lib/amd64 -lstdc++\"
          \"--with-boot-ldflags=-L../prev-x86_64-pc-solaris2.11/libstdc++-v3/src/.libs\""}
     );
-    ${stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit)
-      ''
-        export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
-        export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
-        export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
-        export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
-      ''}
-    '';
+  '' + stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) ''
+    export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
+    export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
+    export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
+    export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
+      configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
+      makeFlagsArray+=( \
+       CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
+       CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
+       FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
+      )
+    fi
+  '';
 
   dontDisableStatic = true;
 
@@ -494,9 +500,11 @@ stdenv.mkDerivation ({
     else null;
 
   passthru =
-    { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo enableMultilib version; };
+    { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; };
+
+  inherit enableParallelBuilding enableMultilib;
 
-  inherit enableParallelBuilding;
+  inherit (stdenv) is64bit;
 
   meta = {
     homepage = http://gcc.gnu.org/;
diff --git a/pkgs/development/compilers/gcc/4.8/no-sys-dirs.patch b/pkgs/development/compilers/gcc/4.8/no-sys-dirs.patch
deleted file mode 100644
index 79901703cb8..00000000000
--- a/pkgs/development/compilers/gcc/4.8/no-sys-dirs.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-diff -ru gcc-4.3.1-orig/gcc/cppdefault.c gcc-4.3.1/gcc/cppdefault.c
---- gcc-4.3.1-orig/gcc/cppdefault.c	2007-07-26 10:37:01.000000000 +0200
-+++ gcc-4.3.1/gcc/cppdefault.c	2008-06-25 17:48:23.000000000 +0200
-@@ -41,6 +41,10 @@
- # undef CROSS_INCLUDE_DIR
- #endif
- 
-+#undef LOCAL_INCLUDE_DIR
-+#undef SYSTEM_INCLUDE_DIR
-+#undef STANDARD_INCLUDE_DIR
-+
- const struct default_include cpp_include_defaults[]
- #ifdef INCLUDE_DEFAULTS
- = INCLUDE_DEFAULTS;
-diff -ru gcc-4.3.1-orig/gcc/gcc.c gcc-4.3.1/gcc/gcc.c
---- gcc-4.3.1-orig/gcc/gcc.c	2008-03-02 23:55:19.000000000 +0100
-+++ gcc-4.3.1/gcc/gcc.c	2008-06-25 17:52:53.000000000 +0200
-@@ -1478,10 +1478,10 @@
- /* Default prefixes to attach to command names.  */
- 
- #ifndef STANDARD_STARTFILE_PREFIX_1
--#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
-+#define STANDARD_STARTFILE_PREFIX_1 ""
- #endif
- #ifndef STANDARD_STARTFILE_PREFIX_2
--#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
-+#define STANDARD_STARTFILE_PREFIX_2 ""
- #endif
- 
- #ifdef CROSS_DIRECTORY_STRUCTURE  /* Don't use these prefixes for a cross compiler.  */
---- gcc-4.3.1-orig/gcc/Makefile.in	2008-05-11 20:54:15.000000000 +0200
-+++ gcc-4.3.1/gcc/Makefile.in	2008-06-25 17:48:23.000000000 +0200
-@@ -3277,7 +3281,7 @@
-   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
--  -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-+  -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-   -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-   -DPREFIX=\"$(prefix)/\" \
diff --git a/pkgs/development/compilers/ghdl/default.nix b/pkgs/development/compilers/ghdl/default.nix
index 8b14dbc5cbf..7b2e03f8d57 100644
--- a/pkgs/development/compilers/ghdl/default.nix
+++ b/pkgs/development/compilers/ghdl/default.nix
@@ -34,14 +34,14 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cp ghdl_mcode $out/bin
 
-    ensureDir $out/share/ghdl_mcode/translate
+    mkdir -p $out/share/ghdl_mcode/translate
     cp -R ../lib $out/share/ghdl_mcode/translate
     cp -R ../../libraries $out/share/ghdl_mcode
 
-    ensureDir $out/share/man/man1
+    mkdir -p $out/share/man/man1
     cp ../../doc/ghdl.1 $out/share/man/man1/ghdl_mcode.1
 
     # Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
diff --git a/pkgs/development/compilers/go/1.3.nix b/pkgs/development/compilers/go/1.3.nix
index b9178d5e61c..fafa045e562 100644
--- a/pkgs/development/compilers/go/1.3.nix
+++ b/pkgs/development/compilers/go/1.3.nix
@@ -69,7 +69,7 @@ stdenv.mkDerivation {
     # http://lists.science.uu.nl/pipermail/nix-dev/2013-October/011891.html
     # Fix for "libgcc_s.so.1 must be installed for pthread_cancel to work"
     # during tests:
-    export LD_LIBRARY_PATH="$(dirname $(echo ${stdenv.gcc.gcc}/lib*/libgcc_s.so))"
+    export LD_LIBRARY_PATH="$(dirname $(echo ${stdenv.gcc.gcc}/lib/libgcc_s.so))"
 
     mkdir -p "$out/bin"
     export GOROOT="$(pwd)/"
diff --git a/pkgs/development/compilers/go/gox.nix b/pkgs/development/compilers/go/gox.nix
index 705cb6e5c28..da40b7570fe 100644
--- a/pkgs/development/compilers/go/gox.nix
+++ b/pkgs/development/compilers/go/gox.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ go ];
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     export GOPATH=$src
     go build -v -o $out/bin/gox github.com/mitchellh/gox
   '';
diff --git a/pkgs/development/compilers/gwt/2.4.0.nix b/pkgs/development/compilers/gwt/2.4.0.nix
index 65208b062c2..f0dc9378c4f 100644
--- a/pkgs/development/compilers/gwt/2.4.0.nix
+++ b/pkgs/development/compilers/gwt/2.4.0.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   buildInputs = [ unzip ];
 
   installPhase = ''
-    ensureDir $out
+    mkdir -p $out
     unzip $src
     mv gwt-2.4.0 $out/bin
   '';
diff --git a/pkgs/development/compilers/mercury/default.nix b/pkgs/development/compilers/mercury/default.nix
index 5ea922a371a..21af582c594 100644
--- a/pkgs/development/compilers/mercury/default.nix
+++ b/pkgs/development/compilers/mercury/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   preConfigure = ''
-    ensureDir $out/lib/mercury/cgi-bin ;
+    mkdir -p $out/lib/mercury/cgi-bin ;
     configureFlags="--enable-deep-profiler=$out/lib/mercury/cgi-bin";
   '';
 
diff --git a/pkgs/development/compilers/ocaml/3.11.2.nix b/pkgs/development/compilers/ocaml/3.11.2.nix
index cffd7c3f54a..64cf8a9f9f7 100644
--- a/pkgs/development/compilers/ocaml/3.11.2.nix
+++ b/pkgs/development/compilers/ocaml/3.11.2.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     patch -p0 < ${./mips64.patch}
   '';
   postBuild = ''
-    ensureDir $out/include
+    mkdir -p $out/include
     ln -sv $out/lib/ocaml/caml $out/include/caml
   '';
 
diff --git a/pkgs/development/compilers/openjdk-darwin/default.nix b/pkgs/development/compilers/openjdk-darwin/default.nix
index 68708726c85..8d3cbef75d4 100644
--- a/pkgs/development/compilers/openjdk-darwin/default.nix
+++ b/pkgs/development/compilers/openjdk-darwin/default.nix
@@ -1,16 +1,18 @@
-{ stdenv, fetchurl, setJavaClassPath }:
+{ stdenv, fetchurl, unzip, setJavaClassPath }:
 let
   jdk = stdenv.mkDerivation {
-    name = "openjdk6-b16-24_apr_2009-r1";
+    name = "openjdk-7u60b30";
 
+    # From https://github.com/alexkasko/openjdk-unofficial-builds
     src = fetchurl {
-      url = http://landonf.bikemonkey.org/static/soylatte/bsd-dist/openjdk6_darwin/openjdk6-b16-24_apr_2009-r1.tar.bz2;
-      sha256 = "14pbv6jjk95k7hbgiwyvjdjv8pccm7m8a130k0q7mjssf4qmpx1v";
+      url = https://bitbucket.org/alexkasko/openjdk-unofficial-builds/downloads/openjdk-1.7.0-u60-unofficial-macosx-x86_64-bundle.zip;
+      sha256 = "af510a4d566712d82c17054bb39f91d98c69a85586e244c6123669a0bd4b7401";
     };
 
+    buildInputs = [ unzip ];
+
     installPhase = ''
-      mkdir -p $out
-      cp -vR * $out/
+      mv */Contents/Home $out
 
       # jni.h expects jni_md.h to be in the header search path.
       ln -s $out/include/darwin/*_md.h $out/include/
diff --git a/pkgs/development/compilers/pakcs/default.nix b/pkgs/development/compilers/pakcs/default.nix
index 60071a8f6fa..1fb4318ebb9 100644
--- a/pkgs/development/compilers/pakcs/default.nix
+++ b/pkgs/development/compilers/pakcs/default.nix
@@ -54,13 +54,13 @@ stdenv.mkDerivation rec {
     export LC_ALL=en_US.UTF-8
 
     # Set up link to cymake, which has been built already.
-    ensureDir bin/.local
+    mkdir -p bin/.local
     ln -s ${curryFront}/bin/cymake bin/.local/
   '';
 
   installPhase = ''
     # Prepare PAKCSHOME directory.
-    ensureDir $out/pakcs
+    mkdir -p $out/pakcs
     for d in bin curry2prolog currytools lib tools cpns include www examples docs ; do
       cp -r $d $out/pakcs ;
     done
@@ -80,7 +80,7 @@ stdenv.mkDerivation rec {
     (cd $out/pakcs/www ; make)
 
     # Install bin.
-    ensureDir $out/bin
+    mkdir -p $out/bin
     for b in makecurrycgi .makesavedstate pakcs parsecurry cleancurry \
              addtypes cass currybrowse currycreatemake currydoc currytest \
              dataToXml erd2curry ; do
@@ -88,7 +88,7 @@ stdenv.mkDerivation rec {
     done
 
     # Place emacs lisp files in expected locations.
-    ensureDir $out/share/emacs/site-lisp/curry-pakcs
+    mkdir -p $out/share/emacs/site-lisp/curry-pakcs
     for e in "tools/emacs/"*.el ; do
       cp $e $out/share/emacs/site-lisp/curry-pakcs/ ;
     done
diff --git a/pkgs/development/compilers/sbcl/bootstrap.nix b/pkgs/development/compilers/sbcl/bootstrap.nix
index c3335ea6d22..015d7dd95da 100644
--- a/pkgs/development/compilers/sbcl/bootstrap.nix
+++ b/pkgs/development/compilers/sbcl/bootstrap.nix
@@ -15,9 +15,9 @@ stdenv.mkDerivation rec {
     };
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cp -p src/runtime/sbcl $out/bin
-    ensureDir $out/share/sbcl
+    mkdir -p $out/share/sbcl
     cp -p output/sbcl.core $out/share/sbcl
   '';
 
diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix
index 7f7a76060bd..d3892d43d15 100644
--- a/pkgs/development/compilers/sbcl/default.nix
+++ b/pkgs/development/compilers/sbcl/default.nix
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
 
   preBuild = ''
     export INSTALL_ROOT=$out
-    ensureDir test-home
+    mkdir -p test-home
     export HOME=$PWD/test-home
   '';
 
diff --git a/pkgs/development/compilers/smlnj/bootstrap.nix b/pkgs/development/compilers/smlnj/bootstrap.nix
index 27fdf75cc25..39a1bbd0df3 100644
--- a/pkgs/development/compilers/smlnj/bootstrap.nix
+++ b/pkgs/development/compilers/smlnj/bootstrap.nix
@@ -22,10 +22,10 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     rsync -av bin/ $out/bin/
 
-    ensureDir $out/lib
+    mkdir -p $out/lib
     rsync -av lib/ $out/lib/
   '';
 
diff --git a/pkgs/development/eclipse/ecj/default.nix b/pkgs/development/eclipse/ecj/default.nix
index 786fcdba18a..0f52e879863 100644
--- a/pkgs/development/eclipse/ecj/default.nix
+++ b/pkgs/development/eclipse/ecj/default.nix
@@ -54,6 +54,6 @@ stdenv.mkDerivation rec {
     # http://www.eclipse.org/legal/epl-v10.html (free software, copyleft)
     license = "EPLv1.0";
 
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix
index bbd9e003b2c..600884db5e6 100644
--- a/pkgs/development/interpreters/perl/5.16/default.nix
+++ b/pkgs/development/interpreters/perl/5.16/default.nix
@@ -64,29 +64,5 @@ stdenv.mkDerivation rec {
 
   setupHook = ./setup-hook.sh;
 
-  doCheck = !stdenv.isDarwin;
-
-  # some network-related tests don't work, mostly probably due to our sandboxing
-  testsToSkip = ''
-    lib/Net/hostent.t \
-    dist/IO/t/{io_multihomed.t,io_sock.t} \
-    dist/Net-Ping/t/*.t \
-    cpan/autodie/t/truncate.t \
-    t/porting/{maintainers.t,regen.t} \
-    cpan/Socket/t/get{name,addr}info.t \
-  '' + optionalString stdenv.isFreeBSD ''
-    cpan/CPANPLUS/t/04_CPANPLUS-Module.t \
-    cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM.t \
-  '' + " ";
-
-  postPatch = optionalString (!stdenv.isDarwin) /* this failed on Darwin, no idea why */ ''
-    for test in ${testsToSkip}; do
-      echo "Removing test" $test
-      rm "$test"
-      pat=`echo "$test" | sed 's,/,\\\\/,g'` # just escape slashes
-      sed "/^$pat/d" -i MANIFEST
-    done
-  '';
-
   passthru.libPrefix = "lib/perl5/site_perl";
 }
diff --git a/pkgs/development/libraries/aacskeys/default.nix b/pkgs/development/libraries/aacskeys/default.nix
index 088f2cc4b1e..0b20d8a41ea 100644
--- a/pkgs/development/libraries/aacskeys/default.nix
+++ b/pkgs/development/libraries/aacskeys/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
   buildInputs = [openssl jdk premake3];
 
   installPhase = ''
-    ensureDir $out/{bin,lib,share/${baseName}}
+    mkdir -p $out/{bin,lib,share/${baseName}}
 
     # Install lib
     install -Dm444 lib/linux/libaacskeys.so $out/lib
diff --git a/pkgs/development/libraries/apache-activemq/default.nix b/pkgs/development/libraries/apache-activemq/default.nix
index d55ff9049ed..2f2792dec14 100644
--- a/pkgs/development/libraries/apache-activemq/default.nix
+++ b/pkgs/development/libraries/apache-activemq/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   phases = [ "unpackPhase" "installPhase" ];
 
   installPhase = ''
-    ensureDir $out
+    mkdir -p $out
     mv * $out/
     for j in `find $out/lib -name "*.jar"`; do
       cp="''${cp:+"$cp:"}$j";
diff --git a/pkgs/development/libraries/at-spi2-atk/default.nix b/pkgs/development/libraries/at-spi2-atk/default.nix
new file mode 100644
index 00000000000..416a33b09a2
--- /dev/null
+++ b/pkgs/development/libraries/at-spi2-atk/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, python, pkgconfig, popt, atk, libX11, libICE, xlibs, libXi
+, intltool, dbus_glib, at_spi2_core, libSM }:
+
+stdenv.mkDerivation rec {
+  versionMajor = "2.12";
+  versionMinor = "1";
+  moduleName   = "at-spi2-atk";
+  name = "${moduleName}-${versionMajor}.${versionMinor}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${moduleName}/${versionMajor}/${name}.tar.xz";
+    sha256 = "5fa9c527bdec028e06797563cd52d49bcf06f638549df983424d88db89bb1336";
+  };
+
+  buildInputs = [ python pkgconfig popt atk libX11 libICE xlibs.libXtst libXi
+                  intltool dbus_glib at_spi2_core libSM ];
+
+  meta = with stdenv.lib; {
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/at-spi2-core/default.nix b/pkgs/development/libraries/at-spi2-core/default.nix
new file mode 100644
index 00000000000..d60a0ff7480
--- /dev/null
+++ b/pkgs/development/libraries/at-spi2-core/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, python, pkgconfig, popt, intltool, dbus_glib
+, libX11, xextproto, libSM, libICE, libXtst, libXi, gobjectIntrospection }:
+
+stdenv.mkDerivation (rec {
+  versionMajor = "2.12";
+  versionMinor = "0";
+  moduleName   = "at-spi2-core";
+  name = "${moduleName}-${versionMajor}.${versionMinor}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${moduleName}/${versionMajor}/${name}.tar.xz";
+    sha256 = "12gvsgdaxnxskndlhlmdkc50cfqgmzfc4n8la9944fz5k3fhwmfv";
+  };
+
+  buildInputs = [
+    python pkgconfig popt  intltool dbus_glib
+    libX11 xextproto libSM libICE libXtst libXi
+    gobjectIntrospection
+  ];
+
+  # ToDo: on non-NixOS we create a symlink from there?
+  configureFlags = "--with-dbus-daemondir=/run/current-system/sw/bin/";
+
+  meta = with stdenv.lib; {
+    platforms = platforms.linux;
+  };
+}
+  // stdenv.lib.optionalAttrs stdenv.isDarwin {
+    NIX_LDFLAGS = "-lintl";
+  }
+)
+
diff --git a/pkgs/development/libraries/boost/1.55.nix b/pkgs/development/libraries/boost/1.55.nix
index df29b2402f8..bf355f7169c 100644
--- a/pkgs/development/libraries/boost/1.55.nix
+++ b/pkgs/development/libraries/boost/1.55.nix
@@ -75,6 +75,7 @@ stdenv.mkDerivation {
     ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install${withToolset}
     rm $out/bin/bjam
     ln -s $out/bin/b2 $out/bin/bjam
+    rm -rf $out/share/boost-build/example
   '';
 
   crossAttrs = rec {
diff --git a/pkgs/development/libraries/bwidget/default.nix b/pkgs/development/libraries/bwidget/default.nix
index 81f4f9a287e..0d1913bc8e7 100644
--- a/pkgs/development/libraries/bwidget/default.nix
+++ b/pkgs/development/libraries/bwidget/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   dontBuild = true;
 
   installPhase = ''
-    ensureDir "$out/lib/${passthru.libPrefix}"
+    mkdir -p "$out/lib/${passthru.libPrefix}"
     cp -R *.tcl lang images "$out/lib/${passthru.libPrefix}"
   '';
 
diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix
index 5e211c74d5e..f0c4da75567 100644
--- a/pkgs/development/libraries/fontconfig/default.nix
+++ b/pkgs/development/libraries/fontconfig/default.nix
@@ -20,6 +20,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ pkgconfig expat ];
 
   configureFlags = [
+    "--sysconfdir=/etc"
     "--with-cache-dir=/var/cache/fontconfig"
     "--disable-docs"
     "--with-default-fonts="
@@ -39,7 +40,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   # Don't try to write to /var/cache/fontconfig at install time.
-  installFlags = "fc_cachedir=$(TMPDIR)/dummy RUN_FC_CACHE_TEST=false";
+  installFlags = "sysconfdir=$(out)/etc fc_cachedir=$(TMPDIR)/dummy RUN_FC_CACHE_TEST=false";
 
   postInstall = ''
     cd "$out/etc/fonts" && tar xvf ${infinality_patch}
diff --git a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
index c983f9f6a61..06e820633b8 100644
--- a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
+++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
@@ -1,6 +1,6 @@
 findGdkPixbufLoaders() {
 
-	if [ -z "$IN_NIX_SHELL" ]; then
+	if [ -n "$out" ] && [ -z "$IN_NIX_SHELL" ]; then
 
 		# set pixbuf loaders.cache for this package
 
diff --git a/pkgs/development/libraries/glib/darwin-compilation.patch b/pkgs/development/libraries/glib/darwin-compilation.patch
new file mode 100644
index 00000000000..f215eef798a
--- /dev/null
+++ b/pkgs/development/libraries/glib/darwin-compilation.patch
@@ -0,0 +1,24 @@
+Fix compilation on Mac OS X with gcc 4.8.
+
+diff -ru glib-2.40.0-orig/gio/gdummyfile.c glib-2.40.0/gio/gdummyfile.c
+--- glib-2.40.0-orig/gio/gdummyfile.c   2014-02-03 18:40:41.000000000 +0100
++++ glib-2.40.0/gio/gdummyfile.c        2014-07-15 10:58:31.000000000 +0200
+@@ -454,7 +454,8 @@
+   result = g_malloc (escaped_string_end - escaped_string + 1);
+        
+   out = result;
+-  for (in = escaped_string; in < escaped_string_end; in++) 
++  in = escaped_string;
++  for (; in < escaped_string_end; in++) 
+     {
+       character = *in;
+       if (*in == '%') 
+@@ -551,6 +552,7 @@
+   
+   decoded->scheme = g_malloc (p - uri);
+   out = decoded->scheme;
+-  for (in = uri; in < p - 1; in++)
++  in = uri;
++  for (; in < p - 1; in++)
+     *out++ = g_ascii_tolower (*in);
+   *out = 0;
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 9a592d4f954..14e72495968 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -49,6 +49,8 @@ stdenv.mkDerivation rec {
     sha256 = "1d98mbqjmc34s8095lkw1j1bwvnnkw9581yfvjaikjvfjsaz29qd";
   };
 
+  patches = optional stdenv.isDarwin ./darwin-compilation.patch;
+
   setupHook = ./setup-hook.sh;
 
   buildInputs = [ libelf ]
@@ -67,6 +69,11 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl"
     + optionalString stdenv.isSunOS " -DBSD_COMP";
 
+  preBuild = optionalString stdenv.isDarwin
+    ''
+      export MACOSX_DEPLOYMENT_TARGET=
+    '';
+
   enableParallelBuilding = true;
 
   inherit doCheck;
diff --git a/pkgs/development/libraries/glibc/2.19/common.nix b/pkgs/development/libraries/glibc/2.19/common.nix
index 43ba2a9ca11..cd1ba747d7c 100644
--- a/pkgs/development/libraries/glibc/2.19/common.nix
+++ b/pkgs/development/libraries/glibc/2.19/common.nix
@@ -58,6 +58,8 @@ stdenv.mkDerivation ({
       ./fix_path_attribute_in_getconf.patch
 
       ./fix-math.patch
+
+      ./cve-2014-0475.patch
     ];
 
   postPatch = ''
diff --git a/pkgs/development/libraries/glibc/2.19/cve-2014-0475.patch b/pkgs/development/libraries/glibc/2.19/cve-2014-0475.patch
new file mode 100644
index 00000000000..a4f983de8f6
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.19/cve-2014-0475.patch
@@ -0,0 +1,170 @@
+Picked from upstream commits, but excluding changes to news and tests:
+d183645616b0533 and 4e8f95a0df7c2
+Also see https://sourceware.org/bugzilla/show_bug.cgi?id=17137
+
+diff --git a/locale/setlocale.c b/locale/setlocale.c
+index 9458468..6455b8b 100644
+--- a/locale/setlocale.c
++++ b/locale/setlocale.c
+@@ -272,6 +272,8 @@ setlocale (int category, const char *locale)
+ 	 of entries of the form `CATEGORY=VALUE'.  */
+       const char *newnames[__LC_LAST];
+       struct __locale_data *newdata[__LC_LAST];
++      /* Copy of the locale argument, for in-place splitting.  */
++      char *locale_copy = NULL;
+ 
+       /* Set all name pointers to the argument name.  */
+       for (category = 0; category < __LC_LAST; ++category)
+@@ -281,7 +283,13 @@ setlocale (int category, const char *locale)
+       if (__glibc_unlikely (strchr (locale, ';') != NULL))
+ 	{
+ 	  /* This is a composite name.  Make a copy and split it up.  */
+-	  char *np = strdupa (locale);
++	  locale_copy = strdup (locale);
++	  if (__glibc_unlikely (locale_copy == NULL))
++	    {
++	      __libc_rwlock_unlock (__libc_setlocale_lock);
++	      return NULL;
++	    }
++	  char *np = locale_copy;
+ 	  char *cp;
+ 	  int cnt;
+ 
+@@ -299,6 +307,7 @@ setlocale (int category, const char *locale)
+ 		{
+ 		error_return:
+ 		  __libc_rwlock_unlock (__libc_setlocale_lock);
++		  free (locale_copy);
+ 
+ 		  /* Bogus category name.  */
+ 		  ERROR_RETURN;
+@@ -391,8 +400,9 @@ setlocale (int category, const char *locale)
+       /* Critical section left.  */
+       __libc_rwlock_unlock (__libc_setlocale_lock);
+ 
+-      /* Free the resources (the locale path variable).  */
++      /* Free the resources.  */
+       free (locale_path);
++      free (locale_copy);
+ 
+       return composite;
+     }
+diff --git a/locale/findlocale.c b/locale/findlocale.c
+index bbaf708..22e8b53 100644
+--- a/locale/findlocale.c
++++ b/locale/findlocale.c
+@@ -17,6 +17,7 @@
+    <http://www.gnu.org/licenses/>.  */
+ 
+ #include <assert.h>
++#include <errno.h>
+ #include <locale.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -57,6 +58,45 @@ struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST];
+ 
+ const char _nl_default_locale_path[] attribute_hidden = LOCALEDIR;
+ 
++/* Checks if the name is actually present, that is, not NULL and not
++   empty.  */
++static inline int
++name_present (const char *name)
++{
++  return name != NULL && name[0] != '\0';
++}
++
++/* Checks that the locale name neither extremely long, nor contains a
++   ".." path component (to prevent directory traversal).  */
++static inline int
++valid_locale_name (const char *name)
++{
++  /* Not set.  */
++  size_t namelen = strlen (name);
++  /* Name too long.  The limit is arbitrary and prevents stack overflow
++     issues later.  */
++  if (__glibc_unlikely (namelen > 255))
++    return 0;
++  /* Directory traversal attempt.  */
++  static const char slashdot[4] = {'/', '.', '.', '/'};
++  if (__glibc_unlikely (memmem (name, namelen,
++				slashdot, sizeof (slashdot)) != NULL))
++    return 0;
++  if (namelen == 2 && __glibc_unlikely (name[0] == '.' && name [1] == '.'))
++    return 0;
++  if (namelen >= 3
++      && __glibc_unlikely (((name[0] == '.'
++			     && name[1] == '.'
++			     && name[2] == '/')
++			    || (name[namelen - 3] == '/'
++				&& name[namelen - 2] == '.'
++				&& name[namelen - 1] == '.'))))
++    return 0;
++  /* If there is a slash in the name, it must start with one.  */
++  if (__glibc_unlikely (memchr (name, '/', namelen) != NULL) && name[0] != '/')
++    return 0;
++  return 1;
++}
+ 
+ struct __locale_data *
+ internal_function
+@@ -65,7 +105,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
+ {
+   int mask;
+   /* Name of the locale for this category.  */
+-  char *loc_name;
++  char *loc_name = (char *) *name;
+   const char *language;
+   const char *modifier;
+   const char *territory;
+@@ -73,31 +113,39 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
+   const char *normalized_codeset;
+   struct loaded_l10nfile *locale_file;
+ 
+-  if ((*name)[0] == '\0')
++  if (loc_name[0] == '\0')
+     {
+       /* The user decides which locale to use by setting environment
+ 	 variables.  */
+-      *name = getenv ("LC_ALL");
+-      if (*name == NULL || (*name)[0] == '\0')
+-	*name = getenv (_nl_category_names.str
++      loc_name = getenv ("LC_ALL");
++      if (!name_present (loc_name))
++	loc_name = getenv (_nl_category_names.str
+ 			+ _nl_category_name_idxs[category]);
+-      if (*name == NULL || (*name)[0] == '\0')
+-	*name = getenv ("LANG");
++      if (!name_present (loc_name))
++	loc_name = getenv ("LANG");
++      if (!name_present (loc_name))
++	loc_name = (char *) _nl_C_name;
+     }
+ 
+-  if (*name == NULL || (*name)[0] == '\0'
+-      || (__builtin_expect (__libc_enable_secure, 0)
+-	  && strchr (*name, '/') != NULL))
+-    *name = (char *) _nl_C_name;
++  /* We used to fall back to the C locale if the name contains a slash
++     character '/', but we now check for directory traversal in
++     valid_locale_name, so this is no longer necessary.  */
+ 
+-  if (__builtin_expect (strcmp (*name, _nl_C_name), 1) == 0
+-      || __builtin_expect (strcmp (*name, _nl_POSIX_name), 1) == 0)
++  if (__builtin_expect (strcmp (loc_name, _nl_C_name), 1) == 0
++      || __builtin_expect (strcmp (loc_name, _nl_POSIX_name), 1) == 0)
+     {
+       /* We need not load anything.  The needed data is contained in
+ 	 the library itself.  */
+       *name = (char *) _nl_C_name;
+       return _nl_C[category];
+     }
++  else if (!valid_locale_name (loc_name))
++    {
++      __set_errno (EINVAL);
++      return NULL;
++    }
++
++  *name = loc_name;
+ 
+   /* We really have to load some data.  First we try the archive,
+      but only if there was no LOCPATH environment variable specified.  */
diff --git a/pkgs/development/libraries/haskell/ghc-heap-view/default.nix b/pkgs/development/libraries/haskell/ghc-heap-view/default.nix
index c32d3be5308..1df6885280c 100644
--- a/pkgs/development/libraries/haskell/ghc-heap-view/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-heap-view/default.nix
@@ -8,7 +8,7 @@ cabal.mkDerivation (self: {
   sha256 = "1qi7f3phj2j63x1wd2cvk36945cxd84s12zs03hlrn49wzx2pf1n";
   buildDepends = [ binary transformers ];
   postInstall = ''
-    ensureDir "$out/share/ghci"
+    mkdir -p "$out/share/ghci"
     ln -s "$out/share/$pname-$version/ghci" "$out/share/ghci/$pname"
   '';
   meta = {
diff --git a/pkgs/development/libraries/haskell/ghc-mod/default.nix b/pkgs/development/libraries/haskell/ghc-mod/default.nix
index f876fb5aba8..a9c06e80f8a 100644
--- a/pkgs/development/libraries/haskell/ghc-mod/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-mod/default.nix
@@ -26,7 +26,7 @@ cabal.mkDerivation (self: {
     make
     rm Makefile
     cd ..
-    ensureDir "$out/share/emacs"
+    mkdir -p "$out/share/emacs"
     mv $pname-$version emacs/site-lisp
     mv $out/bin/ghc-mod $out/bin/.ghc-mod-wrapped
     cat - > $out/bin/ghc-mod <<EOF
diff --git a/pkgs/development/libraries/haskell/ghc-vis/default.nix b/pkgs/development/libraries/haskell/ghc-vis/default.nix
index bfcc3e70472..2a4badd91e3 100644
--- a/pkgs/development/libraries/haskell/ghc-vis/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-vis/default.nix
@@ -14,7 +14,7 @@ cabal.mkDerivation (self: {
   ];
   jailbreak = true;
   postInstall = ''
-    ensureDir "$out/share/ghci"
+    mkdir -p "$out/share/ghci"
     ln -s "$out/share/$pname-$version/ghci" "$out/share/ghci/$pname"
   '';
   meta = {
diff --git a/pkgs/development/libraries/haskell/hoogle/local.nix b/pkgs/development/libraries/haskell/hoogle/local.nix
index 67f38f260e0..eebfd0224d2 100644
--- a/pkgs/development/libraries/haskell/hoogle/local.nix
+++ b/pkgs/development/libraries/haskell/hoogle/local.nix
@@ -65,7 +65,7 @@ cabal.mkDerivation (self: rec {
         exit 1
     fi
 
-    ensureDir $out/share/hoogle/doc
+    mkdir -p $out/share/hoogle/doc
     export HOOGLE_DOC_PATH=$out/share/hoogle/doc
 
     cd $out/share/hoogle
diff --git a/pkgs/development/libraries/java/junixsocket/default.nix b/pkgs/development/libraries/java/junixsocket/default.nix
index e49e626aa00..317ba601cfb 100644
--- a/pkgs/development/libraries/java/junixsocket/default.nix
+++ b/pkgs/development/libraries/java/junixsocket/default.nix
@@ -14,9 +14,6 @@ stdenv.mkDerivation rec {
 
   preConfigure =
     ''
-      substituteInPlace build.xml \
-        --replace /usr/bin/ "" \
-        --replace macosx darwin
       substituteInPlace src/main/org/newsclub/net/unix/NativeUnixSocketConfig.java \
         --replace /opt/newsclub/lib-native $out/lib
     '';
@@ -25,7 +22,7 @@ stdenv.mkDerivation rec {
 
   ANT_ARGS =
     # Note that our OpenJDK on Darwin is currently 32-bit, so we have to build a 32-bit dylib.
-    (if stdenv.is64bit && !stdenv.isDarwin then [ "-Dskip32=true" ] else [ "-Dskip64=true" ])
+    (if stdenv.is64bit then [ "-Dskip32=true" ] else [ "-Dskip64=true" ])
     ++ [ "-Dgcc=cc" "-Dant.build.javac.source=1.6" ]
     ++ stdenv.lib.optional stdenv.isDarwin "-DisMac=true";
 
diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix
index 247c3666e15..679b091ce72 100644
--- a/pkgs/development/libraries/libav/default.nix
+++ b/pkgs/development/libraries/libav/default.nix
@@ -28,7 +28,7 @@ let
   result = {
     libav_0_8 = libavFun "0.8.13" "1fr3rzykrlm1cla0csm9hqa3gcqp19hf5rgn70nyb9w92r67v685";
     libav_9   = libavFun   "9.14" "07gn4lbqx6wfhb2h2ddj88hcsacwmzb4syalg211m55xmp1g1fp4";
-    libav_10  = libavFun  "10.2"  "06wvk51cnllw6367qagc90sva4jr5d0r6jx8183wcwzwzgv01w29";
+    libav_10  = libavFun  "10.3"  "1fq83rc5534fjqjlhkw5i9k54dmyqn2pgvyillm6pws8rkn9yb5r";
   };
 
   libavFun = version : sha256 : stdenv.mkDerivation rec {
diff --git a/pkgs/development/libraries/libsamplerate/default.nix b/pkgs/development/libraries/libsamplerate/default.nix
index 708d8989304..85d51d0ad71 100644
--- a/pkgs/development/libraries/libsamplerate/default.nix
+++ b/pkgs/development/libraries/libsamplerate/default.nix
@@ -15,10 +15,14 @@ stdenv.mkDerivation rec {
   #--disable-fftw          disable usage of FFTW
   #--disable-cpu-clip      disable tricky cpu specific clipper
 
-  # need headers from the Carbon.framework in /System/Library/Frameworks to
-  # compile this on darwin -- not sure how to handle
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
-    "-I/System/Library/Frameworks/Carbon.framework/Versions/A/Headers";
+  postConfigure = stdenv.lib.optionalString stdenv.isDarwin
+    ''
+      # need headers from the Carbon.framework in /System/Library/Frameworks to
+      # compile this on darwin -- not sure how to handle
+      NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
+
+      substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
+    '';
 
   meta = with stdenv.lib; {
     description = "Sample Rate Converter for audio";
diff --git a/pkgs/development/libraries/libsndfile/default.nix b/pkgs/development/libraries/libsndfile/default.nix
index 8b0eeeb8e57..74140d5f335 100644
--- a/pkgs/development/libraries/libsndfile/default.nix
+++ b/pkgs/development/libraries/libsndfile/default.nix
@@ -12,8 +12,13 @@ stdenv.mkDerivation rec {
 
   # need headers from the Carbon.framework in /System/Library/Frameworks to
   # compile this on darwin -- not sure how to handle
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
-    "-I/System/Library/Frameworks/Carbon.framework/Versions/A/Headers";
+  preConfigure = stdenv.lib.optionalString stdenv.isDarwin
+    ''
+      NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
+    '';
+
+  # Needed on Darwin.
+  NIX_CFLAGS_LINK = "-logg -lvorbis";
 
   meta = with stdenv.lib; {
     description = "A C library for reading and writing files containing sampled sound";
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index 5695967bc3d..bbad10898bf 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -24,7 +24,7 @@ else
 */
 
 let
-  version = "10.2.4";
+  version = "10.2.5";
   # this is the default search path for DRI drivers
   driverLink = "/run/opengl-driver" + stdenv.lib.optionalString stdenv.isi686 "-32";
 in
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
 
   src =  fetchurl {
     url = "ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2";
-    sha256 = "06l18j9vshq2xzhnp6zd6pw0dlfy0qg1cw4zyn1w51gb8h9398h6";
+    sha256 = "039is15p8pkhf8m0yiyb72zybl63xb9ckqzcg3xwi8zlyw5ryidl";
   };
 
   prePatch = "patchShebangs .";
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 7627fb79e99..87953c1158d 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unicode ? true}:
+{ lib, stdenv, fetchurl, unicode ? true }:
 
 let
   /* C++ bindings fail to build on `i386-pc-solaris2.11' with GCC 3.4.3:
@@ -10,7 +10,7 @@ let
      So disable them for now.  */
   cxx = !stdenv.isSunOS;
 in
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "ncurses-5.9";
 
   src = fetchurl {
@@ -18,13 +18,7 @@ stdenv.mkDerivation (rec {
     sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
   };
 
-  clangPatch = fetchurl {
-    # Patch referenced from https://github.com/Homebrew/homebrew-dupes/issues/43
-    url = "http://lists.gnu.org/archive/html/bug-ncurses/2011-04/txtkWQqiQvcZe.txt";
-    sha256 = "03lrwqvb0r2qgi8hz7ayd3g26d6xilr3c92j8li3b77kdc0w0rlv";
-  };
-
-  patches = [ ./patch-ac ] ++ stdenv.lib.optional stdenv.isDarwin clangPatch;
+  patches = [ ./patch-ac ];
 
   configureFlags = ''
     --with-shared --without-debug --enable-pc-files --enable-symlinks
@@ -41,6 +35,8 @@ stdenv.mkDerivation (rec {
     export configureFlags="$configureFlags --includedir=$out/include"
     export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig"
     mkdir -p "$PKG_CONFIG_LIBDIR"
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace -no-cpp-precomp ""
   '';
 
   selfNativeBuildInput = true;
@@ -50,8 +46,8 @@ stdenv.mkDerivation (rec {
   preBuild =
     # On Darwin, we end up using the native `sed' during bootstrap, and it
     # fails to run this command, which isn't needed anyway.
-    stdenv.lib.optionalString (!stdenv.isDarwin)
-    ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile'';
+    lib.optionalString (!stdenv.isDarwin)
+      ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile'';
 
   # When building a wide-character (Unicode) build, create backward
   # compatibility links from the the "normal" libraries to the
@@ -71,6 +67,8 @@ stdenv.mkDerivation (rec {
     ln -svf ncursesw5-config $out/bin/ncurses5-config
   '' else "";
 
+  postFixup = lib.optionalString stdenv.isDarwin "rm $out/lib/*.so";
+
   meta = {
     description = "GNU Ncurses, a free software emulation of curses in SVR4 and more";
 
@@ -90,9 +88,9 @@ stdenv.mkDerivation (rec {
 
     homepage = http://www.gnu.org/software/ncurses/;
 
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
 
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-    platforms = stdenv.lib.platforms.all;
+    maintainers = [ lib.maintainers.ludo ];
+    platforms = lib.platforms.all;
   };
-} // ( if stdenv.isDarwin then { postFixup = "rm $out/lib/*.so"; } else { } ) )
+}
diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix
index ea858417b2f..7dafcfce948 100644
--- a/pkgs/development/libraries/opencv/default.nix
+++ b/pkgs/development/libraries/opencv/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, fetchurl, cmake, gtk, libjpeg, libpng, libtiff, jasper, ffmpeg
-, pkgconfig, gstreamer, xineLib, glib, python27, python27Packages }:
+{ lib, stdenv, fetchurl, cmake, gtk, libjpeg, libpng, libtiff, jasper, ffmpeg
+, pkgconfig, gstreamer, xineLib, glib, python27, python27Packages
+, enableBloat ? false }:
 
 let v = "2.4.7"; in
 
@@ -11,8 +12,9 @@ stdenv.mkDerivation rec {
     sha256 = "0hravl3yhyv4r4n7vb055d4qnp893q2hc0fcmmncfh7sbdrnr3f4";
   };
 
-  buildInputs = [ gtk glib libjpeg libpng libtiff jasper ffmpeg xineLib gstreamer
-    python27 python27Packages.numpy ];
+  buildInputs =
+    [ libjpeg libpng libtiff ]
+    ++ lib.optionals enableBloat [ gtk glib jasper ffmpeg xineLib gstreamer python27 python27Packages.numpy ];
 
   nativeBuildInputs = [ cmake pkgconfig ];
 
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index 93f7cbe1a1f..8c88df984f0 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -2,7 +2,7 @@
 , withCryptodev ? false, cryptodevHeaders }:
 
 let
-  name = "openssl-1.0.1h";
+  name = "openssl-1.0.1i";
 
   opensslCrossSystem = stdenv.lib.attrByPath [ "openssl" "system" ]
     (throw "openssl needs its platform name cross building" null)
@@ -43,7 +43,7 @@ stdenv.mkDerivation {
       "http://www.openssl.org/source/${name}.tar.gz"
       "http://openssl.linux-mirror.org/source/${name}.tar.gz"
     ];
-    sha256 = "14yhsgag5as7nhxnw7f0vklwjwa3pmn1i15nmp3f4qxa6sc8l74x";
+    sha256 = "1izwv1wzqdw8aqnvb70jcqpqp0rvkcm22w5c1dm9l1kpr939y5rw";
   };
 
   patches = patchesCross false;
@@ -65,7 +65,7 @@ stdenv.mkDerivation {
   makeFlags = "MANDIR=$(out)/share/man";
 
   # Parallel building is broken in OpenSSL.
-  #enableParallelBuilding = true;
+  enableParallelBuilding = false;
 
   postInstall =
     ''
diff --git a/pkgs/development/libraries/readline/no-arch_only-6.3.patch b/pkgs/development/libraries/readline/no-arch_only-6.3.patch
new file mode 100644
index 00000000000..7c46dbad962
--- /dev/null
+++ b/pkgs/development/libraries/readline/no-arch_only-6.3.patch
@@ -0,0 +1,13 @@
+diff -ru -x '*~' readline-6.3-orig/support/shobj-conf readline-6.3/support/shobj-conf
+--- support/shobj-conf	2014-02-24 03:06:29.000000000 +0100
++++ support/shobj-conf	2014-07-22 11:18:52.000000000 +0200
+@@ -194,9 +194,6 @@
+ 	# Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
+ 	*)
+ 		case "${host_os}" in
+-		darwin[89]*|darwin1[012]*)
+-			SHOBJ_ARCHFLAGS='-arch_only `/usr/bin/arch`'
+-			;;
+ 		 *) 	# Mac OS X 10.9 (Mavericks) and later
+ 			SHOBJ_ARCHFLAGS=
+ 			# for 32 and 64bit universal library
diff --git a/pkgs/development/libraries/readline/no-arch_only.patch b/pkgs/development/libraries/readline/no-arch_only.patch
new file mode 100644
index 00000000000..b23eab5d9d7
--- /dev/null
+++ b/pkgs/development/libraries/readline/no-arch_only.patch
@@ -0,0 +1,14 @@
+diff -ru -x '*~' readline-6.2-orig/support/shobj-conf readline-6.2/support/shobj-conf
+--- support/shobj-conf	2009-10-28 14:20:21.000000000 +0100
++++ support/shobj-conf	2014-07-01 13:03:28.000000000 +0200
+@@ -168,8 +168,8 @@
+ 	SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
+ 	SHLIB_LIBSUFF='dylib'
+ 
+-	SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup -arch_only `/usr/bin/arch`'
+-	SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
++	SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup'
++	SHLIB_XLDFLAGS='-dynamiclib -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+ 
+ 	SHLIB_LIBS='-lncurses'	# see if -lcurses works on MacOS X 10.1 
+ 	;;
diff --git a/pkgs/development/libraries/readline/readline6.3.nix b/pkgs/development/libraries/readline/readline6.3.nix
index dd39804983a..9f5c9f7b581 100644
--- a/pkgs/development/libraries/readline/readline6.3.nix
+++ b/pkgs/development/libraries/readline/readline6.3.nix
@@ -13,7 +13,9 @@ stdenv.mkDerivation (rec {
   patchFlags = "-p0";
 
   patches =
-    [ ./link-against-ncurses.patch ];
+    [ ./link-against-ncurses.patch
+      ./no-arch_only-6.3.patch
+    ];
 
   meta = {
     description = "GNU Readline, a library for interactive line editing";
diff --git a/pkgs/development/libraries/readline/readline6.nix b/pkgs/development/libraries/readline/readline6.nix
index 05500f345ac..0559113285c 100644
--- a/pkgs/development/libraries/readline/readline6.nix
+++ b/pkgs/development/libraries/readline/readline6.nix
@@ -12,7 +12,9 @@ stdenv.mkDerivation (rec {
 
   patchFlags = "-p0";
   patches =
-    [ ./link-against-ncurses.patch ]
+    [ ./link-against-ncurses.patch
+      ./no-arch_only.patch
+    ]
     ++
     (let
        patch = nr: sha256:
diff --git a/pkgs/development/mobile/androidenv/androidsdk.nix b/pkgs/development/mobile/androidenv/androidsdk.nix
index 1a2124754a2..3c9327f1c59 100644
--- a/pkgs/development/mobile/androidenv/androidsdk.nix
+++ b/pkgs/development/mobile/androidenv/androidsdk.nix
@@ -178,7 +178,7 @@ stdenv.mkDerivation rec {
     
     # Create wrappers to the most important tools and platform tools so that we can run them if the SDK is in our PATH
     
-    ensureDir $out/bin
+    mkdir -p $out/bin
 
     for i in $out/libexec/android-sdk-*/tools/*
     do
diff --git a/pkgs/development/mobile/xcodeenv/simulate-app.nix b/pkgs/development/mobile/xcodeenv/simulate-app.nix
index d25ef0f8e43..c999497d8c0 100644
--- a/pkgs/development/mobile/xcodeenv/simulate-app.nix
+++ b/pkgs/development/mobile/xcodeenv/simulate-app.nix
@@ -10,7 +10,7 @@ in
 stdenv.mkDerivation {
   name = stdenv.lib.replaceChars [" "] [""] name;
   buildCommand = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cat > $out/bin/run-test-simulator << "EOF"
     #! ${stdenv.shell} -e
 
diff --git a/pkgs/development/mobile/xcodeenv/xcodewrapper.nix b/pkgs/development/mobile/xcodeenv/xcodewrapper.nix
index 71e34ee5127..fd375d6213c 100644
--- a/pkgs/development/mobile/xcodeenv/xcodewrapper.nix
+++ b/pkgs/development/mobile/xcodeenv/xcodewrapper.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation {
   name = "xcode-wrapper-"+version;
   buildCommand = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cd $out/bin
     ln -s /usr/bin/xcode-select
     ln -s /usr/bin/xcodebuild
diff --git a/pkgs/development/ocaml-modules/ocamlmake/default.nix b/pkgs/development/ocaml-modules/ocamlmake/default.nix
index 0170119d94e..3f91901d9b6 100644
--- a/pkgs/development/ocaml-modules/ocamlmake/default.nix
+++ b/pkgs/development/ocaml-modules/ocamlmake/default.nix
@@ -14,7 +14,7 @@ in stdenv.mkDerivation {
   };
 
   installPhase = ''
-    ensureDir "$out/include/"
+    mkdir -p "$out/include/"
     cp OCamlMakefile "$out/include/"
   '';
 
diff --git a/pkgs/development/tools/apktool/default.nix b/pkgs/development/tools/apktool/default.nix
index a415ffd152d..23941653575 100644
--- a/pkgs/development/tools/apktool/default.nix
+++ b/pkgs/development/tools/apktool/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     install -D apktool.jar "$out/libexec/apktool/apktool.jar"
-    ensureDir "$out/bin"
+    mkdir -p "$out/bin"
     makeWrapper "${jre}/bin/java" "$out/bin/apktool" \
         --add-flags "-jar $out/libexec/apktool/apktool.jar" \
         --prefix PATH : "${buildTools}/build-tools/android-4.3/"
diff --git a/pkgs/development/tools/etcdctl/default.nix b/pkgs/development/tools/etcdctl/default.nix
index a37ef26f541..5e6438d0f5f 100644
--- a/pkgs/development/tools/etcdctl/default.nix
+++ b/pkgs/development/tools/etcdctl/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     mv etcdctl $out/bin
   '';
 
diff --git a/pkgs/development/tools/gocode/default.nix b/pkgs/development/tools/gocode/default.nix
index 6057c288cf6..30e4b79ee38 100644
--- a/pkgs/development/tools/gocode/default.nix
+++ b/pkgs/development/tools/gocode/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     mv gocode $out/bin
   '';
 
diff --git a/pkgs/development/tools/literate-programming/noweb/default.nix b/pkgs/development/tools/literate-programming/noweb/default.nix
index 291bc29e1b7..4f8691c40ad 100644
--- a/pkgs/development/tools/literate-programming/noweb/default.nix
+++ b/pkgs/development/tools/literate-programming/noweb/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "10hdd6mrk26kyh4bnng4ah5h1pnanhsrhqa7qwqy6dyv3rng44y9";
   };
   preBuild = ''
-    ensureDir $out/lib/noweb
+    mkdir -p $out/lib/noweb
     cd src
     makeFlags="BIN=$out/bin LIB=$out/lib/noweb MAN=$out/share/man TEXINPUTS=$out/share/texmf/tex/latex"
   '';
diff --git a/pkgs/development/tools/misc/autoconf/default.nix b/pkgs/development/tools/misc/autoconf/default.nix
index 38fe289d29a..4dca332722b 100644
--- a/pkgs/development/tools/misc/autoconf/default.nix
+++ b/pkgs/development/tools/misc/autoconf/default.nix
@@ -14,7 +14,8 @@ stdenv.mkDerivation rec {
   # http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6822 for
   # details.
   # There are many test failures on `i386-pc-solaris2.11'.
-  doCheck = ((!stdenv.isCygwin) && (!stdenv.isSunOS));
+  #doCheck = ((!stdenv.isCygwin) && (!stdenv.isSunOS));
+  doCheck = false;
 
   # Don't fixup "#! /bin/sh" in Autoconf, otherwise it will use the
   # "fixed" path in generated files!
diff --git a/pkgs/development/tools/misc/distcc/masq.nix b/pkgs/development/tools/misc/distcc/masq.nix
index 117480670c3..753c35b5d3a 100644
--- a/pkgs/development/tools/misc/distcc/masq.nix
+++ b/pkgs/development/tools/misc/distcc/masq.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation {
 
   phases = [ "installPhase" ];
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
 
     bin=${gccRaw}/bin
 
diff --git a/pkgs/development/tools/misc/grafana/default.nix b/pkgs/development/tools/misc/grafana/default.nix
index 346c7fb6ad2..b1566684cf0 100644
--- a/pkgs/development/tools/misc/grafana/default.nix
+++ b/pkgs/development/tools/misc/grafana/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   phases = ["unpackPhase" "installPhase"];
   installPhase = ''
-    ensureDir $out && cp -R * $out
+    mkdir -p $out && cp -R * $out
     ${optionalString (conf!=null) ''cp ${conf} $out/config.js''}
   '';
 
diff --git a/pkgs/development/tools/misc/opengrok/default.nix b/pkgs/development/tools/misc/opengrok/default.nix
index 8f77b3d7283..d38c862ecfb 100644
--- a/pkgs/development/tools/misc/opengrok/default.nix
+++ b/pkgs/development/tools/misc/opengrok/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ makeWrapper ];
 
   installPhase = ''
-    ensureDir $out
+    mkdir -p $out
     cp -a * $out/
     substituteInPlace $out/bin/OpenGrok --replace /bin/uname ${coreutils}/bin/uname
     wrapProgram $out/bin/OpenGrok \
diff --git a/pkgs/development/tools/node-webkit/default.nix b/pkgs/development/tools/node-webkit/default.nix
index 04ee2962173..1f101776064 100644
--- a/pkgs/development/tools/node-webkit/default.nix
+++ b/pkgs/development/tools/node-webkit/default.nix
@@ -33,8 +33,8 @@ in stdenv.mkDerivation rec {
   installPhase = let
     LD_LIBRARY_PATH = "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit";
   in ''
-    ensureDir $out/bin
-    ensureDir $out/share/node-webkit
+    mkdir -p $out/bin
+    mkdir -p $out/share/node-webkit
     cp -R * $out/share/node-webkit
 
     ln -s ${udev}/lib/libudev.so $out/share/node-webkit/libudev.so.0
diff --git a/pkgs/development/tools/ocaml/deriving/default.nix b/pkgs/development/tools/ocaml/deriving/default.nix
index d53f41b5da5..55bbf3748ea 100644
--- a/pkgs/development/tools/ocaml/deriving/default.nix
+++ b/pkgs/development/tools/ocaml/deriving/default.nix
@@ -52,7 +52,7 @@ versionedDerivation "ocaml-deriving" version {
     # not all tests compile !?
     # (cd tests; make)
 
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cp -a lib $out/
     cp -a syntax $out
 
diff --git a/pkgs/development/tools/packer/default.nix b/pkgs/development/tools/packer/default.nix
index 5cea753dd9c..073de5137f8 100644
--- a/pkgs/development/tools/packer/default.nix
+++ b/pkgs/development/tools/packer/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     XC_ARCH=$(go env GOARCH)
     XC_OS=$(go env GOOS)
 
-    ensureDir $out/bin
+    mkdir -p $out/bin
 
     cd $src/src/github.com/mitchellh/packer
     gox \
diff --git a/pkgs/development/tools/yuicompressor/default.nix b/pkgs/development/tools/yuicompressor/default.nix
index 5dcc30811e2..1a5485af541 100644
--- a/pkgs/development/tools/yuicompressor/default.nix
+++ b/pkgs/development/tools/yuicompressor/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   };
 
   buildCommand = ''
-    ensureDir $out/lib
+    mkdir -p $out/lib
     ln -s $src $out/lib/yuicompressor.jar
   '';
 }