# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="" HOMEPAGE="http://developer.amd.com/stream" BASE_URI="http://download2-developer.amd.com/amd/GPU/executables" SRC_URI="amd64? ( ${BASE_URI}/atistream-${PV}-lnx64.tar.gzip ) x86? ( ${BASE_URI}/atistream-${PV}-lnx32.tar.gzip )" LICENSE="" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="+samples +doc +tools" DEPEND="" RDEPEND=" >=x11-drivers/ati-drivers-8.561 virtual/libstdc++ " CALROOT="/usr/local/atical" src_unpack() { tar xf ${DISTDIR}/${A} -C ${WORKDIR} cd ${WORKDIR} if use x86; then BIT_VERSION="i386" else BIT_VERSION="x86_64" fi einfo "Unpacking AMD-Cal" dd if=${WORKDIR}/atistream-cal-${PV}.${BIT_VERSION}.run of=${WORKDIR}/atistream-cal.tar.gz bs=16384 skip=1 || die "unpacking failed" einfo "Extracting tar files" tar xzf atistream-cal.tar.gz || die "extracting failed" einfo "Converting rpm to tar" rpm2tar atistream-cal-${PV}-1.${BIT_VERSION}.rpm || die "converting failed" einfo "Extracting files" tar xf ${WORKDIR}/atistream-cal-${PV}-1.${BIT_VERSION}.tar || die "extracting failed" # let's patch them, for gcc >= 4.3 cd "${WORKDIR}/${CALROOT}" epatch "${FILESDIR}/gcc-4.3-atical.patch" } src_install() { dodir "${CALROOT}" if use doc; then dodoc "${WORKDIR}/${CALROOT}/CAL_Documentation"/*.pdf \ || die "Doc copy failed" dohtml "${WORKDIR}/${CALROOT}/CAL_Documentation/html"/* \ || die "Html copy failed" fi insinto "/usr/include/atical/" doins "${WORKDIR}/${CALROOT}/include"/* \ || die "Include copy failed" insinto "${CALROOT}" dosym "/usr/include/atical" "${CALROOT}/include" \ || die "Symlink to includes failed" if use samples; then cp -r "${WORKDIR}/${CALROOT}/samples" "${D}/${CALROOT}" \ || die "Samples copy failed" fperms -R a-x "${CALROOT}/samples" fperms -R a+X "${CALROOT}/samples" cp "${WORKDIR}/${CALROOT}/Makefile.common" "${D}/${CALROOT}/" \ || die "Samples copy failed" fperms a-x "${CALROOT}/Makefile.common" fi if use tools; then cp -r "${WORKDIR}/${CALROOT}/tools" "${D}/${CALROOT}" \ || die "Tools copy failed" cp -r "${WORKDIR}/${CALROOT}/utilities" "${D}/${CALROOT}" \ || die "Utilities copy failed" fi } pkg_postinst() { ewarn "" ewarn "In order to be able to use CAL, you will need to set" ewarn " export CALROOT=\"${CALROOT}\"" ewarn "" }