1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils toolchain-funcs
7 DESCRIPTION="a dynamic window manager for X11"
8 HOMEPAGE="http://www.10kloc.org/dwm/"
9 SRC_URI="http://10kloc.org/download/${P}.tar.gz"
16 DEPEND="|| ( x11-libs/libX11 <virtual/x11-7 )"
23 epatch "${FILESDIR}/${P}-config_mk.patch"
24 epatch "${FILESDIR}/${P}-makefile.patch"
25 epatch "${FILESDIR}/${P}-weight.patch"
27 if use savedconfig; then
29 [[ -r config.h ]] && rm config.h
30 for conf in ${PF} ${P} ${PN}; do
31 for root in "${PORTAGE_CONFIGROOT}" "${ROOT}" /; do
32 configfile=${root}etc/portage/savedconfig/${conf}.config.h
33 if [[ -r ${configfile} ]]; then
34 elog "Found your ${configfile} and using it."
35 cp ${configfile} "${S}"/config.h
40 ewarn "Could not locate user configfile, so we will save a default one."
45 emake CC=$(tc-getCC) || die "emake failed"
49 emake DESTDIR="${D}" PREFIX="/usr" install || die "emake install failed"
55 if use savedconfig; then
56 local config_dir="${PORTAGE_CONFIGROOT:-${ROOT}}/etc/portage/savedconfig"
57 elog "Saving this build config to ${config_dir}/${PF}.config.h"
58 einfo "Read this ebuild for more info on how to take advantage of this option."
59 mkdir -p "${config_dir}"
60 cp "${S}"/config.h "${config_dir}"/${PF}.config.h
65 einfo "This ebuild has support for user defined configs"
66 einfo "Please read this ebuild for more details and re-emerge as needed"
67 einfo "if you want to add or remove functionality for ${PN}"