nvidia-{docker,podman}: use buildGoModule

+19 -9
+19 -9
pkgs/applications/virtualization/nvidia-container-toolkit/default.nix
··· 2 , glibc 3 , fetchFromGitLab 4 , makeWrapper 5 - , buildGoPackage 6 , linkFarm 7 , writeShellScript 8 , containerRuntimePath ··· 24 fi 25 ''; 26 in 27 - buildGoPackage rec { 28 pname = "container-toolkit/container-toolkit"; 29 version = "1.9.0"; 30 ··· 32 owner = "nvidia"; 33 repo = pname; 34 rev = "v${version}"; 35 - sha256 = "sha256-b4mybNB5FqizFTraByHk5SCsNO66JaISj18nLgLN7IA="; 36 }; 37 38 - goPackagePath = "github.com/NVIDIA/nvidia-container-toolkit"; 39 40 ldflags = [ "-s" "-w" ]; 41 42 nativeBuildInputs = [ makeWrapper ]; 43 44 - preBuild = '' 45 - # replace the default hookDefaultFilePath to the $out path 46 - substituteInPlace go/src/github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-container-runtime/main.go \ 47 - --replace '/usr/bin/nvidia-container-runtime-hook' '${placeholder "out"}/bin/nvidia-container-runtime-hook' 48 - ''; 49 50 postInstall = '' 51 mkdir -p $out/etc/nvidia-container-runtime
··· 2 , glibc 3 , fetchFromGitLab 4 , makeWrapper 5 + , buildGoModule 6 , linkFarm 7 , writeShellScript 8 , containerRuntimePath ··· 24 fi 25 ''; 26 in 27 + buildGoModule rec { 28 pname = "container-toolkit/container-toolkit"; 29 version = "1.9.0"; 30 ··· 32 owner = "nvidia"; 33 repo = pname; 34 rev = "v${version}"; 35 + hash = "sha256-b4mybNB5FqizFTraByHk5SCsNO66JaISj18nLgLN7IA="; 36 }; 37 38 + vendorHash = null; 39 + 40 + postPatch = '' 41 + # replace the default hookDefaultFilePath to the $out path 42 + substituteInPlace cmd/nvidia-container-runtime/main.go \ 43 + --replace '/usr/bin/nvidia-container-runtime-hook' '${placeholder "out"}/bin/nvidia-container-runtime-hook' 44 + ''; 45 46 ldflags = [ "-s" "-w" ]; 47 48 nativeBuildInputs = [ makeWrapper ]; 49 50 + checkFlags = 51 + let 52 + skippedTests = [ 53 + # Disable tests executing nvidia-container-runtime command. 54 + "TestGoodInput" 55 + "TestDuplicateHook" 56 + ]; 57 + in 58 + [ "-skip" "${builtins.concatStringsSep "|" skippedTests}" ]; 59 60 postInstall = '' 61 mkdir -p $out/etc/nvidia-container-runtime