Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Trouble applying patches from /etc/portage/patches
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Wintershade
n00b
n00b


Joined: 21 Jul 2007
Posts: 32
Location: Croatia

PostPosted: Mon Nov 04, 2013 1:34 pm    Post subject: [SOLVED] Trouble applying patches from /etc/portage/patches Reply with quote

Ok, so I added a sunrise overlay via layman, and found an ebuild for a package called media-gfx/gimp-texturize-plugin. The package doesn't currently compile, but I found a few patches that would theoretically make it compile. I haven't tried the patches out, because I'm trying to make portage patch it automatically, and I'm clearly doing something wrong here.

Anyway, I've put these few patches into /etc/portage/patches directory, under the path of /etc/portage/patches/media-gfx/gimp-texturize-plugin-2.1 (since portage is trying to emerge the 2.1 version), however when I try to emerge the package (by typing emerge -av gimp-texturize-plugin), the patches don't apply.
The source is downloaded and extracted, but the "Applying user patches from /etc/portage/patches/..." is not there.

On the other hand, when I try to emerge nvidia-drivers (from gentoo), the patch for kernel 3.11 (from /etc/portage/patches) applies normally and it compiles.
Does this happen because I'm trying to emerge a package from outside the gentoo repository, i.e. from a sunrise overlay? Or is there some other reason? I've tried making a "patches" directory in "/var/lib/layman", and putting the patches there,
In any case, I'd like to know how to apply these patches properly, and if at all possible, while emerging the package.

Thanks in advance!
_________________
Only the best is good enough.

My make.conf file


Last edited by Wintershade on Mon Nov 04, 2013 3:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
TomWij
Retired Dev
Retired Dev


Joined: 04 Jul 2012
Posts: 1553

PostPosted: Mon Nov 04, 2013 1:36 pm    Post subject: Reply with quote

The ebuild needs to have support for it by calling epatch_user or using an eclass that calls epatch_user.
Back to top
View user's profile Send private message
Wintershade
n00b
n00b


Joined: 21 Jul 2007
Posts: 32
Location: Croatia

PostPosted: Mon Nov 04, 2013 3:02 pm    Post subject: Reply with quote

Ok, I've copied the ebuild into my local portage overlay, and added the following block into it:
Code:
src_prepare(){
    epatch_user
}


...as well as
Code:
inherit eutils
at the beginning of the ebuild.
However, it appears I'm missing something major (or minor?) here, since it's still not patching.

Where can I find any documentation regarding this? Thanks again :)
_________________
Only the best is good enough.

My make.conf file
Back to top
View user's profile Send private message
TomWij
Retired Dev
Retired Dev


Joined: 04 Jul 2012
Posts: 1553

PostPosted: Mon Nov 04, 2013 3:25 pm    Post subject: Reply with quote

You need at least EAPI="2" in the ebuild for src_prepare to work. (http://devmanual.gentoo.org/ebuild-writing/eapi/)
Back to top
View user's profile Send private message
Wintershade
n00b
n00b


Joined: 21 Jul 2007
Posts: 32
Location: Croatia

PostPosted: Mon Nov 04, 2013 3:45 pm    Post subject: Reply with quote

OK, so I added this...
Code:
EAPI="2"

before the 5th line, then this...
Code:
inherit eutils

before src_prepare, and this...
Code:
src_prepare() {
    epatch_user
}

...before the src_install in the ebuild.
That did it. Thanks a lot!

Anyway, I'll try to report this to someone. This is my 2nd sunrise ebuild that failed to compile (fixed the first one without any help on this forum), so I suppose someone should know about it... or not?
_________________
Only the best is good enough.

My make.conf file
Back to top
View user's profile Send private message
radio_flyer
Guru
Guru


Joined: 04 Nov 2004
Posts: 317
Location: Northern California

PostPosted: Mon Nov 04, 2013 3:57 pm    Post subject: Reply with quote

FYI, what I've done to get around this issue of ebuilds not calling epatch_user is to add an /etc/portage/bashrc file containing:
Code:

# Run epatch automatically to pick up patches in /etc/portage/patches
post_src_prepare() {
    epatch_user
}


Now every ebuild calls it.
Back to top
View user's profile Send private message
Wintershade
n00b
n00b


Joined: 21 Jul 2007
Posts: 32
Location: Croatia

PostPosted: Mon Nov 04, 2013 4:27 pm    Post subject: Reply with quote

Sadly, this method of yours yields this kind of error for me:
Code:
/etc/portage/bashrc: line 3: epatch_user: command not found



...at least in case of this particular ebuild. What I have to do is edit the ebuild file anyway, and add the
Code:
EAPI="2"
and
Code:
inherit eutils
lines into it. It works then. Thanks again! :)
_________________
Only the best is good enough.

My make.conf file
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum