Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 582734 - sys-devel/automake: Prefix support
Summary: sys-devel/automake: Prefix support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: prefix-gx86
  Show dependency tree
 
Reported: 2016-05-11 08:50 UTC by Benda Xu
Modified: 2016-05-19 03:44 UTC (History)
0 users

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


Attachments
automake-1.15-r2.patch (automake.patch,1.48 KB, patch)
2016-05-11 08:52 UTC, Benda Xu
Details | Diff
automake-1.15-r2.patch (automake.patch,2.04 KB, patch)
2016-05-12 03:01 UTC, Benda Xu
Details | Diff
automake-1.15-r2.patch (automake.patch,1.88 KB, patch)
2016-05-13 03:15 UTC, Benda Xu
Details | Diff
automake-1.15-r2.patch (automake.patch,869 bytes, patch)
2016-05-13 23:41 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2016-05-11 08:50:49 UTC
A trivial Prefix patch can be applied to sys-devel/automake.  Please review.

Reproducible: Always
Comment 1 Benda Xu gentoo-dev 2016-05-11 08:52:44 UTC
Created attachment 433940 [details, diff]
automake-1.15-r2.patch

I am planning to go ahead to commit it if there is no objections within a week.
Comment 2 Benda Xu gentoo-dev 2016-05-11 08:55:45 UTC
If the ebuild is bumped to EAPI=6, --docdir need not to be passed explicitly.

cf. https://devmanual.gentoo.org/ebuild-writing/eapi
Comment 3 SpanKY gentoo-dev 2016-05-11 14:12:06 UTC
Comment on attachment 433940 [details, diff]
automake-1.15-r2.patch

you should be making this change to all the SLOTs and not just 1.15

>+	econf --docdir="${EPREFIX}"/usr/share/doc/${PF} HELP2MAN=true

use --docdir="\$(datarootdir)/doc/${PF}"

>+	emake APIVERSION="${SLOT}" pkgvdatadir="${EPREFIX}/usr/share/${PN}-${SLOT}"

use pkgvdatadir="\$(datadir)/${PN}-${SLOT}"

>+		APIVERSION="${SLOT}" pkgvdatadir="${EPREFIX}/usr/share/${PN}-${SLOT}"

use pkgvdatadir="\$(datadir)/${PN}-${SLOT}"
Comment 4 Benda Xu gentoo-dev 2016-05-12 02:59:25 UTC
Thanks Mike, after carefully examing the ebuild, I find it could be clean up quite a bit.  Please have a look my patch.

This time the change is substantial to have a revision bump.
Comment 5 Benda Xu gentoo-dev 2016-05-12 03:01:07 UTC
Created attachment 434022 [details, diff]
automake-1.15-r2.patch

Explanations:

** inherit eutils
   No need to use epatch, it is replaced by PATCHES=( ... ) in EAPI 6.

** econf --docdir
   Not needed in EAPI=6

   https://devmanual.gentoo.org/ebuild-writing/eapi

   2015-10-11 council meeting deprecated EAPI 4.

** econf HELP2MAN=true
   HELP2MAN is no longer found in configure or configure.ac

** WANT_AUTOCONF=2.5
   Not needed, autoconf in tree is at least 2.13.

   RDEPEND="... >=sys-devel/autoconf-2.69 ..."

** APIVERSION="${SLOT}"
   Not needed:

   configure.ac
   57:APIVERSION=`echo "$VERSION" | sed -e 's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'`

   In the ebuild SLOT=${PV:0:4}

   by default, APIVERSION == SLOT

** pkgvdatadir="${EPREFIX}/usr/share/${PN}-${SLOT}"
   Not needed:

   configure.ac
   60:AC_SUBST([pkgvdatadir], ["\${datadir}/$PACKAGE-$APIVERSION"])

   by default, pkgvdatadir="\${datadir}/$PACKAGE-$APIVERSION"
Comment 6 SpanKY gentoo-dev 2016-05-12 03:29:35 UTC
Comment on attachment 434022 [details, diff]
automake-1.15-r2.patch

