diff options
author | Ivan | 2016-10-18 17:53:47 -0400 |
---|---|---|
committer | Ivan | 2016-10-18 17:53:47 -0400 |
commit | 20c2a04ad97cbba11fcb1ceeb8657257006b35c0 (patch) | |
tree | c58fc8be0c2841a0a95d01ae14bada7b13f70388 | |
download | aur-20c2a04ad97cbba11fcb1ceeb8657257006b35c0.tar.gz |
Port from the community tree to preserve cuda 7.5
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 71 | ||||
-rw-r--r-- | cuda-findgllib_mk.diff | 22 | ||||
-rw-r--r-- | cuda.conf | 4 | ||||
-rw-r--r-- | cuda.install | 11 | ||||
-rw-r--r-- | cuda.sh | 1 |
7 files changed, 143 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..536b6f4b63d3 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,30 @@ +pkgbase = cuda-7.5 + pkgdesc = NVIDIA's GPU programming toolkit. Version 7.5 + pkgver = 7.5.18 + pkgrel = 5 + url = http://www.nvidia.com/object/cuda_home.html + install = cuda.install + arch = x86_64 + license = custom:NVIDIA + depends = gcc-libs + depends = opencl-nvidia + depends = gcc5 + optdepends = gdb: for cuda-gdb + provides = cuda-toolkit + provides = cuda-sdk + conflicts = cuda + replaces = cuda-toolkit + replaces = cuda-sdk + options = !strip + options = staticlibs + source = http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run + source = cuda.sh + source = cuda.conf + source = cuda-findgllib_mk.diff + md5sums = 4b3bcecf0dfc35928a0898793cf3e4c6 + md5sums = 7e5990e03eea90075f5a500e91a0c3d3 + md5sums = 71420ee4e90c65df21c6c5d34373c245 + md5sums = 6476452a339c12d8ca18b5feb47100cc + +pkgname = cuda-7.5 + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..eb0d3057ac5c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +cuda_7.5.18_linux.run +pkg/ +src/ + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b620150edcad --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,71 @@ +# Maintainer: Ivan Lisenkov <ivan@ivlis.com> +pkgname=cuda-7.5 +pkgver=7.5.18 +pkgrel=5 +pkgdesc="NVIDIA's GPU programming toolkit. Version 7.5" +arch=('x86_64') +url="http://www.nvidia.com/object/cuda_home.html" +license=('custom:NVIDIA') +conflicts=('cuda') +depends=('gcc-libs' 'opencl-nvidia' 'gcc5') +replaces=('cuda-toolkit' 'cuda-sdk') +provides=('cuda-toolkit' 'cuda-sdk') +optdepends=('gdb: for cuda-gdb') +options=(!strip staticlibs) +install=cuda.install +source=(http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_${pkgver}_linux.run + cuda.sh + cuda.conf + cuda-findgllib_mk.diff) +md5sums=('4b3bcecf0dfc35928a0898793cf3e4c6' + '7e5990e03eea90075f5a500e91a0c3d3' + '71420ee4e90c65df21c6c5d34373c245' + '6476452a339c12d8ca18b5feb47100cc') + +prepare() { + sh cuda_${pkgver}_linux.run -extract=${srcdir} + ./cuda-linux64-rel-*.run --noexec --keep + ./cuda-samples-linux-*.run --noexec --keep + + # path hacks + + # 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|${srcdir}/../pkg/${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 + + # set right path in Samples Makefiles + sed 's|\$cudaprefix\\|\\/opt\\/cuda\\|g' -i pkg/install-sdk-linux.pl + + # use python2 + find pkg -name '*.py' | xargs sed -i -e 's|env python|env python2|g' -e 's|bin/python|bin/python2|g' + + # Fix up samples tht use findgllib_mk + for f in pkg/samples/*/*/findgllib.mk; do + patch $f cuda-findgllib_mk.diff + done +} + +package() { + cd pkg + perl install-linux.pl -prefix="${pkgdir}/opt/cuda" -noprompt + perl install-sdk-linux.pl -cudaprefix="${pkgdir}/opt/cuda" -prefix="${pkgdir}/opt/cuda/samples" -noprompt + + # allow newer gccs to work + sed -i "/unsupported GNU/d" $pkgdir/opt/cuda/include/host_config.h + ln -s /usr/bin/gcc-5 "${pkgdir}/opt/cuda/bin/gcc" + ln -s /usr/bin/g++-5 "${pkgdir}/opt/cuda/bin/g++" + + install -Dm755 "${srcdir}/cuda.sh" "${pkgdir}/etc/profile.d/cuda.sh" + install -Dm644 "${srcdir}/cuda.conf" "${pkgdir}/etc/ld.so.conf.d/cuda.conf" + + mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}" + 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" +} diff --git a/cuda-findgllib_mk.diff b/cuda-findgllib_mk.diff new file mode 100644 index 000000000000..6eb6e23f4449 --- /dev/null +++ b/cuda-findgllib_mk.diff @@ -0,0 +1,22 @@ +--- findgllib.mk.dist 2016-05-01 23:04:03.000000000 +1200 ++++ findgllib.mk 2016-09-16 13:47:21.100160762 +1200 +@@ -64,6 +64,7 @@ + RHEL = $(shell echo $(DISTRO) | grep -i 'red\|rhel' >/dev/null 2>&1; echo $$?) + CENTOS = $(shell echo $(DISTRO) | grep -i centos >/dev/null 2>&1; echo $$?) + SUSE = $(shell echo $(DISTRO) | grep -i suse >/dev/null 2>&1; echo $$?) ++ ARCHLX = $(shell echo $(DISTRO) | grep -i arch >/dev/null 2>&1; echo $$?) + ifeq ("$(UBUNTU)","0") + ifeq ($(HOST_ARCH)-$(TARGET_ARCH),x86_64-armv7l) + GLPATH := /usr/arm-linux-gnueabihf/lib +@@ -102,6 +103,11 @@ + GLPATH ?= /usr/lib64/nvidia + GLLINK ?= -L/usr/lib64/nvidia + DFLT_PATH ?= /usr/lib64 ++ endif ++ ifeq ("$(ARCHLX)","0") ++ GLPATH ?= /usr/lib64/nvidia ++ GLLINK ?= -L/usr/lib64/nvidia ++ DFLT_PATH ?= /usr/lib64 + endif + + # find libGL, libGLU, libXi, diff --git a/cuda.conf b/cuda.conf new file mode 100644 index 000000000000..42b9d4ec4e21 --- /dev/null +++ b/cuda.conf @@ -0,0 +1,4 @@ +/opt/cuda/lib64 +/opt/cuda/lib +/opt/cuda/nvvm/lib64 +/opt/cuda/nvvm/lib diff --git a/cuda.install b/cuda.install new file mode 100644 index 000000000000..fb341b1dd3a3 --- /dev/null +++ b/cuda.install @@ -0,0 +1,11 @@ +post_install() { + echo "The cuda binaries are in /opt/cuda/bin" + echo "The cuda samples are in /opt/cuda/samples" + echo "The cuda docs are in /opt/cuda/doc" + echo "You need to relogin in order for the cuda binaries to appear in your PATH" + post_upgrade +} + +post_upgrade() { + ldconfig -r . +} diff --git a/cuda.sh b/cuda.sh new file mode 100644 index 000000000000..6de59ddd5d27 --- /dev/null +++ b/cuda.sh @@ -0,0 +1 @@ +export PATH=$PATH:/opt/cuda/bin |