# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" DESCRIPTION="Enable compiling code and loading it on ATI/AMD GPU" HOMEPAGE="http://developer.amd.com/sdks/AMDAPPSDK/Pages/default.aspx" SRC_URI="x86? ( http://developer.amd.com/Downloads/AMD-APP-SDK-v${PV}-lnx32.tgz ) amd64? ( http://developer.amd.com/Downloads/AMD-APP-SDK-v${PV}-lnx64.tgz )" LICENSE="AMD GPL-1 as-is" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="livecd examples doc eselect" RESTRICT="strip" RDEPEND="!livecd? ( >=x11-drivers/ati-drivers-11.12[opencl] ) examples? ( media-libs/glew )" # app-admin/eselect-opencl src_unpack() { if [ ${A} != "" ]; then if use amd64; then tar xvf ${DISTDIR}/AMD-APP-SDK-v${PV}-lnx64.tgz --to-stdout | tar xz else tar xvf ${DISTDIR}/AMD-APP-SDK-v${PV}-lnx32.tgz --to-stdout | tar xz fi fi } src_install() { local DEST=/opt/amd-app-sdk insinto ${DEST} if use amd64; then cd AMD-APP-SDK-v${PV}-RC3-lnx64 || die else cd AMD-APP-SDK-v${PV}-RC3-lnx32 || die fi # Install includes # only selected header; not glew insinto ${DEST}/include insopts -m0644 doins -r include/CAL include/OpenVideo if use eselect; then insinto /usr/lib/opencl/ati/include else insinto /usr/include/CL dosym /usr/lib/libOpenCL.so.1 /usr/lib/libOpenCL.so use multilib && dosym /usr/lib32/libOpenCL.so.1 /usr/lib32/libOpenCL.so fi insopts -m0644 doins include/CL/* # Install examples & docs if use examples; then insinto ${DEST} doins -r samples doins -r make fi if use doc; then insinto ${DEST} doins -r docs fi # Create env file echo "ATISTREAMSDKROOT=${DEST}" > 99${PN} doenvd 99${PN} }