summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-07-21 11:05:58 +0200
committerEelco Dolstra <edolstra@gmail.com>2017-07-21 11:05:58 +0200
commita13802b2c8568426a6d31ab08aaaf2965010a6ce (patch)
treed3bbadb2a5cae436931440b754b96c3ced2771be /pkgs/development/interpreters
parent15f6dcb668dcb6b4bfe33f47091273f978dcc0bf (diff)
parent581637ba5a512e1179cdaf0108931fca32892b32 (diff)
downloadnixlib-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar
nixlib-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.gz
nixlib-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.bz2
nixlib-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.lz
nixlib-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.xz
nixlib-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.zst
nixlib-a13802b2c8568426a6d31ab08aaaf2965010a6ce.zip
Merge remote-tracking branch 'origin/master' into gcc-6
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/elixir/1.3.nix7
-rw-r--r--pkgs/development/interpreters/elixir/1.4.nix7
-rw-r--r--pkgs/development/interpreters/elixir/1.5.nix7
-rw-r--r--pkgs/development/interpreters/elixir/default.nix71
-rw-r--r--pkgs/development/interpreters/elixir/generic-builder.nix77
-rw-r--r--pkgs/development/interpreters/erlang/R20.nix10
-rw-r--r--pkgs/development/interpreters/guile/2.0.nix6
-rw-r--r--pkgs/development/interpreters/guile/default.nix6
-rw-r--r--pkgs/development/interpreters/jruby/default.nix41
-rw-r--r--pkgs/development/interpreters/lfe/1.2.nix7
-rw-r--r--pkgs/development/interpreters/lfe/generic-builder.nix (renamed from pkgs/development/interpreters/lfe/default.nix)42
-rw-r--r--pkgs/development/interpreters/lua-5/5.2.nix12
-rw-r--r--pkgs/development/interpreters/lua-5/5.3.nix12
-rw-r--r--pkgs/development/interpreters/luajit/default.nix87
-rw-r--r--pkgs/development/interpreters/maude/default.nix2
-rw-r--r--pkgs/development/interpreters/perl/default.nix3
-rw-r--r--pkgs/development/interpreters/php/default.nix12
-rw-r--r--pkgs/development/interpreters/python/cpython/2.7/default.nix12
-rw-r--r--pkgs/development/interpreters/ruby/default.nix2
19 files changed, 268 insertions, 155 deletions
diff --git a/pkgs/development/interpreters/elixir/1.3.nix b/pkgs/development/interpreters/elixir/1.3.nix
new file mode 100644
index 000000000000..43d48e2cf7cd
--- /dev/null
+++ b/pkgs/development/interpreters/elixir/1.3.nix
@@ -0,0 +1,7 @@
+{ mkDerivation }:
+
+mkDerivation rec {
+  version = "1.3.4";
+  sha256 = "01qqv1ghvfadcwcr5p88w8j217cgaf094pmpqllij3l0q1yg104l";
+  minimumOTPVersion = "18";
+}
diff --git a/pkgs/development/interpreters/elixir/1.4.nix b/pkgs/development/interpreters/elixir/1.4.nix
new file mode 100644
index 000000000000..9ddd9062acd9
--- /dev/null
+++ b/pkgs/development/interpreters/elixir/1.4.nix
@@ -0,0 +1,7 @@
+{ mkDerivation }:
+
+mkDerivation rec {
+  version = "1.4.5";
+  sha256 = "18ivcxmh5bak13k3rjy7jjzin57rgb2nffhwnqb2wl7bpi8mrarw";
+  minimumOTPVersion = "18";
+}
diff --git a/pkgs/development/interpreters/elixir/1.5.nix b/pkgs/development/interpreters/elixir/1.5.nix
new file mode 100644
index 000000000000..0c3c0304a9b4
--- /dev/null
+++ b/pkgs/development/interpreters/elixir/1.5.nix
@@ -0,0 +1,7 @@
+{ mkDerivation }:
+
+mkDerivation rec {
+  version = "1.5.0-rc.2";
+  sha256 = "0wfxsfz1qbb6iapg8j1qskva6j4mccxqvv79xbz08fzzb6n1wvxa";
+  minimumOTPVersion = "18";
+}
diff --git a/pkgs/development/interpreters/elixir/default.nix b/pkgs/development/interpreters/elixir/default.nix
deleted file mode 100644
index 0e77b2af2524..000000000000
--- a/pkgs/development/interpreters/elixir/default.nix
+++ /dev/null
@@ -1,71 +0,0 @@
-{ stdenv, fetchFromGitHub, erlang, rebar, makeWrapper, coreutils, curl, bash,
-  debugInfo ? false }:
-
-stdenv.mkDerivation rec {
-  name = "elixir-${version}";
-  version = "1.4.4";
-
-  src = fetchFromGitHub {
-    owner = "elixir-lang";
-    repo = "elixir";
-    rev = "v${version}";
-    sha256 = "0m51cirkv1dahw4z2jlmz58cwmpy0dya88myx4wykq0v5bh1xbq8";
-  };
-
-  buildInputs = [ erlang rebar makeWrapper ];
-
-  # Elixir expects that UTF-8 locale to be set (see https://github.com/elixir-lang/elixir/issues/3548).
-  # In other cases there is warnings during compilation.
-  LANG = "en_US.UTF-8";
-  LC_TYPE = "en_US.UTF-8";
-
-  setupHook = ./setup-hook.sh;
-
-  inherit debugInfo;
-
-  buildFlags = if debugInfo
-   then "ERL_COMPILER_OPTIONS=debug_info"
-   else "";
-
-  preBuild = ''
-    # The build process uses ./rebar. Link it to the nixpkgs rebar
-    rm -v rebar
-    ln -s ${rebar}/bin/rebar rebar
-
-    substituteInPlace Makefile \
-      --replace "/usr/local" $out
-  '';
-
-  postFixup = ''
-    # Elixir binaries are shell scripts which run erl. Add some stuff
-    # to PATH so the scripts can run without problems.
-
-    for f in $out/bin/*; do
-     b=$(basename $f)
-      if [ $b == "mix" ]; then continue; fi
-      wrapProgram $f \
-        --prefix PATH ":" "${stdenv.lib.makeBinPath [ erlang coreutils curl bash ]}" \
-        --set CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
-    done
-
-    substituteInPlace $out/bin/mix \
-          --replace "/usr/bin/env elixir" "${coreutils}/bin/env elixir"
-  '';
-
-  meta = with stdenv.lib; {
-    homepage = "http://elixir-lang.org/";
-    description = "A functional, meta-programming aware language built on top of the Erlang VM";
-
-    longDescription = ''
-      Elixir is a functional, meta-programming aware language built on
-      top of the Erlang VM. It is a dynamic language with flexible
-      syntax and macro support that leverages Erlang's abilities to
-      build concurrent, distributed and fault-tolerant applications
-      with hot code upgrades.
-    '';
-
-    license = licenses.epl10;
-    platforms = platforms.unix;
-    maintainers = with maintainers; [ the-kenny havvy couchemar ];
-  };
-}
diff --git a/pkgs/development/interpreters/elixir/generic-builder.nix b/pkgs/development/interpreters/elixir/generic-builder.nix
new file mode 100644
index 000000000000..ff63406aea36
--- /dev/null
+++ b/pkgs/development/interpreters/elixir/generic-builder.nix
@@ -0,0 +1,77 @@
+{ pkgs, stdenv, fetchFromGitHub, erlang, rebar, makeWrapper,
+  coreutils, curl, bash, debugInfo ? false }:
+
+{ baseName ? "elixir"
+, version
+, minimumOTPVersion
+, sha256 ? null
+, rev ? "v${version}"
+, src ? fetchFromGitHub { inherit rev sha256; owner = "elixir-lang"; repo = "elixir"; }
+}:
+
+let
+  inherit (stdenv.lib) getVersion versionAtLeast;
+
+in
+  assert versionAtLeast (getVersion erlang) minimumOTPVersion;
+
+  stdenv.mkDerivation ({
+    name = "${baseName}-${version}";
+
+    inherit src version;
+
+    buildInputs = [ erlang rebar makeWrapper ];
+
+    LANG = "en_US.UTF-8";
+    LC_TYPE = "en_US.UTF-8";
+
+    setupHook = ./setup-hook.sh;
+
+    inherit debugInfo;
+
+    buildFlags = if debugInfo
+     then "ERL_COMPILER_OPTIONS=debug_info"
+     else "";
+
+    preBuild = ''
+      # The build process uses ./rebar. Link it to the nixpkgs rebar
+      rm -v rebar
+      ln -s ${rebar}/bin/rebar rebar
+
+      substituteInPlace Makefile \
+        --replace "/usr/local" $out
+    '';
+
+    postFixup = ''
+      # Elixir binaries are shell scripts which run erl. Add some stuff
+      # to PATH so the scripts can run without problems.
+
+      for f in $out/bin/*; do
+       b=$(basename $f)
+        if [ "$b" = mix ]; then continue; fi
+        wrapProgram $f \
+          --prefix PATH ":" "${stdenv.lib.makeBinPath [ erlang coreutils curl bash ]}" \
+          --set CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
+      done
+
+      substituteInPlace $out/bin/mix \
+            --replace "/usr/bin/env elixir" "${coreutils}/bin/env elixir"
+    '';
+
+    meta = with stdenv.lib; {
+      homepage = "http://elixir-lang.org/";
+      description = "A functional, meta-programming aware language built on top of the Erlang VM";
+
+      longDescription = ''
+        Elixir is a functional, meta-programming aware language built on
+        top of the Erlang VM. It is a dynamic language with flexible
+        syntax and macro support that leverages Erlang's abilities to
+        build concurrent, distributed and fault-tolerant applications
+        with hot code upgrades.
+      '';
+
+      license = licenses.epl10;
+      platforms = platforms.unix;
+      maintainers = with maintainers; [ the-kenny havvy couchemar ankhers ];
+    };
+  })
diff --git a/pkgs/development/interpreters/erlang/R20.nix b/pkgs/development/interpreters/erlang/R20.nix
new file mode 100644
index 000000000000..8866d9848e7a
--- /dev/null
+++ b/pkgs/development/interpreters/erlang/R20.nix
@@ -0,0 +1,10 @@
+{ mkDerivation, fetchurl }:
+
+mkDerivation rec {
+  version = "20.0";
+  sha256 = "12dbay254ivnakwknjn5h55wndb0a0wqx55p156h8hwjhykj2kn0";
+
+  prePatch = ''
+    substituteInPlace configure.in --replace '`sw_vers -productVersion`' '10.10'
+  '';
+}
diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix
index 04f31dda26a0..5746300fca09 100644
--- a/pkgs/development/interpreters/guile/2.0.nix
+++ b/pkgs/development/interpreters/guile/2.0.nix
@@ -1,5 +1,7 @@
 { fetchurl, stdenv, libtool, readline, gmp, pkgconfig, boehmgc, libunistring
-, libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null }:
+, libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null
+, hostPlatform
+}:
 
 # Do either a coverage analysis build or a standard build.
 (if coverageAnalysis != null
@@ -84,7 +86,7 @@
   setupHook = ./setup-hook-2.0.sh;
 
   crossAttrs.preConfigure =
-    stdenv.lib.optionalString (stdenv.cross.config == "i586-pc-gnu")
+    stdenv.lib.optionalString (hostPlatform.isHurd)
        # On GNU, libgc depends on libpthread, but the cross linker doesn't
        # know where to find libpthread, which leads to erroneous test failures
        # in `configure', where `-pthread' and `-lpthread' aren't explicitly
diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix
index 769c1951a3c7..fe9f94beed17 100644
--- a/pkgs/development/interpreters/guile/default.nix
+++ b/pkgs/development/interpreters/guile/default.nix
@@ -1,5 +1,7 @@
 { fetchurl, stdenv, libtool, readline, gmp, pkgconfig, boehmgc, libunistring
-, libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null }:
+, libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null
+, hostPlatform
+}:
 
 # Do either a coverage analysis build or a standard build.
 (if coverageAnalysis != null
@@ -80,7 +82,7 @@
   setupHook = ./setup-hook-2.2.sh;
 
   crossAttrs.preConfigure =
-    stdenv.lib.optionalString (stdenv.cross.config == "i586-pc-gnu")
+    stdenv.lib.optionalString (hostPlatform.isHurd)
        # On GNU, libgc depends on libpthread, but the cross linker doesn't
        # know where to find libpthread, which leads to erroneous test failures
        # in `configure', where `-pthread' and `-lpthread' aren't explicitly
diff --git a/pkgs/development/interpreters/jruby/default.nix b/pkgs/development/interpreters/jruby/default.nix
index e17dd3638731..0ea1bf19231f 100644
--- a/pkgs/development/interpreters/jruby/default.nix
+++ b/pkgs/development/interpreters/jruby/default.nix
@@ -1,13 +1,16 @@
-{ stdenv, fetchurl, makeWrapper, jre }:
+{ stdenv, callPackage, fetchurl, makeWrapper, jre }:
 
-stdenv.mkDerivation rec {
+let
+# The version number here is whatever is reported by the RUBY_VERSION string
+rubyVersion = callPackage ../ruby/ruby-version.nix {} "2" "3" "3" "";
+jruby = stdenv.mkDerivation rec {
   name = "jruby-${version}";
 
-  version = "9.0.5.0";
+  version = "9.1.12.0";
 
   src = fetchurl {
     url = "https://s3.amazonaws.com/jruby.org/downloads/${version}/jruby-bin-${version}.tar.gz";
-    sha256 = "1wysymqzc7591743f2ycgwpm232y6i050izn72lck44nhnyr5wwy";
+    sha256 = "15x5w4awy8h6xfkbj0p4xnb68xzfrss1rf2prk0kzk5kyjakrcnx";
   };
 
   buildInputs = [ makeWrapper ];
@@ -18,16 +21,42 @@ stdenv.mkDerivation rec {
      rm $out/bin/*.{bat,dll,exe,sh}
      mv $out/COPYING $out/LICENSE* $out/docs
 
-     for i in $out/bin/*; do
+     for i in $out/bin/jruby{,.bash}; do
        wrapProgram $i \
          --set JAVA_HOME ${jre}
      done
+
+     ln -s $out/bin/jruby $out/bin/ruby
+
+     # Bundler tries to create this directory
+     mkdir -pv $out/${passthru.gemPath}
+     mkdir -p $out/nix-support
+     cat > $out/nix-support/setup-hook <<EOF
+       addGemPath() {
+         addToSearchPath GEM_PATH \$1/${passthru.gemPath}
+       }
+
+       envHooks+=(addGemPath)
+     EOF
   '';
 
+  passthru = rec {
+    rubyEngine = "jruby";
+    gemPath = "lib/${rubyEngine}/gems/${rubyVersion.libDir}";
+    libPath = "lib/${rubyEngine}/${rubyVersion.libDir}";
+  };
+
   meta = {
     description = "Ruby interpreter written in Java";
     homepage = http://jruby.org/;
     license = with stdenv.lib.licenses; [ cpl10 gpl2 lgpl21 ];
     platforms = stdenv.lib.platforms.unix;
   };
-}
+};
+in jruby.overrideAttrs (oldAttrs: {
+  passthru = oldAttrs.passthru // {
+    devEnv = callPackage ../ruby/dev.nix {
+      ruby = jruby;
+    };
+  };
+})
diff --git a/pkgs/development/interpreters/lfe/1.2.nix b/pkgs/development/interpreters/lfe/1.2.nix
new file mode 100644
index 000000000000..b81acdaa499e
--- /dev/null
+++ b/pkgs/development/interpreters/lfe/1.2.nix
@@ -0,0 +1,7 @@
+{ mkDerivation }:
+
+mkDerivation {
+  version = "1.2.1";
+  sha256 = "0j5gjlsk92y14kxgvd80q9vwyhmjkphpzadcswyjxikgahwg1avz";
+  maximumOTPVersion = "19";
+}
diff --git a/pkgs/development/interpreters/lfe/default.nix b/pkgs/development/interpreters/lfe/generic-builder.nix
index cafcc4c28ee8..fb034a471e7c 100644
--- a/pkgs/development/interpreters/lfe/default.nix
+++ b/pkgs/development/interpreters/lfe/generic-builder.nix
@@ -1,29 +1,38 @@
-{ stdenv, fetchFromGitHub, erlang, makeWrapper, coreutils, bash, beamPackages }:
+{ stdenv, fetchFromGitHub, erlang, makeWrapper, coreutils, bash, buildRebar3, buildHex }:
+
+{ baseName ? "lfe"
+, version
+, maximumOTPVersion
+, sha256 ? null
+, rev ? version
+, src ? fetchFromGitHub { inherit rev sha256; owner = "rvirding"; repo = "lfe"; }
+}:
 
 let
-  inherit (beamPackages) buildRebar3 buildHex;
-  proper = buildHex rec {
-    name    = "proper";
+  inherit (stdenv.lib) getVersion versionAtLeast splitString head;
+
+  mainVersion = head (splitString "." (getVersion erlang));
+
+  proper = buildHex {
+    name = "proper";
     version = "1.1.1-beta";
+
     sha256  = "0hnkhs761yjynw9382w8wm4j3x0r7lllzavaq2kh9n7qy3zc1rdx";
 
     configurePhase = ''
       ${erlang}/bin/escript write_compile_flags include/compile_flags.hrl
     '';
   };
+
 in
-buildRebar3 rec {
-  name    = "lfe";
-  version = "1.2.1";
-
-  src = fetchFromGitHub {
-    owner  = "rvirding";
-    repo   = name;
-    rev    = version;
-    sha256 = "0j5gjlsk92y14kxgvd80q9vwyhmjkphpzadcswyjxikgahwg1avz";
-  };
+assert versionAtLeast maximumOTPVersion mainVersion;
+
+buildRebar3 {
+  name = baseName;
 
-  buildInputs = [ makeWrapper ];
+  inherit src version;
+
+  buildInputs = [ erlang makeWrapper ];
   beamDeps    = [ proper ];
   patches     = [ ./no-test-deps.patch ];
   doCheck     = true;
@@ -41,6 +50,7 @@ buildRebar3 rec {
     install -m644 _build/default/lib/lfe/ebin/* $ebindir
 
     install -m755 -d $bindir
+
     for bin in bin/lfe{,c,doc,script}; do install -m755 $bin $bindir; done
 
     install -m755 -d $out/bin
@@ -70,7 +80,7 @@ buildRebar3 rec {
     downloadPage = "https://github.com/rvirding/lfe/releases";
 
     license      = licenses.asl20;
-    maintainers  = with maintainers; [ yurrriq ];
+    maintainers  = with maintainers; [ yurrriq ankhers ];
     platforms    = platforms.unix;
   };
 }
diff --git a/pkgs/development/interpreters/lua-5/5.2.nix b/pkgs/development/interpreters/lua-5/5.2.nix
index d14230c158e1..3bd921860841 100644
--- a/pkgs/development/interpreters/lua-5/5.2.nix
+++ b/pkgs/development/interpreters/lua-5/5.2.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, readline, compat ? false }:
+{ stdenv, fetchurl, readline, compat ? false
+, hostPlatform
+}:
 
 let
   dsoPatch = fetchurl {
@@ -55,21 +57,15 @@ stdenv.mkDerivation rec {
   '';
 
   crossAttrs = let
-    isMingw = stdenv.cross.libc == "msvcrt";
-    isDarwin = stdenv.cross.libc == "libSystem";
+    inherit (hostPlatform) isDarwin isMingw;
   in {
     configurePhase = ''
       makeFlagsArray=(
         INSTALL_TOP=$out
         INSTALL_MAN=$out/share/man/man1
-        CC=${stdenv.cross.config}-gcc
-        STRIP=:
-        RANLIB=${stdenv.cross.config}-ranlib
         V=${luaversion}
         R=${version}
         ${if isMingw then "mingw" else stdenv.lib.optionalString isDarwin ''
-        AR="${stdenv.cross.config}-ar rcu"
-        macosx
         ''}
       )
     '' + stdenv.lib.optionalString isMingw ''
diff --git a/pkgs/development/interpreters/lua-5/5.3.nix b/pkgs/development/interpreters/lua-5/5.3.nix
index a22e162b8e18..8290bd05c590 100644
--- a/pkgs/development/interpreters/lua-5/5.3.nix
+++ b/pkgs/development/interpreters/lua-5/5.3.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, readline, compat ? false }:
+{ stdenv, fetchurl, readline, compat ? false
+, hostPlatform
+}:
 
 stdenv.mkDerivation rec {
   name = "lua-${version}";
@@ -54,21 +56,15 @@ stdenv.mkDerivation rec {
   '';
 
   crossAttrs = let
-    isMingw = stdenv.cross.libc == "msvcrt";
-    isDarwin = stdenv.cross.libc == "libSystem";
+    inherit (hostPlatform) isDarwin isMingw;
   in {
     configurePhase = ''
       makeFlagsArray=(
         INSTALL_TOP=$out
         INSTALL_MAN=$out/share/man/man1
-        CC=${stdenv.cross.config}-gcc
-        STRIP=:
-        RANLIB=${stdenv.cross.config}-ranlib
         V=${luaversion}
         R=${version}
         ${if isMingw then "mingw" else stdenv.lib.optionalString isDarwin ''
-        AR="${stdenv.cross.config}-ar rcu"
-        macosx
         ''}
       )
     '' + stdenv.lib.optionalString isMingw ''
diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix
index 1694e3e48509..3f8554a298e4 100644
--- a/pkgs/development/interpreters/luajit/default.nix
+++ b/pkgs/development/interpreters/luajit/default.nix
@@ -1,41 +1,72 @@
-{ stdenv, fetchurl }:
+{ stdenv, lib, fetchurl, hostPlatform }:
+rec {
 
-stdenv.mkDerivation rec {
-  name    = "luajit-${version}";
-  version = "2.1.0-beta3";
-  luaversion = "5.1";
+  luajit = luajit_2_1;
 
-  src = fetchurl {
-    url    = "http://luajit.org/download/LuaJIT-${version}.tar.gz";
-    sha256 = "1hyrhpkwjqsv54hnnx4cl8vk44h9d6c9w0fz1jfjz00w255y7lhs";
+  luajit_2_0 = generic {
+    version = "2.0.5";
+    isStable = true;
+    sha256 = "0yg9q4q6v028bgh85317ykc9whgxgysp76qzaqgq55y6jy11yjw7";
+  } // {
+    # 64-bit ARM isn't supported upstream
+    meta = meta // {
+      platforms = lib.filter (p: p != "aarch64-linux") meta.platforms;
+    };
   };
 
-  enableParallelBuilding = true;
-
-  patchPhase = ''
-    substituteInPlace Makefile \
-      --replace /usr/local $out
-
-    substituteInPlace src/Makefile --replace gcc cc
-  '' + stdenv.lib.optionalString (stdenv.cc.libc != null)
-  ''
-    substituteInPlace Makefile \
-      --replace ldconfig ${stdenv.cc.libc.bin or stdenv.cc.libc}/bin/ldconfig
-  '';
+  luajit_2_1 = generic {
+    version = "2.1.0-beta3";
+    isStable = false;
+    sha256 = "1hyrhpkwjqsv54hnnx4cl8vk44h9d6c9w0fz1jfjz00w255y7lhs";
+  };
 
-  configurePhase = false;
-  buildFlags     = [ "amalg" ]; # Build highly optimized version
-  installPhase   = ''
-    make install INSTALL_INC=$out/include PREFIX=$out
-    ln -s $out/bin/luajit* $out/bin/lua
-    ln -s $out/bin/luajit* $out/bin/luajit
-  '';
 
   meta = with stdenv.lib; {
     description = "High-performance JIT compiler for Lua 5.1";
     homepage    = http://luajit.org;
     license     = licenses.mit;
     platforms   = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers ; [ thoughtpolice smironov ];
+    maintainers = with maintainers ; [ thoughtpolice smironov vcunat ];
   };
+
+  generic =
+    { version, sha256 ? null, isStable
+    , name ? "luajit-${version}"
+    , src ?
+      (fetchurl {
+        url = "http://luajit.org/download/LuaJIT-${version}.tar.gz";
+        inherit sha256;
+      })
+    }:
+
+    stdenv.mkDerivation rec {
+      inherit name version src meta;
+
+      luaversion = "5.1";
+
+      patchPhase = ''
+        substituteInPlace Makefile \
+          --replace /usr/local "$out"
+
+        substituteInPlace src/Makefile --replace gcc cc
+      '' + stdenv.lib.optionalString (stdenv.cc.libc != null)
+      ''
+        substituteInPlace Makefile \
+          --replace ldconfig ${stdenv.cc.libc.bin or stdenv.cc.libc}/bin/ldconfig
+      '';
+
+      configurePhase = false;
+
+      buildFlags = [ "amalg" ]; # Build highly optimized version
+      enableParallelBuilding = true;
+
+      installPhase   = ''
+        make install INSTALL_INC="$out"/include PREFIX="$out"
+        ln -s "$out"/bin/luajit-* "$out"/bin/lua
+      ''
+        + stdenv.lib.optionalString (!isStable)
+          ''
+            ln -s "$out"/bin/luajit-* "$out"/bin/luajit
+          '';
+    };
 }
diff --git a/pkgs/development/interpreters/maude/default.nix b/pkgs/development/interpreters/maude/default.nix
index a977e0801a8f..17e545d95a74 100644
--- a/pkgs/development/interpreters/maude/default.nix
+++ b/pkgs/development/interpreters/maude/default.nix
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
       rewriting logic computation.
     '';
 
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.peti ];
   };
 }
diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix
index e4aa7db3e28d..5654aefe5d29 100644
--- a/pkgs/development/interpreters/perl/default.nix
+++ b/pkgs/development/interpreters/perl/default.nix
@@ -36,7 +36,8 @@ let
         ./no-sys-dirs.patch
       ]
       ++ optional stdenv.isSunOS ./ld-shared.patch
-      ++ optional stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ];
+      ++ optional stdenv.isDarwin ./cpp-precomp.patch
+      ++ optional (stdenv.isDarwin && versionAtLeast version "5.24") ./sw_vers.patch;
 
     postPatch = ''
       pwd="$(type -P pwd)"
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index 709f0fad41e6..675616a5f21e 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -325,17 +325,17 @@ let
 
 in {
   php56 = generic {
-    version = "5.6.30";
-    sha256 = "01krq8r9xglq59x376zlg261yikckq179jmhnlcg3gqxza9w41d1";
+    version = "5.6.31";
+    sha256 = "03xixkvfp64bqp97p8vlj3hp63bpjw7hc16b7fgm7w35rdlp2fcg";
   };
 
   php70 = generic {
-    version = "7.0.19";
-    sha256 = "0nbxgx5fkj1bcach97a3169kwic7jbd4b435n7v25v1aq2pw0fhg";
+    version = "7.0.21";
+    sha256 = "07r3qqyyvf16k4xk5b2070fwilggmph5937drjm8cvyyjb1k789b";
   };
 
   php71 = generic {
-    version = "7.1.5";
-    sha256 = "15w60nrickdi0rlsy5yw6aa1j42m6z2chv90f7fbgn0v9xwa9si8";
+    version = "7.1.7";
+    sha256 = "1y0z5n0kyd15wzmn1lprjgaysbg0z428q9cjbx4dqf3zk296g6q7";
   };
 }
diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix
index c5fa05651bbe..34058c558af0 100644
--- a/pkgs/development/interpreters/python/cpython/2.7/default.nix
+++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ stdenv, hostPlatform, fetchurl
 , bzip2
 , gdbm
 , fetchpatch
@@ -69,7 +69,7 @@ let
 
       ./glibc-2.25-enosys.patch
 
-    ] ++ optionals stdenv.isCygwin [
+    ] ++ optionals hostPlatform.isCygwin [
       ./2.5.2-ctypes-util-find_library.patch
       ./2.5.2-tkinter-x11.patch
       ./2.6.2-ssl-threads.patch
@@ -110,7 +110,7 @@ let
     "--enable-shared"
     "--with-threads"
     "--enable-unicode=ucs4"
-  ] ++ optionals stdenv.isCygwin [
+  ] ++ optionals hostPlatform.isCygwin [
     "--with-system-ffi"
     "--with-system-expat"
     "ac_cv_func_bind_textdomain_codeset=yes"
@@ -118,14 +118,14 @@ let
     "--disable-toolbox-glue"
   ];
 
-  postConfigure = if stdenv.isCygwin then ''
+  postConfigure = if hostPlatform.isCygwin then ''
     sed -i Makefile -e 's,PYTHONPATH="$(srcdir),PYTHONPATH="$(abs_srcdir),'
   '' else null;
 
   buildInputs =
     optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
     [ bzip2 openssl zlib ]
-    ++ optionals stdenv.isCygwin [ expat libffi ]
+    ++ optionals hostPlatform.isCygwin [ expat libffi ]
     ++ [ db gdbm ncurses sqlite readline ]
     ++ optionals x11Support [ tcl tk xlibsWrapper libX11 ]
     ++ optionals stdenv.isDarwin [ CF configd ];
@@ -190,6 +190,8 @@ in stdenv.mkDerivation {
         find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i -
         find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i -
         find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i -
+      '' + optionalString hostPlatform.isCygwin ''
+        cp libpython2.7.dll.a $out/lib
       '';
 
     passthru = let
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index a552b2719bb2..f3d4ae4bb00e 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -59,7 +59,7 @@ let
         srcs = [ rubySrc rubygemsSrc ];
         sourceRoot =
           if useRailsExpress then
-            "ruby-${tag}-src"
+            rubySrc.name
           else
             unpackdir rubySrc;