From 7e6b76fc6bdebb12c8c3c2e6223f9fe5f3b38a39 Mon Sep 17 00:00:00 2001
From: Elis Hirwing <elis@hirwing.se>
Date: Sun, 29 Jul 2018 17:13:40 +0200
Subject: [PATCH] php: drop 5.6 and 7.0

Both 5.6 and 7.0 is currently on life support, as in only recieving
security related patches.

This will only continue until:
 - 2018-12-31 for PHP 5.6
 - 2018-12-01 for PHP 7.0

Both these dates are in the middle of the 18.09 lifecycle. So it would
be nice to not have them in the 18.09 stable release. Dropping them
now would also result in less maintanance in updating them.

The death dates can be seen on both these links:
 - https://secure.php.net/supported-versions.php
 - https://en.wikipedia.org/wiki/PHP#Release_history
---
 pkgs/development/interpreters/php/default.nix | 19 ++----
 .../interpreters/php/fix-paths.patch          | 68 -------------------
 pkgs/top-level/all-packages.nix               | 10 ---
 3 files changed, 4 insertions(+), 93 deletions(-)
 delete mode 100644 pkgs/development/interpreters/php/fix-paths.patch

diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index 9bf8577923c..e3c35abc583 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -9,14 +9,13 @@
 with lib;
 
 let
-  php7 = versionAtLeast version "7.0";
   generic =
   { version
   , sha256
   , imapSupport ? config.php.imap or (!stdenv.isDarwin)
   , ldapSupport ? config.php.ldap or true
   , mhashSupport ? config.php.mhash or true
-  , mysqlSupport ? (config.php.mysql or true) && (!php7)
+  , mysqlSupport ? (config.php.mysql or true)
   , mysqlndSupport ? config.php.mysqlnd or true
   , mysqliSupport ? config.php.mysqli or true
   , pdo_mysqlSupport ? config.php.pdo_mysql or true
@@ -26,7 +25,7 @@ let
   , bcmathSupport ? config.php.bcmath or true
   , socketsSupport ? config.php.sockets or true
   , curlSupport ? config.php.curl or true
-  , curlWrappersSupport ? (config.php.curlWrappers or true) && (!php7)
+  , curlWrappersSupport ? config.php.curlWrappers or true
   , gettextSupport ? config.php.gettext or true
   , pcntlSupport ? config.php.pcntl or true
   , postgresqlSupport ? config.php.postgresql or true
@@ -47,7 +46,7 @@ let
   , 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)) && (!php7)
+  , mssqlSupport ? config.php.mssql or (!stdenv.isDarwin)
   , ztsSupport ? config.php.zts or false
   , calendarSupport ? config.php.calendar or true
   , sodiumSupport ? (config.php.sodium or true) && (versionAtLeast version "7.2")
@@ -207,7 +206,7 @@ let
         outputsToInstall = [ "out" "dev" ];
       };
 
-      patches = if !php7 then [ ./fix-paths.patch ] else [ ./fix-paths-php7.patch ];
+      patches = [ ./fix-paths-php7.patch ];
 
       postPatch = optional stdenv.isDarwin ''
         substituteInPlace configure --replace "-lstdc++" "-lc++"
@@ -220,16 +219,6 @@ let
     };
 
 in {
-  php56 = generic {
-    version = "5.6.36";
-    sha256 = "0ahp9vk33dpsqgld0gg4npff67v0l39hs3wk5dm6h3lablzhwsk2";
-  };
-
-  php70 = generic {
-    version = "7.0.30";
-    sha256 = "0l0bhnlgxmfl7mrdykmxfl53simxsksdcnbg5ymqz6r31i03hgr1";
-  };
-
   php71 = generic {
     version = "7.1.19";
     sha256 = "1wvhsxzmb78pcr36ginz93iv7rcrxp3p01rb34zxa2h4wdxkxi0k";
diff --git a/pkgs/development/interpreters/php/fix-paths.patch b/pkgs/development/interpreters/php/fix-paths.patch
deleted file mode 100644
index 51d98549eee..00000000000
--- a/pkgs/development/interpreters/php/fix-paths.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-diff -ru php-5.4.14/configure php-5.4.14-new/configure
---- php-5.4.14/configure	2013-04-10 09:53:26.000000000 +0200
-+++ php-5.4.14-new/configure	2013-04-22 17:13:55.039043622 +0200
-@@ -6513,7 +6513,7 @@
- 
-   case $host_alias in
-   *aix*)
--    APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
-+    APXS_LIBEXECDIR="$prefix/modules"
-     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
-     PHP_AIX_LDFLAGS="-Wl,-brtl"
-     build_type=shared
-@@ -6706,7 +6706,7 @@
-   if test "$?" != "0"; then
-     APACHE_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option
-   else
--    APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-+    APXS_LIBEXECDIR="$prefix/modules"
-     if test -z `$APXS -q SYSCONFDIR`; then
-       APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                        $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-@@ -7909,7 +7909,7 @@
-    { (exit 1); exit 1; }; }
-   fi
- 
--  APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-+  APXS_LIBEXECDIR="$prefix/modules"
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-@@ -8779,7 +8779,7 @@
-    { (exit 1); exit 1; }; }
-   fi
- 
--  APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-+  APXS_LIBEXECDIR="$prefix/modules"
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-@@ -9634,7 +9634,7 @@
- 
-   case $host_alias in
-   *aix*)
--    APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
-+    APXS_LIBEXECDIR="$prefix/modules"
-     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
-     PHP_AIX_LDFLAGS="-Wl,-brtl"
-     build_type=shared
-@@ -9827,7 +9827,7 @@
-   if test "$?" != "0"; then
-     APACHE_HOOKS_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option
-   else
--    APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-+    APXS_LIBEXECDIR="$prefix/modules"
-     if test -z `$APXS -q SYSCONFDIR`; then
-       APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                        $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-@@ -59657,9 +59657,7 @@
- 
- 
- if test "$PHP_GETTEXT" != "no"; then
--  for i in $PHP_GETTEXT /usr/local /usr; do
--    test -r $i/include/libintl.h && GETTEXT_DIR=$i && break
--  done
-+  GETTEXT_DIR=$PHP_GETTEXT
- 
-   if test -z "$GETTEXT_DIR"; then
-     { { $as_echo "$as_me:$LINENO: error: Cannot locate header file libintl.h" >&5
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index dd4ce7f71b7..8854ae15c5d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7419,14 +7419,6 @@ with pkgs;
   php = php72;
   phpPackages = php72Packages;
 
-  php56Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
-    php = php56;
-  });
-
-  php70Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
-    php = php70;
-  });
-
   php71Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
     php = php71;
   });
@@ -7437,8 +7429,6 @@ with pkgs;
 
 
   inherit (callPackages ../development/interpreters/php { })
-    php56
-    php70
     php71
     php72;