commit:     52e20370c0d974fb1452c29d755b738b6a8b0523
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  6 17:26:42 2019 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Fri Dec  6 17:27:10 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52e20370

dev-lang/php: Fix locating iODBC for use with PDO

Closes: https://bugs.gentoo.org/702106
Package-Manager: Portage-2.3.80, Repoman-2.3.19
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-lang/php/files/php-iodbc-header-location.patch | 14 ++++++++++++
 dev-lang/php/php-7.4.0.ebuild                      | 26 +++++++++++++++++-----
 2 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/dev-lang/php/files/php-iodbc-header-location.patch 
b/dev-lang/php/files/php-iodbc-header-location.patch
new file mode 100644
index 00000000000..e34f09b6ec8
--- /dev/null
+++ b/dev-lang/php/files/php-iodbc-header-location.patch
@@ -0,0 +1,14 @@
+diff -aurN a/ext/pdo_odbc/config.m4 b/ext/pdo_odbc/config.m4
+--- a/ext/pdo_odbc/config.m4   2019-11-26 15:13:39.000000000 -0500
++++ b/ext/pdo_odbc/config.m4   2019-12-06 10:39:56.296658492 -0500
+@@ -85,6 +85,10 @@
+     PDO_ODBC_LIBDIR="$pdo_odbc_def_libdir"
+   fi
+ 
++  if test "$pdo_odbc_def_lib" = "iodbc" ; then
++    PDO_ODBC_INCDIR="$PDO_ODBC_INCDIR/iodbc"
++  fi
++
+   AC_MSG_RESULT([$pdo_odbc_flavour
+           libs       $PDO_ODBC_LIBDIR,
+           headers    $PDO_ODBC_INCDIR])

diff --git a/dev-lang/php/php-7.4.0.ebuild b/dev-lang/php/php-7.4.0.ebuild
index 9f8615b21e6..fbf13a93f6b 100644
--- a/dev-lang/php/php-7.4.0.ebuild
+++ b/dev-lang/php/php-7.4.0.ebuild
@@ -150,6 +150,8 @@ BDEPEND="virtual/pkgconfig"
 
 PHP_MV="$(ver_cut 1)"
 
+PATCHES=( "${FILESDIR}/php-iodbc-header-location.patch" )
+
 php_install_ini() {
        local phpsapi="${1}"
 
@@ -358,10 +360,25 @@ src_configure() {
        fi
 
        # ODBC support
-       our_conf+=(
-               $(use_with odbc unixODBC "${EPREFIX}/usr")
-               $(use_with iodbc)
-       )
+       if use odbc && use iodbc ; then
+               our_conf+=(
+                       --without-unixODBC
+                       --with-iodbc
+                       $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr")
+               )
+       elif use odbc ; then
+               our_conf+=(
+                       --with-unixODBC="${EPREFIX}/usr"
+                       --without-iodbc
+                       $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr")
+               )
+       else
+               our_conf+=(
+                       --without-unixODBC
+                       --without-iodbc
+                       --without-pdo-odbc
+               )
+       fi
 
        # Oracle support
        our_conf+=( $(use_with oci8-instant-client oci8) )
@@ -374,7 +391,6 @@ src_configure() {
                        $(use_with postgres pdo-pgsql)
                        $(use_with sqlite pdo-sqlite)
                        $(use_with firebird pdo-firebird "${EPREFIX}/usr")
-                       $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
                        $(use_with oci8-instant-client pdo-oci)
                )
        fi

Reply via email to