[arch-commits] Commit in cuda/trunk (PKGBUILD)

Sven-Hendrik Haase svenstaro at nymeria.archlinux.org
Sun Mar 16 02:56:04 UTC 2014


    Date: Sunday, March 16, 2014 @ 03:56:04
  Author: svenstaro
Revision: 107271

Prepare new build

Modified:
  cuda/trunk/PKGBUILD

----------+
 PKGBUILD |   62 +++++++++++++++++++++++++++++++++----------------------------
 1 file changed, 34 insertions(+), 28 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-03-16 02:21:24 UTC (rev 107270)
+++ PKGBUILD	2014-03-16 02:56:04 UTC (rev 107271)
@@ -2,52 +2,58 @@
 # Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
 pkgname=cuda
 pkgver=6.0.26_rc
-pkgrel=1
+pkgrel=2
 pkgdesc="NVIDIA's GPU programming toolkit"
 arch=('x86_64')
 url="http://www.nvidia.com/object/cuda_home.html"
-license=('custom')
+license=('custom:NVIDIA')
 depends=('gcc-libs' 'opencl-nvidia')
 replaces=('cuda-toolkit' 'cuda-sdk')
 provides=('cuda-toolkit' 'cuda-sdk')
 optdepends=('gdb: for cuda-gdb')
 options=(!strip staticlibs)
-md5sums=('ea1e1235ebc17dc8e2ca2bec3febde52'
-         '7e5990e03eea90075f5a500e91a0c3d3'
-         'ffe1e6fb7f97b23da28fd94a5fd7356d')
 install=cuda.install
 source=(http://developer.download.nvidia.com/compute/cuda/6_0/rc/installers/cuda_${pkgver}_linux64.run
         cuda.sh
         cuda.conf)
+md5sums=('ea1e1235ebc17dc8e2ca2bec3febde52'
+         '7e5990e03eea90075f5a500e91a0c3d3'
+         'ffe1e6fb7f97b23da28fd94a5fd7356d')
 
-package() {
-  sh cuda_${pkgver}_linux64.run -extract=$srcdir
-  ./cuda-linux64-rel-6.0.26*.run -prefix=$pkgdir/opt/cuda -noprompt
-  ./cuda-samples-linux-6.0.26*.run -cudaprefix=$pkgdir/opt/cuda -prefix=$pkgdir/opt/cuda/samples -noprompt
+PKGEXT='.pkg.tar' # use for test, compress cuda is a f*king pain (looong time)
+prepare() {
+  sh cuda_${pkgver}_linux64.run -extract=${srcdir}
+  ./cuda-linux64-rel-*.run --noexec --keep
+  ./cuda-samples-linux-*.run --noexec --keep
 
-  # Now, let the hacks begin!
+  # path hacks
 
-  # allow newer gcc to work
-  # NOTE: We don't need these currently, but we might again! :D
-  #sed -i "/unsupported GNU/d" $pkgdir/opt/cuda/include/host_config.h
-  #sed -i "1 i #define __STRICT_ANSI__" $pkgdir/opt/cuda/include/cuda_runtime.h
-  #echo "#undef _GLIBCXX_ATOMIC_BUILTINS" >> $pkgdir/opt/cuda/include/cuda_runtime.h
-  #echo "#define _GLIBCXX_GTHREAD_USE_WEAK 0" >> $pkgdir/opt/cuda/include/cuda_runtime.h
+  # 1rd sed line: sets right path to install man files
+  # 2rd sed line: hack to lie installer, now detect launch script by root
+  # 3rd sed line: sets right path in .desktop files and other .desktop stuff (warnings by desktop-file-validate)
+  sed -e "s|/usr/share|${pkgdir}/${pkgname}/usr/share|g" \
+      -e 's|can_add_for_all_users;|1;|g' \
+      -e 's|=\\"$prefix\\\"|=/opt/cuda|g' -e 's|Terminal=No|Terminal=false|g' -e 's|ParallelComputing|ParallelComputing;|g' \
+      -i pkg/install-linux.pl
 
-  # fix nvidia path fuckup
-  #sed -i "s|/build/pkg/cuda||g" $pkgdir/opt/cuda/bin/nvvp $pkgdir/opt/cuda/bin/nsight
+  # set right path in Samples Makefiles
+  sed 's|\$cudaprefix\\|\\/opt\\/cuda\\|g' -i pkg/install-sdk-linux.pl
 
-  install -Dm755 $srcdir/cuda.sh $pkgdir/etc/profile.d/cuda.sh
-  install -Dm644 $srcdir/cuda.conf $pkgdir/etc/ld.so.conf.d/cuda.conf
+  # use python2
+  find pkg -name '*.py' | xargs sed -i -e 's|env python|env python2|g' -e 's|bin/python|bin/python2|g'
+}
 
-  # correct cuda path in samples
-  cd $pkgdir/opt/cuda/samples
-  find . -name Makefile | xargs sed -i "s|$pkgdir/opt/cuda|/opt/cuda|g"
+package() {
+  cd ${pkgdir}
+  perl install-linux.pl -prefix="${pkgdir}/opt/cuda" -noprompt
+  perl install-sdk-linux.pl -cudaprefix="${pkgdir}/opt/cuda" -prefix="${pkgdir}/opt/cuda/samples" -noprompt
 
-  # make cuda-gdk work
-  mkdir -p $pkgdir/usr/lib
-  cd $pkgdir/usr/lib
-  ln -s /usr/lib/libncurses.so.5 libtinfo.so.5
+  install -Dm755 "${srcdir}/cuda.sh" "${pkgdir}/etc/profile.d/cuda.sh"
+  install -Dm644 "${srcdir}/cuda.conf" "${pkgdir}/etc/ld.so.conf.d/cuda.conf"
 
-  install -Dm644 $pkgdir/opt/cuda/doc/pdf/EULA.pdf $pkgdir/usr/share/licenses/$pkgname/EULA.pdf
+  ln -s /opt/cuda/doc/pdf/EULA.pdf "${pkgdir}/usr/share/licenses/${pkgname}/EULA.pdf"
+
+  # remove redundant man and samples
+  rm -fr "${pkgdir}/opt/cuda/doc/man"
+  rm -fr "${pkgdir}/opt/cuda/cuda-samples"
 }




More information about the arch-commits mailing list