[Backport release-24.11] python312Packages.torchvision: fix building on darwin (#356798)

This commit is contained in:
Pol Dellaiera 2024-11-17 21:25:45 +01:00 committed by GitHub
commit a6d9a9cf70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,10 @@
{
lib,
stdenv,
torch,
apple-sdk_13,
buildPythonPackage,
darwinMinVersionHook,
fetchFromGitHub,
# nativeBuildInputs
@ -44,10 +47,19 @@ buildPythonPackage {
which
] ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ];
buildInputs = [
buildInputs =
[
libjpeg_turbo
libpng
torch.cxxdev
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# This should match the SDK used by `torch` above
apple-sdk_13
# error: unknown type name 'MPSGraphCompilationDescriptor'; did you mean 'MPSGraphExecutionDescriptor'?
# https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/
(darwinMinVersionHook "12.0")
];
dependencies = [