# Contributor: Stefan Reimer # Maintainer: Stefan Reimer # https://github.com/NVIDIA/nvidia-container-toolkit pkgname=nvidia-container-toolkit pkgver=1.17.0 pkgrel=0 pkgdesc="NVIDIA Container toolkit incl. cri hooks" url="https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/overview.html" arch="x86_64" license="Apache" makedepends="xz" depends="glibc-bin nvidia-drivers" options="!check !tracedeps" _nv_ver="$pkgver"-1 _libcap=2.44-1 _libseccomp=2.3.3-4 source="https://nvidia.github.io/libnvidia-container/stable/deb/amd64/libnvidia-container1_"$_nv_ver"_amd64.deb https://nvidia.github.io/libnvidia-container/stable/deb/amd64/libnvidia-container-tools_"$_nv_ver"_amd64.deb https://nvidia.github.io/libnvidia-container/stable/deb/amd64/nvidia-container-toolkit-base_"$_nv_ver"_amd64.deb http://deb.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_"$_libseccomp"_amd64.deb http://deb.debian.org/debian/pool/main/libc/libcap2/libcap2_"$_libcap"_amd64.deb config.toml " build() { return 0 } package() { mkdir -p "$pkgdir"/usr/bin "$pkgdir"/usr/glibc-compat/lib/nvidia # libnvidia-container1 ar -x "$srcdir"/libnvidia-container1_"$_nv_ver"_amd64.deb && tar xfJ data.tar.xz mv usr/lib/x86_64-linux-gnu/* "$pkgdir"/usr/glibc-compat/lib/nvidia rm -rf control.tar.xz data.tar.xz debian-binary usr # libnvidia-container-tools ar -x "$srcdir"/libnvidia-container-tools_"$_nv_ver"_amd64.deb && tar xfJ data.tar.xz mv usr/bin/nvidia-container-cli "$pkgdir"/usr/bin rm -rf control.tar.xz data.tar.xz debian-binary usr # nvidia-container-toolkit-base ar -x "$srcdir"/nvidia-container-toolkit-base_"$_nv_ver"_amd64.deb && tar xfJ data.tar.xz mv usr/bin/nvidia* "$pkgdir"/usr/bin rm -rf control.tar.xz data.tar.xz debian-binary usr # Add dependencies which also need to be compiled against glibc: libcap, libseccomp # libcap ar -x "$srcdir"/libcap2_"$_libcap"_amd64.deb && tar xfJ data.tar.xz mv lib/x86_64-linux-gnu/libcap.so.* "$pkgdir"/usr/glibc-compat/lib rm -rf control.tar.xz data.tar.xz debian-binary usr # libseccomp ar -x "$srcdir"/libseccomp2_"$_libseccomp"_amd64.deb && tar xfJ data.tar.xz mv usr/lib/x86_64-linux-gnu/libseccomp.so.* "$pkgdir"/usr/glibc-compat/lib rm -rf control.tar.xz data.tar.xz debian-binary usr # Now lets patch the elf binaries to fix library paths and order doas apk add patchelf@edge-community patchelf --remove-rpath "$pkgdir"/usr/bin/nvidia* patchelf --remove-rpath "$pkgdir"/usr/glibc-compat/lib/nvidia/libnvidia-container.so.1 # Install our runtime config install -Dm644 config.toml "$pkgdir"/etc/nvidia-container-runtime/config.toml } sha512sums=" a69db9dfc7781bde5983a31c7f3083ae7a7b133926a047d7cd3ddbe3ca273a0b96cec9c3aaaf0f2791569b50e23def222c6d322bdaf3e16e5a4cfc037f269a6e libnvidia-container1_1.17.0-1_amd64.deb 48388e0a9dc5d011de55e8a59bdea6552d9a4228c226dfc96a8a642e27ca2f8e414ba0a2c58ebc1246b1787e7b838ca1077b91431549febd6531dc0edb315ff7 libnvidia-container-tools_1.17.0-1_amd64.deb 1de328d0b033083d2433943c4177bafd9a0ea3e58c3f76bc689aece799d7c8d4516ee193c94dd35d300d169c0be3963bf1d30d7e9d754b236aaeebb60d69405c nvidia-container-toolkit-base_1.17.0-1_amd64.deb 5a4eaa96e6e774948889909d618a8ed44a82f649cbba11622dc7b4478098bea006995d5a5a60ca026a57b76ad866d1e2c6caebd154a26eb6bd7e15291b558057 libseccomp2_2.3.3-4_amd64.deb cc9109cdcf51dc40db732e10ac3eda7e4ac73299ad51d2ec619d7f4cff3f0311be0937530d2175e5486c393bc9e91c709072094fad510573785739afaad831f1 libcap2_2.44-1_amd64.deb 355880f5a865d9245c1d353b3c97a71037cf9880afb16e52ff94998b8a0a0cd9d0a6a28175afd85224e4ff3e4a783c60e994ca0bac8196ea8ce05ed61ed463ef config.toml "