python3Packages.pytorch: Fix CMake files for split outputs

Fixes #102146
This commit is contained in:
Daniël de Kok 2020-12-03 08:30:18 +01:00
parent 3a2e9d2ac7
commit 7e629cc3ae

View File

@ -254,6 +254,15 @@ in buildPythonPackage rec {
cp -r $out/${python.sitePackages}/torch/include $dev/include
cp -r $out/${python.sitePackages}/torch/share $dev/share
# Fix up library paths for split outputs
substituteInPlace \
$dev/share/cmake/Torch/TorchConfig.cmake \
--replace \''${TORCH_INSTALL_PREFIX}/lib "$lib/lib"
substituteInPlace \
$dev/share/cmake/Caffe2/Caffe2Targets-release.cmake \
--replace \''${_IMPORT_PREFIX}/lib "$lib/lib"
mkdir $lib
cp -r $out/${python.sitePackages}/torch/lib $lib/lib
'';