I use Gentoo Linux and I love it however the Portage package manager can be confusing sometimes with all the USE flags and other variables which can be set. Generally the error messages are fairly accurate with instructions however today I ran across a particularly stubborn package that just would not build.
The package was x11-apps/xdpyinfo. Now I have never had a problem with this package before so it had me pretty stumped. So I took a look at the build log and noticed that XTest.h was the problem.
make: Entering directory `/var/tmp/portage/x11-apps/xdpyinfo-1.1.0/work/xdpyinfo-1.1.0' GEN xdpyinfo.1 CC xdpyinfo.o xdpyinfo.c:94:34: error: X11/extensions/XTest.h: No such file or directory xdpyinfo.c: In function 'print_xtest_info': xdpyinfo.c:701: warning: implicit declaration of function 'XTestQueryExtension' xdpyinfo.c:701: warning: nested extern declaration of 'XTestQueryExtension' xdpyinfo.c: At top level: xdpyinfo.c:1485: error: 'XTestExtensionName' undeclared here (not in a function) make: *** [xdpyinfo.o] Error 1 make: Leaving directory `/var/tmp/portage/x11-apps/xdpyinfo-1.1.0/work/xdpyinfo-1.1.0' make: *** [all] Error 2 * * ERROR: x11-apps/xdpyinfo-1.1.0 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 3212: Called x-modular_src_compile * environment, line 3997: Called x-modular_src_make * environment, line 4036: Called die * The specific snippet of code: * emake || die "emake failed" * The die message: * emake failed
So just a quick little trick you can do if this happens to you is use equery to find out which package in Portage contains that one file you need.
r00t@infected ~/Downloads $ equery b /usr/include/X11/extensions/XTest.h [ Searching for file(s) /usr/include/X11/extensions/XTest.h in *... ] !!! Parse error in '/var/db/pkg/dev-libs/check-0.9.5-r1/CONTENTS' !!! line 1: Null byte found in CONTENTS entry x11-proto/xextproto-7.0.5 (/usr/include/X11/extensions/XTest.h) r00t@infected ~/Downloads $
Now all you need to do is emerge whichever package your file belonged to and you should be able to build the one that was giving you trouble.