Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##file: dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.0.ebuild
- # Copyright 1999-2011 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
- # $Header: /var/cvsroot/gentoo-x86/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.0.ebuild,v 1.1 2011/05/29 20:26:10 spock Exp $
- EAPI=2
- inherit eutils toolchain-funcs
- DESCRIPTION="NVIDIA CUDA Software Development Kit"
- HOMEPAGE="http://developer.nvidia.com/cuda"
- CUDA_V=${PV//_/-}
- DIR_V=${CUDA_V//./_}
- DIR_V=${DIR_V//beta/Beta}
- SRC_URI="http://developer.download.nvidia.com/compute/cuda/${DIR_V}/sdk/gpucomputingsdk_${CUDA_V}.17_linux.run"
- LICENSE="CUDPP"
- SLOT="0"
- KEYWORDS="~amd64 ~x86"
- IUSE="debug +doc +examples opencl +cuda"
- RDEPEND=">=dev-util/nvidia-cuda-toolkit-4.0
- examples? ( >=x11-drivers/nvidia-drivers-260.19.21 )
- media-libs/freeglut"
- DEPEND="${RDEPEND}"
- S="${WORKDIR}"
- RESTRICT="binchecks"
- pkg_setup() {
- if use cuda || use opencl && [ "$(gcc-major-version)" == "4" -a $(gcc-minor-version) -ge 6 ]; then
- eerror "This package requires <=sys-devel/gcc-4.5 to build successfully."
- eerror "Please use gcc-config to switch to a compatible GCC version."
- die "<=sys-devel/gcc-4.5 required"
- fi
- }
- src_unpack() {
- unpack_makeself
- }
- #src_prepare() {
- # epatch "${FILESDIR}"/${PN}-gcc4.4_fix.patch
- #}
- src_compile() {
- if ! use examples; then
- return
- fi
- local myopts=""
- if use debug; then
- myopts="${myopts} dbg=1"
- fi
- cd "${S}/sdk"
- if use cuda; then
- cd C
- emake cuda-install=/opt/cuda ${myopts} || die
- cd ..
- fi
- if use opencl; then
- cd OpenCL
- emake || die
- cd ..
- fi
- }
- src_install() {
- cd "${S}/sdk"
- if ! use doc; then
- rm -rf *.txt doc */doc */Samples.htm */releaseNotesData
- fi
- if ! use examples; then
- rm -rf bin */bin */tools
- fi
- for f in $(find .); do
- local t="$(dirname ${f})"
- if [[ "${t/obj\/}" != "${t}" || "${t##*.}" == "a" ]]; then
- continue
- fi
- if [[ ! -d "${f}" ]]; then
- if [[ -x "${f}" ]]; then
- exeinto "/opt/cuda/sdk/${t}"
- doexe "${f}"
- else
- insinto "/opt/cuda/sdk/${t}"
- doins "${f}"
- fi
- fi
- done
- }
- diff -u /usr/portage/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.0.ebuild /usr/local/portage/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.0.ebuild
- --- /usr/portage/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.0.ebuild 2011-05-30 00:26:10.000000000 +0400
- +++ /usr/local/portage/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.0.ebuild 2011-10-20 14:32:45.000000000 +0400
- @@ -29,10 +29,10 @@
- RESTRICT="binchecks"
- pkg_setup() {
- - if use cuda || use opencl && [ "$(gcc-major-version)" == "4" -a $(gcc-minor-version) -ge 5 ]; then
- - eerror "This package requires <=sys-devel/gcc-4.4 to build sucessfully."
- + if use cuda || use opencl && [ "$(gcc-major-version)" == "4" -a $(gcc-minor-version) -ge 6 ]; then
- + eerror "This package requires <=sys-devel/gcc-4.5 to build successfully."
- eerror "Please use gcc-config to switch to a compatible GCC version."
- - die "<=sys-devel/gcc-4.4 required"
- + die "<=sys-devel/gcc-4.5 required"
- fi
- }
- @@ -40,6 +40,10 @@
- unpack_makeself
- }
- +#src_prepare() {
- +# epatch "${FILESDIR}"/${PN}-gcc4.4_fix.patch
- +#}
- +
- src_compile() {
- if ! use examples; then
- return
- ##file: dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-4.0.ebuild
- # Copyright 1999-2011 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
- # $Header: /var/cvsroot/gentoo-x86/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-4.0.ebuild,v 1.7 2011/09/04 10:08:12 maekke Exp $
- EAPI=2
- inherit eutils multilib
- DESCRIPTION="NVIDIA CUDA Toolkit"
- HOMEPAGE="http://developer.nvidia.com/cuda"
- RESTRICT="binchecks"
- CUDA_V=${PV//_/-}
- DIR_V=${CUDA_V//./_}
- DIR_V=${DIR_V//beta/Beta}
- BASE_URI="http://developer.download.nvidia.com/compute/cuda/${DIR_V}/toolkit"
- SRC_URI="amd64? ( ${BASE_URI}/cudatoolkit_${CUDA_V}.17_linux_64_ubuntu10.10.run )
- x86? ( ${BASE_URI}/cudatoolkit_${CUDA_V}.17_linux_32_ubuntu10.10.run )"
- LICENSE="NVIDIA"
- SLOT="0"
- KEYWORDS="amd64 x86"
- IUSE="debugger doc profiler"
- RDEPEND="${DEPEND}
- >=sys-devel/binutils-2.20
- <sys-devel/gcc-4.6
- profiler? ( x86? (
- x11-libs/qt-gui
- x11-libs/qt-core
- x11-libs/qt-assistant[compat]
- x11-libs/qt-sql[sqlite] )
- media-libs/libpng:1.2
- )
- debugger? ( >=sys-libs/libtermcap-compat-2.0.8-r2 )
- !<=x11-drivers/nvidia-drivers-270.41"
- S="${WORKDIR}"
- #QA_DT_HASH_x86="opt/cuda/.*"
- #QA_DT_HASH_amd64="opt/cuda/.*"
- src_unpack() {
- for f in ${A} ; do
- if [ "${f//*.run/}" == "" ]; then
- unpack_makeself ${f}
- fi
- done
- }
- src_prepare() {
- epatch "${FILESDIR}"/${P}-gcc4.5_fix.patch
- }
- src_install() {
- local DEST=/opt/cuda
- into ${DEST}
- dobin bin/*
- dolib $(get_libdir)/*
- if ! use debugger; then
- rm -f "${D}/${DEST}/bin/cuda-gdb"
- fi
- chmod a-x "${D}/${DEST}/bin/nvcc.profile"
- # TODO: Manuals are missing from this release. Remove the following
- # commented-out lines if they are not restored in the next releases.
- # doman does not respect DESTTREE
- #insinto ${DEST}/man/man1
- #doins man/man1/*
- #insinto ${DEST}/man/man3
- #doins man/man3/*
- #prepman ${DEST}
- insinto ${DEST}/include
- doins -r include/*
- insinto ${DEST}/src
- doins src/*
- if use doc ; then
- insinto ${DEST}/doc
- doins -r doc/*
- fi
- cat > "${T}/env" << EOF
- PATH=${DEST}/bin
- ROOTPATH=${DEST}/bin
- LDPATH=${DEST}/$(get_libdir)
- MANPATH=${DEST}/man
- EOF
- newenvd "${T}/env" 99cuda
- if use profiler; then
- local target="computeprof"
- into ${DEST}/${target}
- dobin ${target}/bin/${target}
- cat > "${T}/env" << EOF
- PATH=${DEST}/${target}/bin
- ROOTPATH=${DEST}/${target}/bin
- EOF
- if use x86 ; then
- dosym /usr/bin/assistant ${DEST}/${target}/bin
- insinto ${DEST}/${target}/bin
- doins ${target}/bin/cudaapitrace32.so
- else
- dobin ${target}/bin/assistant
- insinto ${DEST}/${target}/bin
- doins ${target}/bin/*.so.?.?.?
- for f in ${target}/bin/*.so.?; do
- dosym $(readlink ${f}) ${DEST}/${f}
- done
- insinto ${DEST}/${target}/bin/sqldrivers
- doins ${target}/bin/sqldrivers/*
- cat >> "${T}/env" << EOF
- LDPATH=${DEST}/${target}/bin
- EOF
- fi
- newenvd "${T}/env" 99${target}
- if use doc; then
- insinto ${DEST}/${target}
- doins ${target}/*.txt
- insinto ${DEST}/${target}/doc
- doins ${target}/doc/*
- insinto ${DEST}/${target}/projects
- doins ${target}/projects/*
- fi
- make_desktop_entry /opt/cuda/computeprof/bin/computeprof "NVIDIA Compute Visual Profiler"
- fi
- export CONF_LIBDIR_OVERRIDE="lib"
- # HACK: temporary workaround until CONF_LIBDIR_OVERRIDE is respected.
- export LIBDIR_amd64="lib"
- into ${DEST}/open64
- dobin open64/bin/*
- libopts -m0755
- dolib open64/lib/*
- # TODO: ideally, there would be multiple OpenCL implementations available in
- # the tree and an eselect module would allow to switch between them.
- into /
- dosym /opt/cuda/include/CL usr/include/CL
- }
- pkg_postinst() {
- env-update
- elog "If you want to natively run the code generated by this version of the"
- elog "CUDA toolkit, you will need >=x11-drivers/nvidia-drivers-260.19.21."
- elog ""
- elog "Run '. /etc/profile' before using the CUDA toolkit. "
- }
- diff -u /usr/portage/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-4.0.ebuild /usr/local/portage/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-4.0.ebuild
- --- /usr/portage/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-4.0.ebuild 2011-09-04 14:31:12.000000000 +0400
- +++ /usr/local/portage/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-4.0.ebuild 2011-10-22 16:46:37.000000000 +0400
- @@ -25,7 +25,7 @@
- RDEPEND="${DEPEND}
- >=sys-devel/binutils-2.20
- - sys-devel/gcc:4.4
- + <sys-devel/gcc-4.6
- profiler? ( x86? (
- x11-libs/qt-gui
- x11-libs/qt-core
- @@ -49,6 +49,10 @@
- done
- }
- +src_prepare() {
- + epatch "${FILESDIR}"/${P}-gcc4.5_fix.patch
- +}
- +
- src_install() {
- local DEST=/opt/cuda
- ##file: dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-4.0-gcc4.5_fix.patch
- --- include/host_config.h.backup 2011-10-20 14:30:16.213280825 +0400
- +++ include/host_config.h 2011-10-20 14:30:48.523876841 +0400
- @@ -77,11 +77,11 @@
- #if defined(__GNUC__)
- -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)
- +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)
- -#error -- unsupported GNU version! gcc 4.5 and up are not supported!
- +#error -- unsupported GNU version! gcc 4.6 and up are not supported!
- -#endif /* __GNUC__> 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4) */
- +#endif /* __GNUC__> 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) */
- #endif /* __GNUC__ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement