This is really awesome !
The Use Case :
You want to just try out a patch for something already in portage.
Instead of creating another ebuild in an overlay you can put your patch in :
/etc/portage/patches/{category}/{package_name}/
For example :
mkdir -p /etc/portage/patches/sys-libs/glibc-2.13-r3/ wget -O /etc/portage/patches/sys-libs/glibc-2.13-r3/fix1.patch "https://bugs.gentoo.org/attachment.cgi?id=279269" emerge -1 glibc
To check if your patch applied you should see the following just after the standard batch of patches:
* Applying user patches from /etc/portage/patches/sys-libs/glibc-2.13-r3 ... * fix1.patch ... [ ok ] * Done with patching
I don't think this works always, because I tried this method for a package yesterday and emerge didn't apply it.
ReplyDeleteThis thread- http://forums.gentoo.org/viewtopic-t-867029-start-0.html says patches in /etc/portage/patches are applied only if the ebuild calls epatch_user or the eclass calls it. :|
Now I guess I'll have to create a new overlay for myself to have custom packages.
Ha indeed, all the ebuild are not capable of this :( Thanks for reporting that !
ReplyDeleteWith bit of effort all the patches magic like PATCHES array and epatch_user could be part of EAPI=6.
ReplyDeleteSo if you want you can start spec-ing it up.
On that note the epatch_user is called by most eclasses (base/kde/gnome/...)
I would love too, I dig this feature ! I gonna ask the PMS guys where I could help there.
Delete