commit:     03126f2b58f398000d0ffc10e6e3b1720e03a5f7
Author:     Sam Jorna <wraeth <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 25 04:13:55 2016 +0000
Commit:     Sam Jorna <wraeth <AT> gentoo <DOT> org>
CommitDate: Fri Mar 25 04:15:16 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03126f2b

sci-libs/geos: fix build ext for all php targets

Ensures the extention for all php targets is built. Ebuild from
grknight.

Gentoo-bug: 578188
Gentoo-bug: 578190
Package-Manager: portage-2.2.28

 .../{geos-3.5.0-r1.ebuild => geos-3.5.0-r2.ebuild} | 50 ++++++++++++++++++----
 1 file changed, 42 insertions(+), 8 deletions(-)

diff --git a/sci-libs/geos/geos-3.5.0-r1.ebuild 
b/sci-libs/geos/geos-3.5.0-r2.ebuild
similarity index 66%
rename from sci-libs/geos/geos-3.5.0-r1.ebuild
rename to sci-libs/geos/geos-3.5.0-r2.ebuild
index d433e60..e7d6e01 100644
--- a/sci-libs/geos/geos-3.5.0-r1.ebuild
+++ b/sci-libs/geos/geos-3.5.0-r2.ebuild
@@ -44,10 +44,21 @@ pkg_setup() {
        use python && python-single-r1_pkg_setup
 }
 
-src_prepare() {
+# Call default here to override the php-ext-source-r2_src_unpack
+src_unpack() {
        default
+}
+
+src_prepare() {
+       epatch "${PATCHES[@]}"
        eautoreconf
        echo "#!${EPREFIX}/bin/bash" > py-compile
+       if use php; then
+               local php_slot
+               for php_slot in $(php_get_slots); do
+                       cp -a "${S}" "${WORKDIR}/${php_slot}" || die
+               done
+       fi
 }
 
 src_configure() {
@@ -55,23 +66,40 @@ src_configure() {
        local PHP_CONFIG
        local php_libdir="${EROOT}usr/$(get_libdir)"
 
+       econf \
+               $(use_enable python) \
+               $(use_enable ruby) \
+               --disable-php \
+               $(use_enable static-libs static)
+
        if use php; then
                local php_slot
                for php_slot in $(php_get_slots); do
                        PHP_CONFIG="${php_libdir}/${php_slot}/bin/php-config"
                        [[ -e "${PHP_CONFIG}" ]] && export PHP_CONFIG
+                       pushd "${WORKDIR}/${php_slot}" > /dev/null || die
+                       econf \
+                               --disable-python \
+                               --disable-ruby \
+                               --enable-php \
+                               --disable-static
+                       popd > /dev/null || die
                done
        fi
-
-       econf \
-               $(use_enable python) \
-               $(use_enable ruby) \
-               $(use_enable php) \
-               $(use_enable static-libs static)
 }
 
 src_compile() {
        emake
+       if use php; then
+               local php_slot
+               for php_slot in $(php_get_slots); do
+                       pushd "${WORKDIR}/${php_slot}/php" > /dev/null || die
+                       rm -r ../capi || die
+                       ln -sfr "${S}/capi" ../capi
+                       emake
+                       popd > /dev/null || die
+               done
+       fi
 
        use doc && emake -C "${S}/doc" doxygen-html
 }
@@ -84,9 +112,15 @@ src_install() {
 
        if use php; then
                local php_slot
-               local libpath="lib/extensions/no-debug-non-zts-20131226/geos.so"
+               local libpath
+               local php_libdir="${EROOT}usr/$(get_libdir)"
 
                for php_slot in $(php_get_slots); do
+                       pushd "${WORKDIR}/${php_slot}/php" > /dev/null || die
+                       emake DESTDIR="${D}" install
+                       popd > /dev/null || die
+                       # The libpath will vary by slot as the extension-dir is 
tied to the API date
+                       
libpath="lib/extensions/$(${php_libdir}/${php_slot}/bin/php-config 
--extension-dir | grep -o '[^/]*$')/geos.so"
                        local 
lib="${D}/usr/$(get_libdir)/${php_slot}/${libpath}"
                        if [[ -e "${lib}" ]]; then
                                chrpath -d ${lib} || die "Failed cleaning RPATH 
on '${lib}'"

Reply via email to