1 # Maintainer: Carson Reynolds <carson@k2.t.u-tokyo.ac.jp>
2 # Based upon cuda-sdk PKGBUILD by Lawrence Lee
6 _pkgver=2.10.1215.2015-3233425
8 pkgdesc="NVIDIA's CUDA architecture can be programmed in the only C language environment that unlocks the processing power of GPUs to solve the most complex compute-intensive challenges."
10 [ "$CARCH" = "i686" ] && ARCH=x86
11 [ "$CARCH" = "x86_64" ] && ARCH=x86_64
12 url="http://www.nvidia.com/object/cuda_home.html"
14 depends=('cuda-toolkit'
17 source=(http://developer.download.nvidia.com/compute/cuda/2_1/SDK/cuda-sdk-linux-${_pkgver}.run
18 common.mk.x86_64.patch
19 common.mk.gcc-3.4.patch)
20 md5sums=('7a0548c814e629eb00484b068e58cdbb'
21 '118332d292df64941dd850da2bd15e3f'
22 '5cfec174040d32c5c15276a3e9a6bfaa')
25 mkdir -p $pkgdir/usr/share/licenses/cuda-sdk-gcc34
26 mkdir -p $pkgdir/usr/share/doc/cuda-sdk-gcc34
27 mkdir -p $pkgdir/usr/share/cuda-sdk-gcc34/bin
28 mkdir -p $pkgdir/usr/share/cuda-sdk-gcc34/lib
29 mkdir -p $pkgdir/usr/share/cuda-sdk-gcc34/releaseNotesData
30 mkdir -p $pkgdir/usr/share/cuda-sdk-gcc34/tools
32 #Create links for gcc-3.4 build environment
33 mkdir -p $pkgdir/usr/share/cuda-sdk-gcc34/bin
34 ln -s /usr/bin/gcc-3.4 $pkgdir/usr/share/cuda-sdk-gcc34/bin/gcc
35 ln -s /usr/bin/g++-3.4 $pkgdir/usr/share/cuda-sdk-gcc34/bin/g++
39 sh cuda-sdk-linux-${_pkgver}.run --noexec --keep --nox11 &> /dev/null
42 cp -rf $srcdir/pkg/sdk/common $pkgdir/usr/share/cuda-sdk-gcc34
43 cp -rf $srcdir/pkg/sdk/projects $pkgdir/usr/share/cuda-sdk-gcc34
44 #TODO: data really belongs elsewhere, however many sdk samples would need a rewrite
45 cp -rf $srcdir/pkg/sdk/projects/*/data $pkgdir/usr/share/cuda-sdk-gcc34/bin
48 cd $srcdir/pkg/sdk/common
49 [ "$CARCH" = "x86_64" ] && patch -p0 -i $srcdir/common.mk.x86_64.patch
50 patch -p0 -i $srcdir/common.mk.gcc-3.4.patch || return 1
51 sed -e 's/CUDA_INSTALL_PATH\ ?=\ \/usr\/local\/cuda/CUDA_INSTALL_PATH\ ?=\ \/usr/g' -i $srcdir/pkg/sdk/common/common.mk
52 sed -i 's|GCC34DIR|'"$pkgdir"'/usr/share/cuda-sdk-gcc34/bin|' $srcdir/pkg/sdk/common/common.mk
57 install -m 755 $srcdir/pkg/sdk/bin/linux/release/* $pkgdir/usr/share/cuda-sdk-gcc34/bin
58 install -m 755 $srcdir/pkg/sdk/lib/* $pkgdir/usr/share/cuda-sdk-gcc34/lib
59 install -m 755 $srcdir/pkg/sdk/releaseNotesData/* $pkgdir/usr/share/cuda-sdk-gcc34/releaseNotesData
60 install -m 755 $srcdir/pkg/sdk/tools/* $pkgdir/usr/share/cuda-sdk-gcc34/tools
61 mv $srcdir/pkg/sdk/doc/cudpp_license.txt $pkgdir/usr/share/licenses/cuda-sdk-gcc34
62 mv $srcdir/pkg/sdk/doc/license.txt $pkgdir/usr/share/licenses/cuda-sdk-gcc34
63 install -m 644 $srcdir/pkg/sdk/doc/* $pkgdir/usr/share/doc/cuda-sdk-gcc34
66 #TODO: dxtc & simpleTexture must run as root since the data directory is not writable by default
67 #TODO: matrixMulDrv & simpleTexture are not passing tests