The git eclass has a variable EGIT_SOURCEDIR defaulting to ${S} to explicitly override the checkout location. This is extremely useful for repositories where the actual sources reside under a subdirectory. The normal approach is to set ${S} to the full path to the appropriate subdirectory: EHG_REPO_URI="[...]" S="${WORKDIR}/${P}/sudirectory_containing_sources" But with this, the mercurial eclass tries to copy the checkout to ${S} and, consequently, this approach fails. With an EHG_SOURCEDIR variable that explicitly sets the checkout location this would be easily possible: EHG_REPO_URI="[...]" EHG_SOURCEDIR="${WORKDIR}/${P}" S="${WORKDIR}/${P}/sudirectory_containing_sources" Without, I see no viable solution for this problem except for manual movement of directories in the src_prepare stage, which is clumsy. Reproducible: Always
One could call mercurial_fetch in src_unpack, but it might be more useful and consistent with git-r3 to add a EGIT_CHECKOUT_DIR variable.
Created attachment 380690 [details, diff] patch against gx86 version Have a look if you like that.
+ 25 Jul 2014; Christoph Junghans <ottxor@gentoo.org> mercurial.eclass: + Added EHG_CHECKOUT_DIR to override checkout destination +