(In reply to Benda Xu from comment #5)

sory, but no EAPI=6.  you can go to EAPI=5 if you want, but i'm not sure there's anything it offers for us here over EAPI=4.

also, keep in mind that the automake ebuilds look very similar across SLOTs.  that's more valuable than sometimes trimming code in newer ones.  especially when copying to newer versions/bumps including minor ones (e.g. 1.15.1).
Comment 7 Benda Xu gentoo-dev 2016-05-12 03:41:44 UTC
Hi Mike,

(In reply to SpanKY from comment #6)
>
> sory, but no EAPI=6.  you can go to EAPI=5 if you want, but i'm not sure
> there's anything it offers for us here over EAPI=4.

EAPI 5 does not bring us much in this ebuild, but EAPI 6 does.  Because econf --docdir is handled, we can rely on the default implemention of src_configure.  That in turn increases maintainability.

Could you please elaborate on why EAPI 6 cannot be used?

> also, keep in mind that the automake ebuilds look very similar across SLOTs.
> that's more valuable than sometimes trimming code in newer ones.  especially
> when copying to newer versions/bumps including minor ones (e.g. 1.15.1).

I prepared the patch on the newest version in tree to show you the idea.  If this code-trimming is endorsed, I will go on to look into the remaining ebuilds.

1.15.1 is not in the main repo yet, are you planning to bump to it after this bug?
Comment 8 SpanKY gentoo-dev 2016-05-12 15:07:57 UTC
(In reply to Benda Xu from comment #7)

EAPI=6 doesn't bring anything terribly useful.  i keep system packages back to make upgrading much easier for people.  it is not onerous to avoid 6 at this time.
Comment 9 Benda Xu gentoo-dev 2016-05-13 03:15:06 UTC
Created attachment 434122 [details, diff]
automake-1.15-r2.patch

> EAPI=6 doesn't bring anything terribly useful.  i keep system packages back to > make upgrading much easier for people.  it is not onerous to avoid 6 at this time.

Thanks Mike.  I understand now.  Here is a EAPI=5 patch.
Comment 10 SpanKY gentoo-dev 2016-05-13 17:41:57 UTC
Comment on attachment 434122 [details, diff]
automake-1.15-r2.patch

i've deployed a number of these fixes now:

cleanup HELP2MAN usage:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d62a004d49d9b106979621cff790491358cdefa

use $ED everywhere (other than DESTDIR=$D):
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2d3d915865c44a0a838e39ba13ee054f9fe2ec3

tweak --docdir argument:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9188242904a5339ef05f4809b2179f604a607dc
Comment 11 SpanKY gentoo-dev 2016-05-13 17:48:58 UTC
(In reply to Benda Xu from comment #5)

> ** WANT_AUTOCONF=2.5
>    Not needed, autoconf in tree is at least 2.13.

that's not what that means.  2.1 means "use 2.13" while 2.5 means "use 2.50 or newer".

> ** APIVERSION="${SLOT}"
>    Not needed:
> 
>    configure.ac
>    57:APIVERSION=`echo "$VERSION" | sed -e
> 's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'`
> 
>    In the ebuild SLOT=${PV:0:4}
> 
>    by default, APIVERSION == SLOT

it's used in a few scenarios:
 - SLOT is more specific like ${PV} (which sometimes we toy with)
 - using a beta version like 1.11b
 - the live git version is always installed into 9999 and not what upstream 
   happens to have in there atm

i think it'd be better to keep this support, although we can try writing it differently.  perhaps with a sed in src_prepare.  then we should be able to drop  pkgvdatadir.
Comment 12 Benda Xu gentoo-dev 2016-05-13 23:39:13 UTC
(In reply to SpanKY from comment #11)
> i've deployed a number of these fixes now:

Thanks, Mike!

> (In reply to Benda Xu from comment #5)
> 
> > ** WANT_AUTOCONF=2.5
> >    Not needed, autoconf in tree is at least 2.13.
> 
> that's not what that means.  2.1 means "use 2.13" while 2.5 means "use 2.50
> or newer".

Okay.  Keeping it is more friendly to old systems.
Comment 13 Benda Xu gentoo-dev 2016-05-13 23:41:44 UTC
Created attachment 434222 [details, diff]
automake-1.15-r2.patch

> i think it'd be better to keep this support, although we can try writing it 
> differently.  perhaps with a sed in src_prepare.  then we should be able to
> drop  pkgvdatadir.

Ah-ha. How about this patch?
Comment 14 SpanKY gentoo-dev 2016-05-14 01:55:41 UTC
Comment on attachment 434222 [details, diff]
automake-1.15-r2.patch

>+	sed -i "s,APIVERSION=.*\$VERSION.*,APIVERSION=${SLOT}," \
>+		configure || die "sed failed"

would be simpler i think written as:
+   sed -i \
+       -e "/APIVERSION=/s:=.*:=${SLOT}:" \
+       configure || die

it'll overwrite more than one line, but that's OK

rest looks fine.  if you bump to EAPI=5, can probably leverage `default` in src_install ...
Comment 15 Benda Xu gentoo-dev 2016-05-19 03:01:38 UTC
(In reply to SpanKY from comment #14)

> it'll overwrite more than one line, but that's OK
> 
> rest looks fine.  if you bump to EAPI=5, can probably leverage `default` in
> src_install ...

Thanks Mike. I pushed a commit:

  https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b1ee209046
Comment 16 SpanKY gentoo-dev 2016-05-19 03:44:12 UTC
(In reply to Benda Xu from comment #15)

thanks, looks fine