Gentoo Archives: gentoo-user

From: Nikos Chantziaras <realnc@×××××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Applying patches without needing overlays and modifying ebuilds
Date: Sun, 17 May 2009 10:34:06
Message-Id: guop5r$7q6$1@ger.gmane.org
In Reply to: Re: [gentoo-user] Applying patches without needing overlays and modifying ebuilds by Peter Alfredsen
1 Peter Alfredsen wrote:
2 > On Sun, 17 May 2009 09:42:20 +0100
3 > Neil Bothwick <neil@××××××××××.uk> wrote:
4 >
5 >> I think you can redefine ebuild functions
6 >> in /etc/portage/env/cat/pkg, so you could out a custom src_unpack()
7 >> in there. It should work if the ebuild has no src_unoack, so you
8 >> could do something like
9 >>
10 >> src_unpack() {
11 >> unpack ${A}
12 >> epatch mypatch
13 >> }
14 >>
15 >> I don't know how this would work with an existing src_unpack in the
16 >> ebuild, if you copied the existing function and added your patch.
17 >
18 > I use /etc/portage/bashrc for the same purpose. For instance, this is a
19 > patch I'm tacking onto portage ATM:
20 >
21 > if [[ ${CATEGORY}/${PN} == sys-apps/portage ]]
22 > then
23 > post_src_unpack() {
24 > cd "${S}"/bin
25 > epatch "/etc/portage/patches/misc-functions.patch"
26 > }
27 > fi
28 >
29 > As you can see, there are post_ and pre_ phases for all phase functions
30 > which can be used to do fancy stuff like this.
31 >
32 > I prefer /etc/portage/bashrc for this, since these hacks are usually
33 > only needed for a short time, so having them all in one place for an
34 > easy overview helps to keep the cruft down.
35
36 Thanks. I already have a /etc/portage/bashrc in place, which pulls
37 packages out of /etc/portage/package.icc to be compiled with Intel C++.
38 I'll try to use the same mechanism to pull patches from
39 /etc/portage/package.patch for packages listed there.