summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/jython/default.nix29
-rw-r--r--pkgs/development/interpreters/php/5.4.nix279
-rw-r--r--pkgs/development/interpreters/php/5.5.nix276
-rw-r--r--pkgs/development/interpreters/php/5.6.nix278
-rw-r--r--pkgs/development/interpreters/php/generic.nix283
-rw-r--r--pkgs/development/interpreters/pypy/default.nix2
-rw-r--r--pkgs/development/interpreters/ruby/bundix/Gemfile2
-rw-r--r--pkgs/development/interpreters/ruby/bundix/Gemfile.lock4
-rw-r--r--pkgs/development/interpreters/ruby/bundix/gemset.nix4
-rw-r--r--pkgs/development/interpreters/ruby/bundler-env/default-gem-config.nix3
-rw-r--r--pkgs/development/interpreters/ruby/bundler-env/monkey_patches.rb24
-rw-r--r--pkgs/development/interpreters/tcl/8.5.nix11
-rw-r--r--pkgs/development/interpreters/tcl/8.6.nix11
-rw-r--r--pkgs/development/interpreters/tcl/default.nix27
-rw-r--r--pkgs/development/interpreters/tcl/generic.nix32
15 files changed, 407 insertions, 858 deletions
diff --git a/pkgs/development/interpreters/jython/default.nix b/pkgs/development/interpreters/jython/default.nix
new file mode 100644
index 00000000000..f9d6271e5d8
--- /dev/null
+++ b/pkgs/development/interpreters/jython/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, makeWrapper, jre }:
+
+stdenv.mkDerivation rec {
+  name = "jython-${version}";
+
+  version = "2.7-rc3";
+
+  src = fetchurl {
+    url = "http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/${version}/jython-standalone-${version}.jar";
+    sha256 = "89fcaf53f1bda6124f836065c1e318e2e853d5a9a1fbf0e96a387c6d38828c78";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  unpackPhase = ":";
+
+  installPhase = ''
+     mkdir -pv $out/bin
+     cp $src $out/jython.jar
+     makeWrapper ${jre}/bin/java $out/bin/jython --add-flags "-jar $out/jython.jar"
+  '';
+
+  meta = {
+    description = "Python interpreter written in Java";
+    homepage = http://jython.org/;
+    license = stdenv.lib.licenses.psfl;
+    platforms = jre.meta.platforms;
+  };
+}
diff --git a/pkgs/development/interpreters/php/5.4.nix b/pkgs/development/interpreters/php/5.4.nix
index 6796a195286..7133b1e0824 100644
--- a/pkgs/development/interpreters/php/5.4.nix
+++ b/pkgs/development/interpreters/php/5.4.nix
@@ -1,273 +1,6 @@
-{ stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
-, apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext
-, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype
-, libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds }:
-
-let
-  libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
-in
-
-composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
-
-  version = "5.4.39";
-
-  name = "php-${version}";
-
-  enableParallelBuilding = true;
-
-  buildInputs = ["flex" "bison" "pkgconfig"];
-
-  flags = {
-
-    # much left to do here...
-
-    # SAPI modules:
-
-      apxs2 = {
-        configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
-        buildInputs = [apacheHttpd];
-      };
-
-      # Extensions
-
-      ldap = {
-        configureFlags = ["--with-ldap=${openldap}"];
-        buildInputs = [openldap cyrus_sasl openssl];
-      };
-
-      mhash = {
-        configureFlags = ["--with-mhash"];
-        buildInputs = [libmhash];
-      };
-
-      curl = {
-        configureFlags = ["--with-curl=${curl}"];
-        buildInputs = [curl openssl];
-      };
-
-      curlWrappers = {
-        configureFlags = ["--with-curlwrappers"];
-      };
-
-      zlib = {
-        configureFlags = ["--with-zlib=${zlib}"];
-        buildInputs = [zlib];
-      };
-
-      libxml2 = {
-        configureFlags = [
-          "--with-libxml-dir=${libxml2}"
-          #"--with-iconv-dir=${libiconv}"
-          ];
-        buildInputs = [ libxml2 ];
-      };
-
-      pcntl = {
-        configureFlags = [ "--enable-pcntl" ];
-      };
-
-      readline = {
-        configureFlags = ["--with-readline=${readline}"];
-        buildInputs = [ readline ];
-      };
-
-      sqlite = {
-        configureFlags = ["--with-pdo-sqlite=${sqlite}"];
-        buildInputs = [ sqlite ];
-      };
-
-      postgresql = {
-        configureFlags = ["--with-pgsql=${postgresql}"];
-        buildInputs = [ postgresql ];
-      };
-
-      pdo_pgsql = {
-        configureFlags = ["--with-pdo-pgsql=${postgresql}"];
-        buildInputs = [ postgresql ];
-      };
-
-      mysql = {
-        configureFlags = ["--with-mysql=${mysql.lib}"];
-        buildInputs = [ mysql.lib ];
-      };
-
-      mysqli = {
-        configureFlags = ["--with-mysqli=${mysql.lib}/bin/mysql_config"];
-        buildInputs = [ mysql.lib ];
-      };
-
-      mysqli_embedded = {
-        configureFlags = ["--enable-embedded-mysqli"];
-        depends = "mysqli";
-        assertion = fixed.mysqliSupport;
-      };
-
-      pdo_mysql = {
-        configureFlags = ["--with-pdo-mysql=${mysql.lib}"];
-        buildInputs = [ mysql.lib ];
-      };
-
-      bcmath = {
-        configureFlags = ["--enable-bcmath"];
-      };
-
-      gd = {
-        # FIXME: Our own gd package doesn't work, see https://bugs.php.net/bug.php?id=60108.
-        configureFlags = [
-          "--with-gd"
-          "--with-freetype-dir=${freetype}"
-          "--with-png-dir=${libpng}"
-          "--with-jpeg-dir=${libjpeg}"
-        ];
-        buildInputs = [ libpng libjpeg freetype ];
-      };
-
-      soap = {
-        configureFlags = ["--enable-soap"];
-      };
-
-      sockets = {
-        configureFlags = ["--enable-sockets"];
-      };
-
-      openssl = {
-        configureFlags = ["--with-openssl=${openssl}"];
-        buildInputs = ["openssl"];
-      };
-
-      mbstring = {
-        configureFlags = ["--enable-mbstring"];
-      };
-
-      gettext = {
-        configureFlags = ["--with-gettext=${gettext}"];
-        buildInputs = [gettext];
-      };
-
-      intl = {
-        configureFlags = ["--enable-intl"];
-        buildInputs = [icu];
-      };
-
-      exif = {
-        configureFlags = ["--enable-exif"];
-      };
-
-      xsl = {
-        configureFlags = ["--with-xsl=${libxslt}"];
-        buildInputs = [libxslt];
-      };
-
-      mcrypt = {
-        configureFlags = ["--with-mcrypt=${libmcrypt}"];
-        buildInputs = [libmcryptOverride];
-      };
-
-      bz2 = {
-        configureFlags = ["--with-bz2=${bzip2}"];
-        buildInputs = [bzip2];
-      };
-
-      zip = {
-        configureFlags = ["--enable-zip"];
-      };
-
-      ftp = {
-        configureFlags = ["--enable-ftp"];
-      };
-
-      fpm = {
-        configureFlags = ["--enable-fpm"];
-      };
-
-      mssql = stdenv.lib.optionalAttrs (!stdenv.isDarwin) {
-        configureFlags = ["--with-mssql=${freetds}"];
-        buildInputs = [freetds];
-      };
-
-      zts = {
-        configureFlags = ["--enable-maintainer-zts"];
-      };
-
-      calendar = {
-        configureFlags = ["--enable-calendar"];
-      };
-
-      /*
-         php is build within this derivation in order to add the xdebug lines to the php.ini.
-         So both Apache and command line php both use xdebug without having to configure anything.
-         Xdebug could be put in its own derivation.
-      */
-    };
-
-  cfg = {
-    ldapSupport = config.php.ldap or true;
-    mhashSupport = config.php.mhash or true;
-    mysqlSupport = config.php.mysql or true;
-    mysqliSupport = config.php.mysqli or true;
-    pdo_mysqlSupport = config.php.pdo_mysql or true;
-    libxml2Support = config.php.libxml2 or true;
-    apxs2Support = config.php.apxs2 or true;
-    bcmathSupport = config.php.bcmath or true;
-    socketsSupport = config.php.sockets or true;
-    curlSupport = config.php.curl or true;
-    curlWrappersSupport = config.php.curlWrappers or false;
-    gettextSupport = config.php.gettext or true;
-    pcntlSupport = config.php.pcntl or true;
-    postgresqlSupport = config.php.postgresql or true;
-    pdo_pgsqlSupport = config.php.pdo_pgsql or true;
-    readlineSupport = config.php.readline or true;
-    sqliteSupport = config.php.sqlite or true;
-    soapSupport = config.php.soap or true;
-    zlibSupport = config.php.zlib or true;
-    opensslSupport = config.php.openssl or true;
-    mbstringSupport = config.php.mbstring or true;
-    gdSupport = config.php.gd or true;
-    intlSupport = config.php.intl or true;
-    exifSupport = config.php.exif or true;
-    xslSupport = config.php.xsl or false;
-    mcryptSupport = config.php.mcrypt or false;
-    bz2Support = config.php.bz2 or false;
-    zipSupport = config.php.zip or true;
-    ftpSupport = config.php.ftp or true;
-    fpmSupport = config.php.fpm or true;
-    mssqlSupport = config.php.mssql or (!stdenv.isDarwin);
-    ztsSupport = config.php.zts or false;
-    calendarSupport = config.php.calendar or false;
-  };
-
-  configurePhase = ''
-    # Don't record the configure flags since this causes unnecessary
-    # runtime dependencies.
-    for i in main/build-defs.h.in scripts/php-config.in; do
-      substituteInPlace $i \
-        --replace '@CONFIGURE_COMMAND@' '(omitted)' \
-        --replace '@CONFIGURE_OPTIONS@' "" \
-        --replace '@PHP_LDFLAGS@' ""
-    done
-
-    iniFile=$out/etc/php-recommended.ini
-    [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
-    ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
-  '';
-
-  installPhase = ''
-    unset installPhase; installPhase;
-    cp php.ini-production $iniFile
-  '';
-
-  src = fetchurl {
-    url = "http://www.php.net/distributions/php-${version}.tar.bz2";
-    sha256 = "0znpd6pgri5vah4j4wwamhqc60awila43bhh699p973hir9pdsvw";
-  };
-
-  meta = with stdenv.lib; {
-    description = "An HTML-embedded scripting language";
-    homepage = http://www.php.net/;
-    license = stdenv.lib.licenses.php301;
-    maintainers = with maintainers; [ globin ];
-  };
-
-  patches = [ ./fix-paths.patch ];
-
-})
+{ callPackage, apacheHttpd }:
+callPackage ./generic.nix {
+  phpVersion = "5.4.40";
+  sha = "06m5b3hw5kgwvnarhiylymadj504xalpczagr662vjrwmklgz628";
+  apacheHttpd = apacheHttpd;
+}
diff --git a/pkgs/development/interpreters/php/5.5.nix b/pkgs/development/interpreters/php/5.5.nix
index 87aff4ff1a2..fdc1ab79c76 100644
--- a/pkgs/development/interpreters/php/5.5.nix
+++ b/pkgs/development/interpreters/php/5.5.nix
@@ -1,270 +1,6 @@
-{ stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
-, apacheHttpd, mysql, libxml2, readline, zlib, curl, postgresql, gettext
-, openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype
-, libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds
-, uwimap, pam, gmp }:
-
-let
-  libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
-in
-
-composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
-
-  version = "5.5.21";
-
-  name = "php-${version}";
-
-  enableParallelBuilding = true;
-
-  buildInputs = ["flex" "bison" "pkgconfig"];
-
-  flags = {
-
-    # much left to do here...
-
-    # SAPI modules:
-
-      apxs2 = {
-        configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
-        buildInputs = [apacheHttpd];
-      };
-
-      # Extensions
-      imap = {
-        configureFlags = [
-          "--with-imap=${uwimap}"
-          "--with-imap-ssl"
-          ];
-        buildInputs = [ uwimap openssl pam ];
-      };
-
-      ldap = {
-        configureFlags = ["--with-ldap=${openldap}"];
-        buildInputs = [openldap cyrus_sasl openssl];
-      };
-
-      mhash = {
-        configureFlags = ["--with-mhash"];
-        buildInputs = [libmhash];
-      };
-
-      curl = {
-        configureFlags = ["--with-curl=${curl}"];
-        buildInputs = [curl openssl];
-      };
-
-      zlib = {
-        configureFlags = ["--with-zlib=${zlib}"];
-        buildInputs = [zlib];
-      };
-
-      libxml2 = {
-        configureFlags = [
-          "--with-libxml-dir=${libxml2}"
-          ];
-        buildInputs = [ libxml2 ];
-      };
-
-      pcntl = {
-        configureFlags = [ "--enable-pcntl" ];
-      };
-
-      readline = {
-        configureFlags = ["--with-readline=${readline}"];
-        buildInputs = [ readline ];
-      };
-
-      sqlite = {
-        configureFlags = ["--with-pdo-sqlite=${sqlite}"];
-        buildInputs = [ sqlite ];
-      };
-
-      postgresql = {
-        configureFlags = ["--with-pgsql=${postgresql}"];
-        buildInputs = [ postgresql ];
-      };
-
-      pdo_pgsql = {
-        configureFlags = ["--with-pdo-pgsql=${postgresql}"];
-        buildInputs = [ postgresql ];
-      };
-
-      mysql = {
-        configureFlags = ["--with-mysql=${mysql.lib}"];
-        buildInputs = [ mysql.lib ];
-      };
-
-      mysqli = {
-        configureFlags = ["--with-mysqli=${mysql.lib}/bin/mysql_config"];
-        buildInputs = [ mysql.lib ];
-      };
-
-      mysqli_embedded = {
-        configureFlags = ["--enable-embedded-mysqli"];
-        depends = "mysqli";
-        assertion = fixed.mysqliSupport;
-      };
-
-      pdo_mysql = {
-        configureFlags = ["--with-pdo-mysql=${mysql.lib}"];
-        buildInputs = [ mysql.lib ];
-      };
-
-      bcmath = {
-        configureFlags = ["--enable-bcmath"];
-      };
-
-      gd = {
-        # FIXME: Our own gd package doesn't work, see https://bugs.php.net/bug.php?id=60108.
-        configureFlags = [
-          "--with-gd"
-          "--with-freetype-dir=${freetype}"
-          "--with-png-dir=${libpng}"
-          "--with-jpeg-dir=${libjpeg}"
-        ];
-        buildInputs = [ libpng libjpeg freetype ];
-      };
-
-      gmp = {
-        configureFlags = ["--with-gmp=${gmp}"];
-        buildInputs = [ gmp ];
-      };
-
-      soap = {
-        configureFlags = ["--enable-soap"];
-      };
-
-      sockets = {
-        configureFlags = ["--enable-sockets"];
-      };
-
-      openssl = {
-        configureFlags = ["--with-openssl=${openssl}"];
-        buildInputs = ["openssl"];
-      };
-
-      mbstring = {
-        configureFlags = ["--enable-mbstring"];
-      };
-
-      gettext = {
-        configureFlags = ["--with-gettext=${gettext}"];
-        buildInputs = [gettext];
-      };
-
-      intl = {
-        configureFlags = ["--enable-intl"];
-        buildInputs = [icu];
-      };
-
-      exif = {
-        configureFlags = ["--enable-exif"];
-      };
-
-      xsl = {
-        configureFlags = ["--with-xsl=${libxslt}"];
-        buildInputs = [libxslt];
-      };
-
-      mcrypt = {
-        configureFlags = ["--with-mcrypt=${libmcryptOverride}"];
-        buildInputs = [libmcryptOverride];
-      };
-
-      bz2 = {
-        configureFlags = ["--with-bz2=${bzip2}"];
-        buildInputs = [bzip2];
-      };
-
-      zip = {
-        configureFlags = ["--enable-zip"];
-      };
-
-      ftp = {
-        configureFlags = ["--enable-ftp"];
-      };
-
-      fpm = {
-        configureFlags = ["--enable-fpm"];
-      };
-
-      mssql = stdenv.lib.optionalAttrs (!stdenv.isDarwin) {
-        configureFlags = ["--with-mssql=${freetds}"];
-        buildInputs = [freetds];
-      };
-
-      calendar = {
-        configureFlags = ["--enable-calendar"];
-      };
-    };
-
-  cfg = {
-    imapSupport = config.php.imap or true;
-    ldapSupport = config.php.ldap or true;
-    mhashSupport = config.php.mhash or true;
-    mysqlSupport = config.php.mysql or true;
-    mysqliSupport = config.php.mysqli or true;
-    pdo_mysqlSupport = config.php.pdo_mysql or true;
-    libxml2Support = config.php.libxml2 or true;
-    apxs2Support = config.php.apxs2 or true;
-    bcmathSupport = config.php.bcmath or true;
-    socketsSupport = config.php.sockets or true;
-    curlSupport = config.php.curl or true;
-    gettextSupport = config.php.gettext or true;
-    pcntlSupport = config.php.pcntl or true;
-    postgresqlSupport = config.php.postgresql or true;
-    readlineSupport = config.php.readline or true;
-    sqliteSupport = config.php.sqlite or true;
-    soapSupport = config.php.soap or true;
-    zlibSupport = config.php.zlib or true;
-    opensslSupport = config.php.openssl or true;
-    mbstringSupport = config.php.mbstring or true;
-    gdSupport = config.php.gd or true;
-    intlSupport = config.php.intl or true;
-    exifSupport = config.php.exif or true;
-    xslSupport = config.php.xsl or false;
-    mcryptSupport = config.php.mcrypt or true;
-    bz2Support = config.php.bz2 or false;
-    zipSupport = config.php.zip or true;
-    ftpSupport = config.php.ftp or true;
-    fpmSupport = config.php.fpm or true;
-    gmpSupport = config.php.gmp or true;
-    mssqlSupport = config.php.mssql or (!stdenv.isDarwin);
-    calendarSupport = config.php.calendar or true;
-  };
-
-  configurePhase = ''
-    # Don't record the configure flags since this causes unnecessary
-    # runtime dependencies.
-    for i in main/build-defs.h.in scripts/php-config.in; do
-      substituteInPlace $i \
-        --replace '@CONFIGURE_COMMAND@' '(omitted)' \
-        --replace '@CONFIGURE_OPTIONS@' "" \
-        --replace '@PHP_LDFLAGS@' ""
-    done
-
-    iniFile=$out/etc/php-recommended.ini
-    [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
-    ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
-  '';
-
-  installPhase = ''
-    unset installPhase; installPhase;
-    cp php.ini-production $iniFile
-  '';
-
-  src = fetchurl {
-    url = "http://www.php.net/distributions/php-${version}.tar.bz2";
-    sha256 = "1zl3valcak5hb4fmivpfa66arwpvi19js1d5cxq5vjn4fncl5sb2";
-  };
-
-  meta = with stdenv.lib; {
-    description = "An HTML-embedded scripting language";
-    homepage = http://www.php.net/;
-    license = stdenv.lib.licenses.php301;
-    maintainers = with maintainers; [ globin ];
-  };
-
-  patches = [ ./fix-paths.patch ];
-
-})
+{ callPackage, apacheHttpd  }:
+callPackage ./generic.nix {
+  phpVersion = "5.5.21";
+  sha = "1zl3valcak5hb4fmivpfa66arwpvi19js1d5cxq5vjn4fncl5sb2";
+  apacheHttpd = apacheHttpd;
+}
diff --git a/pkgs/development/interpreters/php/5.6.nix b/pkgs/development/interpreters/php/5.6.nix
index 1fa98708920..5f69e46189f 100644
--- a/pkgs/development/interpreters/php/5.6.nix
+++ b/pkgs/development/interpreters/php/5.6.nix
@@ -1,272 +1,6 @@
-{ stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
-, apacheHttpd, mysql, libxml2, readline, zlib, curl, postgresql, gettext
-, openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype
-, libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds
-, uwimap, pam, gmp }:
-
-let
-  libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
-in
-
-composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
-
-  version = "5.6.5";
-
-  name = "php-${version}";
-
-  enableParallelBuilding = true;
-
-  buildInputs = ["flex" "bison" "pkgconfig"];
-
-  flags = {
-
-    # much left to do here...
-
-    # SAPI modules:
-
-      apxs2 = {
-        configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
-        buildInputs = [apacheHttpd];
-      };
-
-      # Extensions
-      imap = {
-        configureFlags = [
-          "--with-imap=${uwimap}"
-          "--with-imap-ssl"
-          ];
-        buildInputs = [ uwimap openssl pam ];
-      };
-
-      ldap = {
-        configureFlags = ["--with-ldap=${openldap}"];
-        buildInputs = [openldap cyrus_sasl openssl];
-      };
-
-      mhash = {
-        configureFlags = ["--with-mhash"];
-        buildInputs = [libmhash];
-      };
-
-      curl = {
-        configureFlags = ["--with-curl=${curl}"];
-        buildInputs = [curl openssl];
-      };
-
-      zlib = {
-        configureFlags = ["--with-zlib=${zlib}"];
-        buildInputs = [zlib];
-      };
-
-      libxml2 = {
-        configureFlags = [
-          "--with-libxml-dir=${libxml2}"
-          ];
-        buildInputs = [ libxml2 ];
-      };
-
-      pcntl = {
-        configureFlags = [ "--enable-pcntl" ];
-      };
-
-      readline = {
-        configureFlags = ["--with-readline=${readline}"];
-        buildInputs = [ readline ];
-      };
-
-      sqlite = {
-        configureFlags = ["--with-pdo-sqlite=${sqlite}"];
-        buildInputs = [ sqlite ];
-      };
-
-      postgresql = {
-        configureFlags = ["--with-pgsql=${postgresql}"];
-        buildInputs = [ postgresql ];
-      };
-
-      pdo_pgsql = {
-        configureFlags = ["--with-pdo-pgsql=${postgresql}"];
-        buildInputs = [ postgresql ];
-      };
-
-      mysql = {
-        configureFlags = ["--with-mysql=${mysql.lib}"];
-        buildInputs = [ mysql.lib ];
-      };
-
-      mysqli = {
-        configureFlags = ["--with-mysqli=${mysql.lib}/bin/mysql_config"];
-        buildInputs = [ mysql.lib ];
-      };
-
-      mysqli_embedded = {
-        configureFlags = ["--enable-embedded-mysqli"];
-        depends = "mysqli";
-        assertion = fixed.mysqliSupport;
-      };
-
-      pdo_mysql = {
-        configureFlags = ["--with-pdo-mysql=${mysql.lib}"];
-        buildInputs = [ mysql.lib ];
-      };
-
-      bcmath = {
-        configureFlags = ["--enable-bcmath"];
-      };
-
-      gd = {
-        # FIXME: Our own gd package doesn't work, see https://bugs.php.net/bug.php?id=60108.
-        configureFlags = [
-          "--with-gd"
-          "--with-freetype-dir=${freetype}"
-          "--with-png-dir=${libpng}"
-          "--with-jpeg-dir=${libjpeg}"
-        ];
-        buildInputs = [ libpng libjpeg freetype ];
-      };
-
-      gmp = {
-        configureFlags = ["--with-gmp=${gmp}"];
-        buildInputs = [ gmp ];
-      };
-
-      soap = {
-        configureFlags = ["--enable-soap"];
-      };
-
-      sockets = {
-        configureFlags = ["--enable-sockets"];
-      };
-
-      openssl = {
-        configureFlags = ["--with-openssl=${openssl}"];
-        buildInputs = ["openssl"];
-      };
-
-      mbstring = {
-        configureFlags = ["--enable-mbstring"];
-      };
-
-      gettext = {
-        configureFlags = ["--with-gettext=${gettext}"];
-        buildInputs = [gettext];
-      };
-
-      intl = {
-        configureFlags = ["--enable-intl"];
-        buildInputs = [icu];
-      };
-
-      exif = {
-        configureFlags = ["--enable-exif"];
-      };
-
-      xsl = {
-        configureFlags = ["--with-xsl=${libxslt}"];
-        buildInputs = [libxslt];
-      };
-
-      mcrypt = {
-        configureFlags = ["--with-mcrypt=${libmcryptOverride}"];
-        buildInputs = [libmcryptOverride];
-      };
-
-      bz2 = {
-        configureFlags = ["--with-bz2=${bzip2}"];
-        buildInputs = [bzip2];
-      };
-
-      zip = {
-        configureFlags = ["--enable-zip"];
-      };
-
-      ftp = {
-        configureFlags = ["--enable-ftp"];
-      };
-
-      fpm = {
-        configureFlags = ["--enable-fpm"];
-      };
-
-      mssql = stdenv.lib.optionalAttrs (!stdenv.isDarwin) {
-        configureFlags = ["--with-mssql=${freetds}"];
-        buildInputs = [freetds];
-      };
-
-
-      calendar = {
-        configureFlags = ["--enable-calendar"];
-      };
-
-    };
-
-  cfg = {
-    imapSupport = config.php.imap or true;
-    ldapSupport = config.php.ldap or true;
-    mhashSupport = config.php.mhash or true;
-    mysqlSupport = config.php.mysql or true;
-    mysqliSupport = config.php.mysqli or true;
-    pdo_mysqlSupport = config.php.pdo_mysql or true;
-    libxml2Support = config.php.libxml2 or true;
-    apxs2Support = config.php.apxs2 or true;
-    bcmathSupport = config.php.bcmath or true;
-    socketsSupport = config.php.sockets or true;
-    curlSupport = config.php.curl or true;
-    gettextSupport = config.php.gettext or true;
-    pcntlSupport = config.php.pcntl or true;
-    postgresqlSupport = config.php.postgresql or true;
-    readlineSupport = config.php.readline or true;
-    sqliteSupport = config.php.sqlite or true;
-    soapSupport = config.php.soap or true;
-    zlibSupport = config.php.zlib or true;
-    opensslSupport = config.php.openssl or true;
-    mbstringSupport = config.php.mbstring or true;
-    gdSupport = config.php.gd or true;
-    intlSupport = config.php.intl or true;
-    exifSupport = config.php.exif or true;
-    xslSupport = config.php.xsl or false;
-    mcryptSupport = config.php.mcrypt or true;
-    bz2Support = config.php.bz2 or false;
-    zipSupport = config.php.zip or true;
-    ftpSupport = config.php.ftp or true;
-    fpmSupport = config.php.fpm or true;
-    gmpSupport = config.php.gmp or true;
-    mssqlSupport = config.php.mssql or (!stdenv.isDarwin);
-    calendarSupport = config.php.calendar or true;
-  };
-
-  configurePhase = ''
-    # Don't record the configure flags since this causes unnecessary
-    # runtime dependencies.
-    for i in main/build-defs.h.in scripts/php-config.in; do
-      substituteInPlace $i \
-        --replace '@CONFIGURE_COMMAND@' '(omitted)' \
-        --replace '@CONFIGURE_OPTIONS@' "" \
-        --replace '@PHP_LDFLAGS@' ""
-    done
-
-    iniFile=$out/etc/php-recommended.ini
-    [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
-    ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
-  '';
-
-  installPhase = ''
-    unset installPhase; installPhase;
-    cp php.ini-production $iniFile
-  '';
-
-  src = fetchurl {
-    url = "http://www.php.net/distributions/php-${version}.tar.bz2";
-    sha256 = "0vfhvwn84lrz9psf10sjnwljbna1r7yqxq3lmsh5qajifl3lraxd";
-  };
-
-  meta = with stdenv.lib; {
-    description = "An HTML-embedded scripting language";
-    homepage = http://www.php.net/;
-    license = stdenv.lib.licenses.php301;
-    maintainers = with maintainers; [ globin ];
-  };
-
-  patches = [ ./fix-paths.patch ];
-
-})
+{ callPackage, apacheHttpd  }:
+callPackage ./generic.nix {
+  phpVersion = "5.6.6";
+  sha = "0k5vml94p5809bk2d5a8lhzf3h7f1xgs75b9qy6ikj70cndmqqh9";
+  apacheHttpd = apacheHttpd;
+}
diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix
new file mode 100644
index 00000000000..33b5b0f9024
--- /dev/null
+++ b/pkgs/development/interpreters/php/generic.nix
@@ -0,0 +1,283 @@
+{ stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
+, mysql, libxml2, readline, zlib, curl, postgresql, gettext
+, openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype
+, libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds
+, uwimap, pam, gmp
+
+, phpVersion, apacheHttpd, sha }:
+
+let
+  libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
+in
+
+composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
+
+  version = "${phpVersion}";
+
+  name = "php-${version}";
+
+  enableParallelBuilding = true;
+
+  buildInputs = ["flex" "bison" "pkgconfig"];
+
+  flags = {
+
+    # much left to do here...
+
+    # SAPI modules:
+
+    apxs2 = {
+      configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
+      buildInputs = [apacheHttpd];
+    };
+
+    # Extensions
+    imap = {
+      configureFlags = [
+        "--with-imap=${uwimap}"
+        "--with-imap-ssl"
+        ];
+      buildInputs = [ uwimap openssl pam ];
+    };
+
+    ldap = {
+      configureFlags = ["--with-ldap=${openldap}"];
+      buildInputs = [openldap cyrus_sasl openssl];
+    };
+
+    mhash = {
+      configureFlags = ["--with-mhash"];
+      buildInputs = [libmhash];
+    };
+
+    curl = {
+      configureFlags = ["--with-curl=${curl}"];
+      buildInputs = [curl openssl];
+    };
+
+    curlWrappers = {
+      configureFlags = ["--with-curlwrappers"];
+    };
+
+    zlib = {
+      configureFlags = ["--with-zlib=${zlib}"];
+      buildInputs = [zlib];
+    };
+
+    libxml2 = {
+      configureFlags = [
+        "--with-libxml-dir=${libxml2}"
+        ];
+      buildInputs = [ libxml2 ];
+    };
+
+    pcntl = {
+      configureFlags = [ "--enable-pcntl" ];
+    };
+
+    readline = {
+      configureFlags = ["--with-readline=${readline}"];
+      buildInputs = [ readline ];
+    };
+
+    sqlite = {
+      configureFlags = ["--with-pdo-sqlite=${sqlite}"];
+      buildInputs = [ sqlite ];
+    };
+
+    postgresql = {
+      configureFlags = ["--with-pgsql=${postgresql}"];
+      buildInputs = [ postgresql ];
+    };
+
+    pdo_pgsql = {
+      configureFlags = ["--with-pdo-pgsql=${postgresql}"];
+      buildInputs = [ postgresql ];
+    };
+
+    mysql = {
+      configureFlags = ["--with-mysql=${mysql.lib}"];
+      buildInputs = [ mysql.lib ];
+    };
+
+    mysqli = {
+      configureFlags = ["--with-mysqli=${mysql.lib}/bin/mysql_config"];
+      buildInputs = [ mysql.lib ];
+    };
+
+    mysqli_embedded = {
+      configureFlags = ["--enable-embedded-mysqli"];
+      depends = "mysqli";
+      assertion = fixed.mysqliSupport;
+    };
+
+    pdo_mysql = {
+      configureFlags = ["--with-pdo-mysql=${mysql.lib}"];
+      buildInputs = [ mysql.lib ];
+    };
+
+    bcmath = {
+      configureFlags = ["--enable-bcmath"];
+    };
+
+    gd = {
+      # FIXME: Our own gd package doesn't work, see https://bugs.php.net/bug.php?id=60108.
+      configureFlags = [
+        "--with-gd"
+        "--with-freetype-dir=${freetype}"
+        "--with-png-dir=${libpng}"
+        "--with-jpeg-dir=${libjpeg}"
+      ];
+      buildInputs = [ libpng libjpeg freetype ];
+    };
+
+    gmp = {
+      configureFlags = ["--with-gmp=${gmp}"];
+      buildInputs = [ gmp ];
+    };
+
+    soap = {
+      configureFlags = ["--enable-soap"];
+    };
+
+    sockets = {
+      configureFlags = ["--enable-sockets"];
+    };
+
+    openssl = {
+      configureFlags = ["--with-openssl=${openssl}"];
+      buildInputs = ["openssl"];
+    };
+
+    mbstring = {
+      configureFlags = ["--enable-mbstring"];
+    };
+
+    gettext = {
+      configureFlags = ["--with-gettext=${gettext}"];
+      buildInputs = [gettext];
+    };
+
+    intl = {
+      configureFlags = ["--enable-intl"];
+      buildInputs = [icu];
+    };
+
+    exif = {
+      configureFlags = ["--enable-exif"];
+    };
+
+    xsl = {
+      configureFlags = ["--with-xsl=${libxslt}"];
+      buildInputs = [libxslt];
+    };
+
+    mcrypt = {
+      configureFlags = ["--with-mcrypt=${libmcryptOverride}"];
+      buildInputs = [libmcryptOverride];
+    };
+
+    bz2 = {
+      configureFlags = ["--with-bz2=${bzip2}"];
+      buildInputs = [bzip2];
+    };
+
+    zip = {
+      configureFlags = ["--enable-zip"];
+    };
+
+    ftp = {
+      configureFlags = ["--enable-ftp"];
+    };
+
+    fpm = {
+      configureFlags = ["--enable-fpm"];
+    };
+
+    mssql = stdenv.lib.optionalAttrs (!stdenv.isDarwin) {
+      configureFlags = ["--with-mssql=${freetds}"];
+      buildInputs = [freetds];
+    };
+
+    zts = {
+      configureFlags = ["--enable-maintainer-zts"];
+    };
+
+    calendar = {
+      configureFlags = ["--enable-calendar"];
+    };
+  };
+
+  cfg = {
+    imapSupport = config.php.imap or true;
+    ldapSupport = config.php.ldap or true;
+    mhashSupport = config.php.mhash or true;
+    mysqlSupport = config.php.mysql or true;
+    mysqliSupport = config.php.mysqli or true;
+    pdo_mysqlSupport = config.php.pdo_mysql or true;
+    libxml2Support = config.php.libxml2 or true;
+    apxs2Support = config.php.apxs2 or true;
+    bcmathSupport = config.php.bcmath or true;
+    socketsSupport = config.php.sockets or true;
+    curlSupport = config.php.curl or true;
+    curlWrappersSupport = config.php.curlWrappers or true;
+    gettextSupport = config.php.gettext or true;
+    pcntlSupport = config.php.pcntl or true;
+    postgresqlSupport = config.php.postgresql or true;
+    pdo_pgsqlSupport = config.php.pdo_pgsql or true;
+    readlineSupport = config.php.readline or true;
+    sqliteSupport = config.php.sqlite or true;
+    soapSupport = config.php.soap or true;
+    zlibSupport = config.php.zlib or true;
+    opensslSupport = config.php.openssl or true;
+    mbstringSupport = config.php.mbstring or true;
+    gdSupport = config.php.gd or true;
+    intlSupport = config.php.intl or true;
+    exifSupport = config.php.exif or true;
+    xslSupport = config.php.xsl or false;
+    mcryptSupport = config.php.mcrypt or true;
+    bz2Support = config.php.bz2 or false;
+    zipSupport = config.php.zip or true;
+    ftpSupport = config.php.ftp or true;
+    fpmSupport = config.php.fpm or true;
+    gmpSupport = config.php.gmp or true;
+    mssqlSupport = config.php.mssql or (!stdenv.isDarwin);
+    ztsSupport = config.php.zts or false;
+    calendarSupport = config.php.calendar or true;
+  };
+
+  configurePhase = ''
+    # Don't record the configure flags since this causes unnecessary
+    # runtime dependencies.
+    for i in main/build-defs.h.in scripts/php-config.in; do
+      substituteInPlace $i \
+        --replace '@CONFIGURE_COMMAND@' '(omitted)' \
+        --replace '@CONFIGURE_OPTIONS@' "" \
+        --replace '@PHP_LDFLAGS@' ""
+    done
+
+    iniFile=$out/etc/php-recommended.ini
+    [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
+    ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
+  '';
+
+  installPhase = ''
+    unset installPhase; installPhase;
+    cp php.ini-production $iniFile
+  '';
+
+  src = fetchurl {
+    url = "http://www.php.net/distributions/php-${version}.tar.bz2";
+    sha256 = sha;
+  };
+
+  meta = with stdenv.lib; {
+    description = "An HTML-embedded scripting language";
+    homepage = http://www.php.net/;
+    license = stdenv.lib.licenses.php301;
+    maintainers = with maintainers; [ globin ];
+  };
+
+  patches = [ ./fix-paths.patch ];
+
+})
diff --git a/pkgs/development/interpreters/pypy/default.nix b/pkgs/development/interpreters/pypy/default.nix
index f67c48c62d8..10d03103b1b 100644
--- a/pkgs/development/interpreters/pypy/default.nix
+++ b/pkgs/development/interpreters/pypy/default.nix
@@ -51,7 +51,7 @@ let
       # tkinter hints
       substituteInPlace lib_pypy/_tkinter/tklib.py \
         --replace "'/usr/include/tcl'" "'${tk}/include', '${tcl}/include'" \
