Patching xorg-server- to work on gentoo/freebsd

While compiling xorg-server on gentoo/freebsd, I was getting an error. So, I paid a visit to #gentoo-bsd on WIth the help of friendly people out there I found that it’s missing something but seemed to be out of luck as we couldn’t find out what was missing.

A quickfire query at revealed that there was indeed a bug filed with xorg-server-1.4.0. You can find the bug at
So, basically I needed to patch up my xorg-server files with the 2 patches given out there.
I used this post to find how to apply patches to ebuilds. So, this is how I went by
1) I created a overlay at /usr/local/portage.
2) Copied files from /usr/portage/x11-base/xorg-server to /usr/local/portage/x11-base/xorg-server
3) Added PORTDIR_OVERLAY=/usr/local/portage
4) Copied the 2 patches to files named os-utils.patch and os-utils1.patch. Moved the files to /usr/local/portage/x11-base/xorg-server/files
5) Edited the ebuild to add the following


6) Now to rebuild the digest for it Code:

ebuild xorg-server- digest

This creates a new digest
7) You’re ready to emerge with your patches ready to apply. Now run emerge pretend to check if portage is using xorg-server from your overlay.

emerge -pv xorg-server

If it is then you can emerge it now. Else check back the steps to see if anything went wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *