blob: 53925ce08bde75fd5496ad6db24bd8073b8eea62 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# Maintainer: Kien Dang <mail at kien dot ai>
# Maintainer: Julie Shapiro <jshapiro at nvidia dot com>
pkgname=nvidia-container-runtime
# 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.13.1
pkgrel=2
toolkit_ver=1.13.2
pkgdesc='NVIDIA opencontainer runtime fork to expose GPU devices to containers.'
arch=('x86_64')
# see note above.
url='https://github.com/NVIDIA/nvidia-container-toolkit'
license=('APACHE')
makedepends=('go')
depends=('libseccomp' 'nvidia-container-toolkit>=1.9.0')
options=(!lto)
source=("${pkgname}-${pkgver}-${pkgrel}.tar.gz"::"${url}/archive/v${toolkit_ver}.tar.gz")
sha256sums=('cf5acb95ddce98ace727e806f52ad3d89f211f4d0b00131d9ab8cbdd0ee04e0a')
_srcdir="nvidia-container-toolkit-${toolkit_ver}"
build() {
cd "${_srcdir}"
mkdir bin
GO111MODULE=auto \
GOPATH="${srcdir}/gopath" \
GOOS=linux \
go build -v \
-modcacherw \
-buildmode=pie \
-gcflags "all=-trimpath=${PWD}" \
-asmflags "all=-trimpath=${PWD}" \
-o bin \
"./..."
# using LDFLAGS is busted because -Wl breaks linking to cuDriver* for some reason :(
#-ldflags "-s -w -extldflags \"${LDFLAGS}\"" \
# only go > 1.13
# -trimpath \
# go leaves a bunch of local stuff with 0400, making it break future `makepkg -C` _grumble grumble_
GO111MODULE=auto \
GOPATH="${srcdir}/gopath" \
go clean -modcache
}
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"
}
|