# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # inspired by the versions in the devnull and suckless overlays EAPI="2" inherit multilib toolchain-funcs if [ "${PV##*.}" = "9999" ] then : ${EHG_REPO_URI:="http://hg.suckless.org/${PN}"} inherit mercurial SRC_URI="" # Since upstreams recommends (as I believe to remember) using # the hg version wouldn't it make sense to keep the keywords? KEYWORDS="" else SRC_URI="http://www.suckless.org/download/${P}.tar.gz" KEYWORDS="~amd64 ~x86" fi DESCRIPTION="A dynamic window manager for X11" HOMEPAGE="http://${PN}.suckless.org" LICENSE="MIT" SLOT="0" IUSE="doc plan9 python ruby rumai +wistrut" # FIXME Shouldn't it be possible to build without xinerama? DEPEND=" app-text/txt2tags =sys-libs/libixp-${PV} x11-libs/libX11 x11-libs/libXext x11-libs/libXft x11-libs/libXrandr x11-libs/libXinerama" RDEPEND=" ${DEPEND} x11-apps/xmessage x11-apps/xsetroot rumai? ( >=dev-ruby/rumai-3.2.0 >=x11-misc/dmenu-4.0 ) python? ( dev-lang/python )" S="${WORKDIR}/${PN}" # DISTRIBUTORS is not of interest to users. DOCS="NOTES README TODO NEWS" src_prepare() { cp "${FILESDIR}"/config.local.mk "${S}" sed -i \ -e "/^ LIBDIR/s|=.*|= /usr/$(get_libdir)|" \ -e "s|@VERSION@|${PV}|" \ config.local.mk || die "sed failed" # FIXME There is actually code in the Makefile to do this, so # instead of doing this here we should figure out why this # sometimes fails. sed -i \ -e "/^INCLUDES/s|= -I.|= -I. -I/$(pkg-config --cflags xft)|" \ config.mk || die "sed failed" # wmii.doc is installed using dodoc if doc flag is set. # FIXME Setting DOCS in config.local.mk instead does not work. sed -i \ -e "/^ doc/s|doc||" \ -e "/^DOCS =/d" \ -e "/^ LICENSE/d" \ Makefile || die "sed failed" if use plan9 || use python || use ruby then if ! use plan9 then sed -i \ -e "/^ plan9port/d" \ alternative_wmiircs/Makefile || die "sed failed" fi if ! use python then sed -i \ -e "/^DIRS = python/s|python||" \ alternative_wmiircs/Makefile || die "sed failed" fi if ! use ruby then sed -i \ -e "/^ ruby/d" \ alternative_wmiircs/Makefile || die "sed failed" fi else sed -i \ -e "/^ alternative_wmiircs/d" \ Makefile || die "sed failed" fi if use ruby && use rumain then einfo "Both the 'ruby' and 'rumai' useflags are set resulting" einfo "in two ruby wmiirc/libraries to be installed, but you" einfo "probably only want one." fi } src_compile() { emake -j1 || die "emake failed" if use wistrut then cd cmd/strut emake -j1 || die "emake failed" fi } src_install() { emake -j1 DESTDIR="${D}" install || die "emake install failed" if use wistrut then pushd cmd/strut emake -j1 DESTDIR="${D}" install || die "emake install failed" popd fi dodoc ${DOCS} || die "dodoc failed" if use doc then dodoc doc/wmii.pdf # TODO What are these images used for, should # they really be installed and if yes where? # insinto /usr/share/doc/"${P}" # doins "${S}"/img/{"${PN}".{eps,mp,png},icon.png} fi cat > ${T}/${PN} <