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.
(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?
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)
I don't see how eutils.eclass could implement this in any sane way.
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