summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorJulie Shapiro2021-12-14 11:40:36 -0600
committerJulie Shapiro2021-12-14 11:40:36 -0600
commitd0a4cbcc9b16ff74cddb584812d16c1d1f9400d8 (patch)
tree31d882307d054eb0771b8d13d2950c696d93750e /PKGBUILD
parent653f76f77898d297ea68858c608a2841dbf101d4 (diff)
downloadaur-d0a4cbcc9b16ff74cddb584812d16c1d1f9400d8.tar.gz
move repo over to toolkit
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD57
1 files changed, 35 insertions, 22 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 020e84880eb3..5d87fd97c815 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,39 +3,52 @@
pkgname=nvidia-container-runtime
-pkgver=3.5.0
-pkgrel=2
+# Author's note
+# I am so mad that this cannot be a split package with nvidia-container-toolkit
+# due to it needing a different pkgver. That said, now that the code for this
+# runtime has been moved into the toolkit repo, this file is basically
+# identical to nvidia-container-toolkit's PKGBUILD.
+
+pkgver=3.7.0
+pkgrel=1
+
+toolkit_ver=1.7.0
pkgdesc='NVIDIA opencontainer runtime fork to expose GPU devices to containers.'
arch=('x86_64')
-url='https://github.com/NVIDIA/nvidia-container-runtime'
+# see note above.
+url='https://github.com/NVIDIA/nvidia-container-toolkit'
license=('APACHE')
makedepends=('go')
-depends=('libseccomp' 'nvidia-container-toolkit>=1.5.0')
+depends=('libseccomp' 'nvidia-container-toolkit>=1.7.0')
-source=("https://github.com/NVIDIA/${pkgname}/archive/v${pkgver}.tar.gz")
-sha256sums=('4985efe4488e441d0e4910cc7eb2046176db063e5bbe2e0542a7c08d5c5e7d34')
+source=("v${pkgver}-${pkgrel}.tar.gz"::"${url}/archive/v${toolkit_ver}.tar.gz")
+sha256sums=('f096b2db7cc837164e9739fc31680ff7c1f4135e6b7290dc68f590df3c651a02')
-_srcdir="${pkgname}-${pkgver}"
-
-prepare() {
- mkdir -p gopath/src
- ln -rTsf "${_srcdir}/src" "gopath/src/${pkgname}"
-}
+_srcdir="nvidia-container-toolkit-${toolkit_ver}"
build() {
cd "${_srcdir}"
- pwd
- make build
- #go build \
- # -buildmode=pie \
- # -gcflags "all=-trimpath=${PWD}" \
- # -asmflags "all=-trimpath=${PWD}" \
- # -ldflags "-extldflags ${LDFLAGS}"
+
+ mkdir bin
+
+ GOPATH="${srcdir}/gopath" \
+ go build -v \
+ -buildmode=pie \
+ -gcflags "all=-trimpath=${PWD}" \
+ -asmflags "all=-trimpath=${PWD}" \
+ -ldflags "-s -w -extldflags ${LDFLAGS}" \
+ -o bin \
+ "./..."
+ # -trimpath \ # only go > 1.13
+
+ # go leaves a bunch of local stuff with 0400, making it break future `makepkg -C` _grumble grumble_
+ GOPATH="${srcdir}/gopath" \
+ go clean -modcache
}
-package() {
- install -D -m755 "${srcdir}/${_srcdir}/nvidia-container-runtime" "${pkgdir}/usr/bin/nvidia-container-runtime"
- install -D -m644 "${srcdir}/${_srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+package_nvidia-container-runtime() {
+ install -D -m755 "${_srcdir}/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+ install -D -m644 "${_srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
}