# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="Utility to control C-Media CMI 8338/8738 based soundcards" HOMEPAGE="http://homepage3.nifty.com/StudioBreeze/software/cmictl-e.html" SRC_URI="http://homepage3.nifty.com/StudioBreeze/software/bin/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="gtk nls cmi8338" DEPEND=" gtk? ( >=x11-libs/gtk+-1.2.0 )" S=${WORKDIR}/${P} pkg_setup() { if [[ -z $CMI_BASE ]]; then einfo "Trying to get cmi base address from /proc" CMI_BASE=$(awk '/cmpci/ {print $1}' /proc/ioports | cut -d "-" -f 1) fi if [[ -z $CMI_BASE ]]; then ewarn "CMI_BASE was not set. The build process needs to know the memory" ewarn "address of your card. If you have the cmpci driver compiled" ewarn "as a module, please insmod it and rerun this emerge." ewarn "" ewarn "Alternatively, you can set the CMI_BASE environment variable." ewarn "For example, if \"grep cmpci /proc/ioports\" returns this:" ewarn " a800-a8ff : cmpci" ewarn "you should set CMI_BASE=\"a800\"and run the emerge again." die "CMI_BASE was not set." fi CMI_BASE_HEX="0x${CMI_BASE}" } src_compile() { econf \ $(use_enable gtk gcmictl)\ $(use_enable gtk gtktest)\ $(use_enable !cmi8338 cmi8738)\ $(use_enable nls nls) \ --with-cmibase=${CMI_BASE_HEX} || die "econf failed" emake || die "emake failed" } src_install() { make DESTDIR="${D}" install || die "Install failed!" dodoc ABOUT-NLS AUTHORS README NEWS }