-        --replace "linklibs=['tcl', 'tk']" "linklibs=['tcl8.5', 'tk8.5']" \
+        --replace "linklibs=['tcl', 'tk']" "linklibs=['${tcl.libPrefix}', '${tk.libPrefix}']" \
         --replace "libdirs = []" "libdirs = ['${tk}/lib', '${tcl}/lib']"
 
       sed -i "s@libraries=\['sqlite3'\]\$@libraries=['sqlite3'], include_dirs=['${sqlite}/include'], library_dirs=['${sqlite}/lib']@" lib_pypy/_sqlite3.py
diff --git a/pkgs/development/interpreters/ruby/bundix/Gemfile b/pkgs/development/interpreters/ruby/bundix/Gemfile
index 7d2f78133c5..4899cafc373 100644
--- a/pkgs/development/interpreters/ruby/bundix/Gemfile
+++ b/pkgs/development/interpreters/ruby/bundix/Gemfile
@@ -1,4 +1,4 @@
 source "http://rubygems.org"
 gem "bundix",
   :git => "https://github.com/cstrahan/bundix.git",
-  :ref => "v1.0.2"
+  :ref => "v1.0.3"
diff --git a/pkgs/development/interpreters/ruby/bundix/Gemfile.lock b/pkgs/development/interpreters/ruby/bundix/Gemfile.lock
index 038fa1a7a50..f241a3bafd4 100644
--- a/pkgs/development/interpreters/ruby/bundix/Gemfile.lock
+++ b/pkgs/development/interpreters/ruby/bundix/Gemfile.lock
@@ -1,7 +1,7 @@
 GIT
   remote: https://github.com/cstrahan/bundix.git
