Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 476404 - eutils.eclass: epatch_user doesn't support php slots
Summary: eutils.eclass: epatch_user doesn't support php slots
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-10 15:00 UTC by Marcin Mirosław
Modified: 2013-07-10 23:07 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Mirosław 2013-07-10 15:00:44 UTC
I hope I used epatch_user correctly in ebuild...:)
I'd like to add epatch_user to ebuild which build pecl extension. Here is simplified ebuild:

--8<---------------cut here---------------start------------->8--
EAPI=4
PHP_EXT_NAME="redis"
USE_PHP="php5-3 php5-4"

inherit base eutils php-ext-pecl-r2
DESCRIPTION="The phpredis extension provides an API for communicating with the Redis key-value store"
HOMEPAGE="https://github.com/nicolasff/phpredis"
SRC_URI="https://github.com/nicolasff/phpredis/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="PHP-3.01"
SLOT="0"
KEYWORDS="~amd64 ~x86"

DEPEND="dev-lang/php[-threads]
        dev-php/igbinary"
RDEPEND="${DEPEND}"

src_prepare()   {
        epatch_user
        local slot tmps
        tmps="${S}"
        for slot in $(php_get_slots); do
                S="${S}/../${slot}"
                base_src_prepare
        done
        S="${tmps}"
        php-ext-source-r2_src_prepare
}

--8<---------------cut here---------------end--------------->8--


But after unpack phase I've got two dirs in ${W}: php5.3  phpredis-2.2.3
And epatch_user patches only sources in "phpredis-2.2.3", dir "php5.3" is untouched.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-07-10 15:09:32 UTC
(In reply to Marcin Mirosław from comment #0)
> I hope I used epatch_user correctly in ebuild...:)
> I'd like to add epatch_user to ebuild which build pecl extension. Here is
> simplified ebuild:
> 
> --8<---------------cut here---------------start------------->8--
> EAPI=4
> PHP_EXT_NAME="redis"
> USE_PHP="php5-3 php5-4"
> 
> inherit base eutils php-ext-pecl-r2
> DESCRIPTION="The phpredis extension provides an API for communicating with
> the Redis key-value store"
> HOMEPAGE="https://github.com/nicolasff/phpredis"
> SRC_URI="https://github.com/nicolasff/phpredis/archive/${PV}.tar.gz ->
> ${P}.tar.gz"
> LICENSE="PHP-3.01"
> SLOT="0"
> KEYWORDS="~amd64 ~x86"
> 
> DEPEND="dev-lang/php[-threads]
>         dev-php/igbinary"
> RDEPEND="${DEPEND}"
> 
> src_prepare()   {
>         epatch_user
>         local slot tmps
>         tmps="${S}"
>         for slot in $(php_get_slots); do
>                 S="${S}/../${slot}"
>                 base_src_prepare
>         done
>         S="${tmps}"
>         php-ext-source-r2_src_prepare
> }
> 
> --8<---------------cut here---------------end--------------->8--
> 
> 
> But after unpack phase I've got two dirs in ${W}: php5.3  phpredis-2.2.3
> And epatch_user patches only sources in "phpredis-2.2.3", dir "php5.3" is
> untouched.

You meant ${WORKDIR}, right? And you expect base_src_prepare() to run epatch_user in each php:SLOT copy? Or you expect the patched sources to be copied there by base_src_prepare?
Comment 2 Marcin Mirosław 2013-07-10 16:38:16 UTC
Yeah, ${WORKDIR}.
Meseems it's better to patch sources and copy them to php:SLOT. (I assume there is no need to have diffrent patches for every php:SLOT...). I'm not sure if changing base_src_prepare to copy sources to php:SLOT doesn't break many ebuilds. So it could be safer to run epatch_user in every php:SLOT.
All I would like to see is have patched sources in php:SLOT somewhere inside src_prepare ;) (Also this bug probably should be resolved before bug #475288)
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-07-10 22:56:17 UTC
I don't see how eutils.eclass could implement this in any sane way.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-07-10 23:07:42 UTC
Can't you just descend into these subdirs in src_prepare() and run epatch_user there?

for slot in $(php_get_slots); do
        S="${S}/../${slot}"
        epatch_user
done