59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
# Contributor: Stefan Reimer <stefan@zero-downtime.net>
|
|
# Maintainer: Stefan Reimer <stefan@zero-downtime.net>
|
|
|
|
pkgname=nvidia-container-toolkit
|
|
|
|
pkgver=1.10.0
|
|
pkgrel=1
|
|
|
|
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}"
|
|
|
|
build() {
|
|
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" \
|
|
}
|
|
|
|
package() {
|
|
install -D -m755 "${_srcdir}/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
|
|
|
|
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"
|
|
|
|
install -D -m644 "${_srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
|
|
}
|
|
|
|
sha512sums='
|
|
4f35918811edf7ea0f24d04eba12e4670b039edd0bb29ed4f16b47c4208f8a3d4316042f5ca52a278fedd1dce549070df69807080b1a7bda4a859369ad707bf9 nvidia-container-toolkit-v1.10.0-1.tar.gz
|
|
'
|