-  revision: e098b8c04087079c897aaf9542990e9fdd503bcf
-  ref: v1.0.2
+  revision: c879cf901ff8084b4c97aaacfb5ecbdb0f95cc03
+  ref: v1.0.3
   specs:
     bundix (1.0.2)
       thor (~> 0.19.1)
diff --git a/pkgs/development/interpreters/ruby/bundix/gemset.nix b/pkgs/development/interpreters/ruby/bundix/gemset.nix
index adde97a49f2..f8f6546671d 100644
--- a/pkgs/development/interpreters/ruby/bundix/gemset.nix
+++ b/pkgs/development/interpreters/ruby/bundix/gemset.nix
@@ -4,8 +4,8 @@
     source = {
       type = "git";
       url = "https://github.com/cstrahan/bundix.git";
-      rev = "e098b8c04087079c897aaf9542990e9fdd503bcf";
-      sha256 = "0www8srjqlxy1pzn2b6himy5y768dni54m7rv67gj8yvx48vd803";
+      rev = "c879cf901ff8084b4c97aaacfb5ecbdb0f95cc03";
+      sha256 = "05kmdnq4qa5h8l3asv05cjpnyplnqqx6hrqybj2cjlzmdxnkkgyj";
       fetchSubmodules = false;
     };
     dependencies = [
diff --git a/pkgs/development/interpreters/ruby/bundler-env/default-gem-config.nix b/pkgs/development/interpreters/ruby/bundler-env/default-gem-config.nix
index cadda288764..38b7ce530ae 100644
--- a/pkgs/development/interpreters/ruby/bundler-env/default-gem-config.nix
+++ b/pkgs/development/interpreters/ruby/bundler-env/default-gem-config.nix
@@ -25,13 +25,12 @@
 
 let
   v8 = v8_3_16_14;
-  mysql = assert false; (import <nixpkgs> {}).mysql;
 
 in
 
 {
   charlock_holmes = attrs: {
-    buildInputs = [ which icu ];
+    buildInputs = [ which icu zlib ];
   };
 
   ffi = attrs: {
diff --git a/pkgs/development/interpreters/ruby/bundler-env/monkey_patches.rb b/pkgs/development/interpreters/ruby/bundler-env/monkey_patches.rb
index f3849446fe6..f68a20212ce 100644
--- a/pkgs/development/interpreters/ruby/bundler-env/monkey_patches.rb
+++ b/pkgs/development/interpreters/ruby/bundler-env/monkey_patches.rb
@@ -74,16 +74,24 @@ Bundler::Fetcher.class_eval do
 
     spec_list = gem_names.map do |name|
       spec = Bundler.nix_gemspecs.detect {|spec| spec.name == name }
-      dependencies = spec.dependencies.
-        select {|dep| dep.type != :development}.
-        map do |dep|
-          deps_list << dep.name
-          dep
-        end
-
-      [spec.name, spec.version, spec.platform, dependencies]
+      if spec.nil?
+        msg = "WARNING: Could not find gemspec for '#{name}'"
+        Bundler.ui.warn msg
+        nil
+      else
+        dependencies = spec.dependencies.
+          select {|dep| dep.type != :development}.
+          map do |dep|
+            deps_list << dep.name
+            dep
+          end
+
+        [spec.name, spec.version, spec.platform, dependencies]
+      end
     end
 
+    spec_list.compact!
+
     [spec_list, deps_list.uniq]
   end
 end
diff --git a/pkgs/development/interpreters/tcl/8.5.nix b/pkgs/development/interpreters/tcl/8.5.nix
new file mode 100644
index 00000000000..193ff4f9376
--- /dev/null
+++ b/pkgs/development/interpreters/tcl/8.5.nix
@@ -0,0 +1,11 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  release = "8.5";
+  version = "${release}.18";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
+    sha256 = "1jfkqp2fr0xh6xvaqx134hkfa5kh7agaqbxm6lhjbpvvc1xfaaq3";
+  };
+})
diff --git a/pkgs/development/interpreters/tcl/8.6.nix b/pkgs/development/interpreters/tcl/8.6.nix
new file mode 100644
index 00000000000..fd88c8e8716
--- /dev/null
+++ b/pkgs/development/interpreters/tcl/8.6.nix
@@ -0,0 +1,11 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  release = "8.6";
+  version = "${release}.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
+    sha256 = "13cwa4bc85ylf5gfj9vk182lvgy60qni3f7gbxghq78wk16djvly";
+  };
+})
diff --git a/pkgs/development/interpreters/tcl/default.nix b/pkgs/development/interpreters/tcl/default.nix
deleted file mode 100644
index 913c73f01f3..00000000000
--- a/pkgs/development/interpreters/tcl/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation {
-  name = "tcl-8.6.4";
-
-  src = fetchurl {
-    url = mirror://sourceforge/tcl/tcl8.6.4-src.tar.gz;
-    sha256 = "13cwa4bc85ylf5gfj9vk182lvgy60qni3f7gbxghq78wk16djvly";
-  };
-
-  preConfigure = "cd unix";
-
-  postInstall = ''
-    make install-private-headers
-    ln -s $out/bin/tclsh8.6 $out/bin/tclsh
-  '';
-  
-  meta = {
-    description = "The Tcl scription language";
-    homepage = http://www.tcl.tk/;
-    license = stdenv.lib.licenses.tcltk;
-  };
-  
-  passthru = {
-    libdir = "lib/tcl8.5";
-  };
-}
diff --git a/pkgs/development/interpreters/tcl/generic.nix b/pkgs/development/interpreters/tcl/generic.nix
new file mode 100644
index 00000000000..8b5722c79c8
--- /dev/null
+++ b/pkgs/development/interpreters/tcl/generic.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl
+
+# Version specific stuff
+, release, version, src
+, ...
+}:
+
+stdenv.mkDerivation rec {
+  name = "tcl-${version}";
+
+  inherit src;
+
+  preConfigure = "cd unix";
+
+  postInstall = ''
+    make install-private-headers
+    ln -s $out/bin/tclsh${release} $out/bin/tclsh
+  '';
+  
+  meta = with stdenv.lib; {
+    description = "The Tcl scription language";
+    homepage = http://www.tcl.tk/;
+    license = licenses.tcltk;
+    platforms = platforms.all;
+  };
+  
+  passthru = rec {
+    inherit release version;
+    libPrefix = "tcl${release}";
+    libdir = "lib/${libPrefix}";
+  };
+}