Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 350423 - autotools-utils.eclass doesn't pass --docdir to econf()
Summary: autotools-utils.eclass doesn't pass --docdir to econf()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Maciej Mrozowski
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-03 01:32 UTC by Nathan Phillip Brink (binki) (RETIRED)
Modified: 2012-01-14 14:55 UTC (History)
1 user (show)

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


Attachments
autotools-utils.eclass-docdir.patch (autotools-utils.eclass-docdir.patch,571 bytes, patch)
2011-01-03 01:35 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details | Diff
autotools-utils.eclass-docdir.patch (autotools-utils.eclass-docdir.patch,623 bytes, patch)
2011-01-21 20:30 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details | Diff
libstrl-0.5.1.ebuild (libstrl-0.5.1.ebuild,775 bytes, text/plain)
2011-09-23 13:15 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details
Pass --docdir to configure, and install docs from it. (Pass---docdir-to-configure-and-install-docs-from-i.patch,1.88 KB, patch)
2012-01-06 15:40 UTC, Michał Górny
Details | Diff
Pass --docdir to configure, and install docs from it. (Pass---docdir-to-configure-and-install-docs-from-i.patch,1.74 KB, patch)
2012-01-06 22:01 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2011-01-03 01:32:22 UTC
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.
Comment 1 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2011-01-03 01:35:18 UTC
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 ;-).
Comment 2 Maciej Mrozowski gentoo-dev 2011-01-04 16:38:14 UTC
Indeed, I wonder why --docdir is not set by econf itself though.
Comment 3 Maciej Mrozowski gentoo-dev 2011-01-04 16:45:51 UTC
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)
Comment 4 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2011-01-21 19:20:28 UTC
Please keep EAPI-2. We could simply check for the EAPI in the eclass and modify --docdir accordingly.
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-01-21 20:23:28 UTC
(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 ;)
Comment 6 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2011-01-21 20:30:20 UTC
Created attachment 260461 [details, diff]
autotools-utils.eclass-docdir.patch

ABCD's recommended solution to the EAPI=2 problem.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-01-21 21:14:29 UTC
(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?
Comment 8 Maciej Mrozowski gentoo-dev 2011-01-22 20:38:56 UTC
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..
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-01-22 20:42:30 UTC
(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.
Comment 10 Maciej Mrozowski gentoo-dev 2011-01-22 22:24:25 UTC
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
Comment 11 Anthony Basile gentoo-dev 2011-02-01 16:26:26 UTC

*** This bug has been marked as a duplicate of bug 173592 ***
Comment 12 Anthony Basile gentoo-dev 2011-02-01 16:29:30 UTC
Sorry my bad, this is not a dup.
Comment 13 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-09-23 11:11:43 UTC
Ok, now we've got ecompress in EAPI 4 so maybe this is actually feasible. Could you lend a test case?
Comment 14 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2011-09-23 13:15:34 UTC
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}.
Comment 15 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-01-06 15:40:25 UTC
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 16 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2012-01-06 21:36:34 UTC
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.
Comment 17 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-01-06 21:59:59 UTC
(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.
Comment 18 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-01-06 22:01:46 UTC
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:
Comment 19 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-01-14 14:55:51 UTC
/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]