diff --git a/pkgs/development/ocaml-modules/torch/default.nix b/pkgs/development/ocaml-modules/torch/default.nix index e46374ee1c2..9ba356fa939 100644 --- a/pkgs/development/ocaml-modules/torch/default.nix +++ b/pkgs/development/ocaml-modules/torch/default.nix @@ -2,6 +2,7 @@ , stdenv , buildDunePackage , fetchFromGitHub +, fetchpatch , cmdliner , ctypes , dune-configurator @@ -24,11 +25,19 @@ buildDunePackage rec { src = fetchFromGitHub { owner = "LaurentMazare"; - repo = "ocaml-${pname}"; - rev = version; + repo = "ocaml-${pname}"; + rev = version; hash = "sha256-z/9NUBjeFWE63Z/e8OyzDiy8hrn6qzjaiBH8G9MPeos="; }; + patches = [ + # Pytorch 2.0 support. Drop when it reaches a release + (fetchpatch { + url = "https://github.com/LaurentMazare/ocaml-torch/commit/ef7ef30cafecb09e45ec1ed8ce4bedae5947cfa5.patch"; + hash = "sha256-smdwKy40iIISp/25L2J4az6KmqFS1soeChBElUyhl5A="; + }) + ]; + buildInputs = [ dune-configurator ]; propagatedBuildInputs = [