automake has a variable $(docdir) which may be set by the --docdir ./configure switch. The default value for this ./configure option is something like $(datadir)/$(PACKAGE_NAME), which is often /usr/share/doc/${PN}. Many ebuilds in portage manually specify --docdir="${EPREFIX}"/usr/share/doc/${PF} because it is ebuild QA policy that documentation be installed into /usr/share/${PF}. Since the autotools-utils eclass is intended to target autotools-specific buildsystem peculiarities and --docdir is a standard autotools paradigm, this eclass should pass this switch to ./configure by default.
Created attachment 258681 [details, diff] autotools-utils.eclass-docdir.patch Patch tested to work with a simple ebuild whose package installs doxygen documentation into $(docdir), libstrl. It would be nice to get this into autotools-utils before there's any chance of such a change breaking existing ebuilds, of course ;-).
Indeed, I wonder why --docdir is not set by econf itself though.
Btw, EPREFIX cannot be used since it's in EAPI >= 3 (eclass claims EAPI-2 support, I'll consider raising EAPI requirements for this eclass)
Please keep EAPI-2. We could simply check for the EAPI in the eclass and modify --docdir accordingly.
(In reply to comment #4) > Please keep EAPI-2. We could simply check for the EAPI in the eclass and modify > --docdir accordingly. > I just want to point out that this is not ideal. The prefix overlay has ebuilds that are not EAPI3 (they get converted to EAPI3 when moved to the gx86 tree) Instead, use code like: has ${EAPI:-0} 0 1 2 && ! use prefix && EPREFIX="" <...> --docdir=${EPREFIX}... I assume Nathan will be preparing a patch like this since he was asking about it in IRC ;)
Created attachment 260461 [details, diff] autotools-utils.eclass-docdir.patch ABCD's recommended solution to the EAPI=2 problem.
(In reply to comment #5) > (In reply to comment #4) > > Please keep EAPI-2. We could simply check for the EAPI in the eclass and modify > > --docdir accordingly. > > I just want to point out that this is not ideal. The prefix overlay has ebuilds > that are not EAPI3 (they get converted to EAPI3 when moved to the gx86 tree) > > Instead, use code like: > has ${EAPI:-0} 0 1 2 && ! use prefix && EPREFIX="" > <...> --docdir=${EPREFIX}... Mixing Prefix and gx86 code in gx86 is not ideal either. Maybe it'd be better to create a clean EAPI=3-capable eclass in gx86 and keep the prefixish variant in the prefix overlay?
Why not just raise EAPI version to 3 with -dev-announce mail and rely on it ? (and update ebuilds in gx86 first, it's not like there are many of them) I have yet to see some reasons for keeping EAPI-2..
(In reply to comment #8) > Why not just raise EAPI version to 3 with -dev-announce mail and rely on it ? > (and update ebuilds in gx86 first, it's not like there are many of them) > I have yet to see some reasons for keeping EAPI-2.. Well, I bumped my ebuilds already but I think that we lack some clear docs on EAPI=3 E* variables. Many ebuild writers use them incorrectly.
I believe PMS could use more clear wording on prefix support as well: http://dev.gentoo.org/~ulm/pms/3/pms.html#x1-12000012.1.3 Devmanual is very minimalistic in this regard: http://devmanual.gentoo.org/ebuild-writing/eapi/index.html
*** This bug has been marked as a duplicate of bug 173592 ***
Sorry my bad, this is not a dup.
Ok, now we've got ecompress in EAPI 4 so maybe this is actually feasible. Could you lend a test case?
Created attachment 287507 [details] libstrl-0.5.1.ebuild This ebuild is for a ./configure script which respects --docdir when deciding where to install doxygen-generated documentation. It needs USE=doc to be set for there to be an effect and the default doc directory is /usr/share/doc/libstrl instead of /usr/share/doc/${PF}.
Created attachment 298101 [details, diff] Pass --docdir to configure, and install docs from it. As EAPI 2 support is intended, this requires configuring the build system to install docs into a temporary location and moving files from it. Due to the lack of 'dodoc -r', directories inside docdir are supported only with EAPI 4. Fixes:
Comment on attachment 298101 [details, diff] Pass --docdir to configure, and install docs from it. This patch does things the proper way, I guess. If dodoc() is the only proper way to install documentation, then the note about `--docdir="${EPREFIX}"/usr/share/doc/${PF}' being easier for EAPI=4 is irrelevant. So that note should be dropped IMO. Another thought: Why is /tmp/temporary-docdir used instead of /temporary-docdir? I know that portage ignores empty directories when merging to the filesystem, but it would be nice not to have /tmp left behind in the ${WORKDIR}/image as a side-effect of using autotools-utils.eclass.
(In reply to comment #16) > Comment on attachment 298101 [details, diff] [details, diff] > Pass --docdir to configure, and install docs from it. > > This patch does things the proper way, I guess. If dodoc() is the only proper > way to install documentation, then the note about > `--docdir="${EPREFIX}"/usr/share/doc/${PF}' being easier for EAPI=4 is > irrelevant. So that note should be dropped IMO. Will do. > Another thought: Why is /tmp/temporary-docdir used instead of > /temporary-docdir? I know that portage ignores empty directories when merging > to the filesystem, but it would be nice not to have /tmp left behind in the > ${WORKDIR}/image as a side-effect of using autotools-utils.eclass. /tmp is cleaner but you're completely right.
Created attachment 298139 [details, diff] Pass --docdir to configure, and install docs from it. As EAPI 2 support is intended, this requires configuring the build system to install docs into a temporary location and moving files from it. Due to the lack of 'dodoc -r', directories inside docdir are supported only with EAPI 4. Fixes:
/var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v <-- autotools-utils.eclass new revision: 1.35; previous revision: 1.34 /var/cvsroot/gentoo-x86/eclass/ChangeLog,v <-- ChangeLog new revision: 1.80; previous revision: 1.79 Also: /var/cvsroot/gentoo-x86/dev-libs/libstrl/libstrl-0.5.1.ebuild,v <-- libstrl-0.5.1.ebuild new revision: 1.4; previous revision: 1.3 [because I modified it for testing anyway :P]