dev-lang/php: Fix locating iODBC for use with PDO
authorBrian Evans <grknight@gentoo.org>
Fri, 6 Dec 2019 17:26:42 +0000 (12:26 -0500)
committerBrian Evans <grknight@gentoo.org>
Fri, 6 Dec 2019 17:27:10 +0000 (12:27 -0500)
Closes: https://bugs.gentoo.org/702106
Package-Manager: Portage-2.3.80, Repoman-2.3.19
Signed-off-by: Brian Evans <grknight@gentoo.org>
dev-lang/php/files/php-iodbc-header-location.patch [new file with mode: 0644]
dev-lang/php/php-7.4.0.ebuild

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 (file)
index 0000000..e34f09b
--- /dev/null
@@ -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])
index 9f8615b21e659d9ecf78028367d5cfd2dbc866bb..fbf13a93f6be089539b282318e5550eb49caa3c4 100644 (file)
@@ -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