# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit linux-mod DESCRIPTION="Driver for webcams based on the Ricoh r5u870 chip" HOMEPAGE="http://www.palmix.org/r5u870-en.html" SRC_URI="amd64? ( http://www.palmix.org/download/${PN}_k2.6.30_amd64.tar.bz2 ) x86? ( http://www.palmix.org/download/${PN}_k2.6.30_i386.tar.bz2 )" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" S="${WORKDIR}/${PN}" MODULE_NAMES="r5u870(media/video:) usbcam/usbcam(media/video:)" CONFIG_CHECK="VIDEO_V4L2 VIDEO_V4L1_COMPAT FW_LOADER VIDEOBUF_DMA_SG VIDEOBUF_GEN V4L_USB_DRIVERS" MODULESD_R5U870_DOCS="readme" BUILD_TARGETS="all" src_unpack() { unpack ${A} cd "${S}" kernel_is ge 2 6 34 && epatch "${FILESDIR}/${PN}-2.6.34_fix.patch" if kernel_is ge 2 6 35 ; then cd "${WORKDIR}/r5u870/usbcam/" sed -i 's/usb_buffer_alloc/usb_alloc_coherent/g' usbcam_util.c sed -i 's/usb_buffer_free/usb_free_coherent/g' usbcam_util.c fi kernel_is ge 2 6 36 && sed -i 's/vmalloc/vaddr/g' usbcam_buf.c } src_install () { linux-mod_src_install insinto /$(get_libdir)/firmware doins *.fw insinto /usr/share/doc/${P} doins "${FILESDIR}/vivi-dmasg-config.patch" } pkg_setup () { ewarn "If you get warnings about missing symbols, you may need to compile" ewarn "the kernel with the above set" ewarn ewarn "VIDEOBUF_DMA_SG and VIDEOBUF_GEN" ewarn ewarn "You can do that by either editing the .config file and making sure" ewarn "that VIDEOBUF_DMA_SG and VIDEOBUF_GEN are set or by compiling the" ewarn "kernel as follows" ewarn ewarn " # cd /usr/src/linux" ewarn " # make CONFIG_VIDEOBUF_DMA_SG=m CONFIG_VIDEOBUF_GEN=m" ewarn " # make modules_install" ebeep 5 && epause linux-mod_pkg_setup }