Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 33544

Summary: src_install should have a default like src_compile
Product: Portage Development Reporter: Seemant Kulleen (RETIRED) <seemant>
Component: CoreAssignee: PMS/EAPI <pms>
Status: RESOLVED FIXED    
Severity: normal CC: avuton, billie, coldwind, dberkholz, esigra, masterdriverz, mr_bones_, rbu
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard: in-eapi-4
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 174380    

Description Seemant Kulleen (RETIRED) gentoo-dev 2003-11-15 02:18:46 UTC
Currently, if there is no src_compile function in an ebuild, then portage does the econf and emake steps automatically.  A long time ago, it used to do the einstall step as well automatically.  Can we have that back with one added feature? A MYDOC variable, so that it can do einstall and dodoc automatically.
Comment 1 SpanKY gentoo-dev 2003-11-15 20:59:15 UTC
actually can we have it do a `make install DESTDIR=${D}` ?
Comment 2 Nicholas Jones (RETIRED) gentoo-dev 2003-12-22 23:57:50 UTC
If it's automatic, it'll be emake.
see EXTRA_ECONF and EXTRA_EMAKE
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2004-05-10 19:16:21 UTC
please don't make it use emake install.  some broken packages fail if you
try to do make install with -j2.  there's just no good reason I can think
of to use emake for install.  I'd be willing to hear why it's a good idea
though - maybe I don't have a fancy enough imagination.
Comment 4 Aron Griffis (RETIRED) gentoo-dev 2004-05-10 19:25:18 UTC
you could always have it automatically be emake -j1 install if you still want to take advantage of EXTRA_EMAKE
Comment 5 SpanKY gentoo-dev 2004-05-10 22:56:13 UTC
yep, here's my 2 cents for:
emake -j1 install DESTDIR=${D}
Comment 6 Aron Griffis (RETIRED) gentoo-dev 2004-05-11 07:23:58 UTC
spanky's suggestion in comment 5 is probably fine, but you *could* do this instead:

if [ -f Makefile -o -f GNUmakefile -o -f makefile ]; then
    if find . -name \[Mm]akefile -o -name GNUmakefile -print0 | \
        xargs --null grep -Fq '$.DESTDIR'
    then
        emake -j1 install DESTDIR=${D} || die "emake -j1 install failed"
    else
        einstall || die "einstall failed"
    fi
fi
Comment 7 Mr. Bones. (RETIRED) gentoo-dev 2004-05-11 13:05:34 UTC
I'd prefer to see 

emake -j1 DESTDIR=${D} install

like it shows in the man page instead of

emake -j1 install DESTDIR=${D}
Comment 8 Nicholas Jones (RETIRED) gentoo-dev 2004-05-16 03:16:05 UTC
So is QA voting no on this one?

Current opinions?
Comment 9 Mr. Bones. (RETIRED) gentoo-dev 2004-05-24 18:19:57 UTC
Needs to support MYDOC or something to be useful but I for one am not voting "no"
on this.  I think a generic src_install could be useful.
Comment 10 Marius Mauch (RETIRED) gentoo-dev 2005-12-04 09:28:30 UTC
So this as default?

src_install() {
    emake -j1 DESTDIR="${D}" install
    dodoc ${MYDOC}
}
Comment 11 Mr. Bones. (RETIRED) gentoo-dev 2005-12-04 10:45:17 UTC
needs to error check like it does in comment #6
Comment 12 SpanKY gentoo-dev 2005-12-04 11:15:25 UTC
[[ -n ${MYDOC} ]] && dodoc ${MYDOC}
Comment 13 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-04 23:43:28 UTC
Requires EAPI change, leaving it for a bit so that EAPI portage's make it into the wild.
Comment 14 Brian Harring (RETIRED) gentoo-dev 2006-01-06 21:46:30 UTC
...and should people wonder why, the EAPI change is required so that ebuilds that rely on the default src_install aren't horked when running under an older portage that lacks the default src_install.

Yes, dep on portage does the same, but it's also going to result in a crapload of duplicate deps on portage...
Comment 15 Santiago M. Mola (RETIRED) gentoo-dev 2008-05-23 11:07:20 UTC
Here's the default src_install being used currently on exheres-0:

http://paludis.pioto.org/trac/browser/trunk/paludis/repositories/e/ebuild/exheres-0/src_install.bash

It may be useful as inspiration.
Comment 16 Zac Medico gentoo-dev 2008-05-23 19:25:12 UTC
(In reply to comment #15)
> Here's the default src_install being used currently on exheres-0:
> 
> http://paludis.pioto.org/trac/browser/trunk/paludis/repositories/e/ebuild/exheres-0/src_install.bash
> 
> It may be useful as inspiration.
> 

That one contains a big hardcoded list of dodoc arguments. If we put the default implementation in eapi-2.eclass, we have ebuilds with EAPI=2 automatically inherit it. Ebuilds that override the default src_install will be able to call eapi-2_src_install if they just want to add something to the default implementation.
Comment 17 Robert Buchholz (RETIRED) gentoo-dev 2009-03-08 16:10:19 UTC
This was the result of the collaboration on -dev in last September, and I would like to propose it for future EAPI.

default_src_install() {
        if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
                emake DESTDIR="${D}" install || die "emake install failed"
        fi
        if [ -n "${DOCS}" ]; then
                dodoc ${DOCS}
        else
                for x in AUTHORS ChangeLog NEWS README; do
                        if [ -e ${x} ]; then
                                dodoc ${x}
                        fi
                done
        fi
}
Comment 18 Daniel Pielmeier gentoo-dev 2009-03-23 11:44:02 UTC
(In reply to comment #17)
>                         if [ -e ${x} ]; then
>                                 dodoc ${x}
>                         fi

Maybe it is a good idea to check if the files are are existant and non empty. There are many applications out there for which this is true. Afaik the gnu autotools require that files but many developers leave them empty and use others instead.

if [ -s ${x} ]; then
        dodoc ${x}
fi
Comment 19 Mart Raudsepp gentoo-dev 2009-03-26 19:27:02 UTC
(In reply to comment #18)
> Maybe it is a good idea to check if the files are are existant and non empty.

I believe current portage dodoc itself already does that check itself, but might not QA-warn about it, but just won't install the file listed to dodoc.
Comment 20 Ulrich Müller gentoo-dev 2010-12-30 19:53:04 UTC
EAPI 4 has been approved by the council.