lol

Merge pull request #236535 from charles-dyfis-net/pytorch-unbreak-darwin

python3Packages.torch-bin: only include Linux-specific dependencies when building on Linux

authored by

Weijia Wang and committed by
GitHub
315e7a53 583394b8

+6 -5
+6 -5
pkgs/development/python-modules/torch/bin.nix
··· 40 40 41 41 nativeBuildInputs = [ 42 42 addOpenGLRunpath 43 + patchelf 44 + ] ++ lib.optionals stdenv.isLinux [ 43 45 autoPatchelfHook 44 46 cudaPackages.autoAddOpenGLRunpathHook 45 - patchelf 46 47 ]; 47 48 48 - buildInputs = with cudaPackages; [ 49 + buildInputs = lib.optionals stdenv.isLinux (with cudaPackages; [ 49 50 # $out/${sitePackages}/nvfuser/_C*.so wants libnvToolsExt.so.1 but torch/lib only ships 50 51 # libnvToolsExt-$hash.so.1 51 52 cuda_nvtx 52 - ]; 53 + ]); 53 54 54 - autoPatchelfIgnoreMissingDeps = [ 55 + autoPatchelfIgnoreMissingDeps = lib.optionals stdenv.isLinux [ 55 56 # This is the hardware-dependent userspace driver that comes from 56 57 # nvidia_x11 package. It must be deployed at runtime in 57 58 # /run/opengl-driver/lib or pointed at by LD_LIBRARY_PATH variable, rather ··· 79 80 rm -rf $out/bin 80 81 ''; 81 82 82 - postFixup = '' 83 + postFixup = lib.optionalString stdenv.isLinux '' 83 84 addAutoPatchelfSearchPath "$out/${python.sitePackages}/torch/lib" 84 85 85 86 patchelf $out/${python.sitePackages}/torch/lib/libcudnn.so.8 --add-needed libcudnn_cnn_infer.so.8