updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / cuda-sdk-gcc34 / PKGBUILD
blob14827a0c8acad0a0822169a1414f5e62ab918970
1 # Maintainer: Carson Reynolds <carson@k2.t.u-tokyo.ac.jp>
2 # Based upon cuda-sdk PKGBUILD by Lawrence Lee
4 pkgname=cuda-sdk-gcc34
5 pkgver=2.10.1215.2015
6 _pkgver=2.10.1215.2015-3233425
7 pkgrel=1
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."
9 arch=('i686' 'x86_64')
10 [ "$CARCH" = "i686"   ] && ARCH=x86
11 [ "$CARCH" = "x86_64" ] && ARCH=x86_64
12 url="http://www.nvidia.com/object/cuda_home.html"
13 license=('custom')
14 depends=('cuda-toolkit'
15          'freeglut'
16          'gcc34')
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')
23 build() {
24   #Make directories
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++  
37   #Extract the SDK
38   cd $srcdir
39   sh cuda-sdk-linux-${_pkgver}.run --noexec --keep --nox11 &> /dev/null
40   
41   #Copy over folders
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
47   #Build the SDK
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
53   cd $srcdir/pkg/sdk
54   make || return 1
55   
56   #Install the files
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