From 91f24957262e76a6cff959ce49867703349d839d Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 23 Mar 2023 22:27:56 +0200 Subject: [PATCH] ocamlPackages.torch: patch for pytorch 2.0.0 compatibility --- pkgs/development/ocaml-modules/torch/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 = [