--- pygame-1.8.0_rc4.ebuild 2008-03-24 19:16:16.458174000 +0100 +++ pygame-1.8.0_rc4-r1.ebuild 2008-03-24 19:21:22.028174000 +0100 @@ -13,7 +13,7 @@ LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86 ~x86-fbsd" -IUSE="doc" +IUSE="doc X" RDEPEND=">=media-libs/libsdl-1.2.5 >=media-libs/sdl-ttf-2.0.6 @@ -27,9 +27,12 @@ S="${WORKDIR}/${MY_P}" pkg_setup() { - if ! built_with_use media-libs/libsdl X ; then - eerror "Please re-emerge media-libs/libsdl with the X USE-flag set." - die "Missing USE-flag for media-libs/libsdl" + if use X ; then + # if we want X11 (at all), make sure libsdl was also built with X11 support + if ! built_with_use media-libs/libsdl X ; then + eerror "Please re-emerge media-libs/libsdl with the X USE-flag set." + die "Missing USE-flag for media-libs/libsdl" + fi fi } @@ -39,6 +42,11 @@ sed -i \ -e "s:/lib:/$(get_libdir):" \ "${S}/config_unix.py" || die "sed failed" + if use !X ; then + # if we do not want X11 support, disable it + einfo "Disabling X11 support" + epatch ${FILESDIR}/${MY_P}_disable-X11.diff + fi } src_compile() {