Open joprice opened 2 years ago
I got it to build with these overrides:
libtorch =
stdenv.mkDerivation {
name = "libtorch";
version = "1.8.0";
src = pkgs.fetchzip {
url = "https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.8.0.zip";
sha256 = "109c85kjm71d9jzir2ha7w6k97f02ny2cqipb8rdrlq1sg75nnap";
};
installPhase = ''
mkdir -p $out
cp -r include/ $out/include
cp -r lib/ $out/lib
'';
};
...
override = {selection}: {
libtorch = _: libtorch;
torch = super: super.overrideAttrs (
super: {
LIBTORCH = libtorch;
buildInputs = (super.buildInputs or []) ++ [ pkgs.darwin.apple_sdk.frameworks.IOKit ];
}
);
...
Yeah I've never encountered the extra-source
directive before, so if you want to work on a PR to add support that'd be great 🙂
I'm trying to build torch with opam2nix, which uses libtorch. The latter's opam file uses the extra-source directive to pull in libtorch:
I don't see this mentioned in opam2nix, so I assume it needs to be parsed and converted to a nix expression. If that's the case, I could try to work on it if needed. In the meantime, to work around this, I'll try overriding that package.