2022-08-31 13:51:59 +00:00
|
|
|
# Contributor: Stefan Reimer <stefan@zero-downtime.net>
|
|
|
|
# Maintainer: Stefan Reimer <stefan@zero-downtime.net>
|
2022-08-31 18:52:45 +00:00
|
|
|
|
2022-08-31 13:51:59 +00:00
|
|
|
pkgname=nvidia-container-toolkit
|
2022-08-31 18:52:45 +00:00
|
|
|
|
2022-08-31 13:51:59 +00:00
|
|
|
pkgver=1.10.0
|
|
|
|
pkgrel=1
|
|
|
|
|
2022-08-31 18:52:45 +00:00
|
|
|
pkgdesc='NVIDIA container runtime toolkit'
|
|
|
|
arch='x86_64'
|
|
|
|
url='https://github.com/NVIDIA/nvidia-container-toolkit'
|
|
|
|
license='Apache'
|
|
|
|
|
|
|
|
makedepends='go bash'
|
|
|
|
#depends='libnvidia-container-tools>=1.9.0'
|
|
|
|
options='!lto'
|
|
|
|
|
|
|
|
source="${pkgname}-v${pkgver}-${pkgrel}.tar.gz"::"${url}/archive/v${pkgver}.tar.gz"
|
|
|
|
_srcdir="${srcdir}/${pkgname}-${pkgver}"
|
2022-08-31 13:51:59 +00:00
|
|
|
|
|
|
|
build() {
|
2022-08-31 18:52:45 +00:00
|
|
|
mkdir bin
|
|
|
|
|
|
|
|
export GOPATH="${srcdir}"
|
|
|
|
export GOBIN="$GOPATH/bin"
|
|
|
|
|
|
|
|
go get "./..."
|
|
|
|
|
|
|
|
# Patch Nvidia dl loader
|
|
|
|
sed -i '/RTLD_DEEPBIND/d' vendor/github.com/NVIDIA/go-nvml/pkg/dl/dl.go
|
|
|
|
|
|
|
|
go build -v \
|
|
|
|
-modcacherw \
|
|
|
|
-buildmode=pie \
|
|
|
|
-gcflags "all=-trimpath=${PWD}" \
|
|
|
|
-asmflags "all=-trimpath=${PWD}" \
|
|
|
|
-ldflags "-s -w -extldflags ${LDFLAGS}" \
|
|
|
|
-trimpath \
|
|
|
|
-o bin \
|
|
|
|
"./..."
|
|
|
|
#-ldflags " -s -w -extldflags=-Wl,-z,now,-z,relro" \
|
2022-08-31 13:51:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2022-08-31 18:52:45 +00:00
|
|
|
install -D -m755 "${_srcdir}/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
|
2022-08-31 13:51:59 +00:00
|
|
|
|
2022-08-31 18:52:45 +00:00
|
|
|
cd "${pkgdir}/usr/bin/"
|
|
|
|
ln -sf "${pkgname}" "nvidia-container-runtime-hook"
|
|
|
|
cd -
|
|
|
|
install -D -m644 "${_srcdir}/config/config.toml.centos" "${pkgdir}/etc/nvidia-container-runtime/config.toml"
|
|
|
|
install -D -m644 "${_srcdir}/oci-nvidia-hook.json" "${pkgdir}/usr/share/containers/oci/hooks.d/00-oci-nvidia-hook.json"
|
2022-08-31 13:51:59 +00:00
|
|
|
|
2022-08-31 18:52:45 +00:00
|
|
|
install -D -m644 "${_srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
|
2022-08-31 13:51:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sha512sums='
|
2022-08-31 18:52:45 +00:00
|
|
|
4f35918811edf7ea0f24d04eba12e4670b039edd0bb29ed4f16b47c4208f8a3d4316042f5ca52a278fedd1dce549070df69807080b1a7bda4a859369ad707bf9 nvidia-container-toolkit-v1.10.0-1.tar.gz
|
2022-08-31 13:51:59 +00:00
|
|
|
'
|