diff --git a/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch b/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch new file mode 100644 index 000000000000..8c7176ee16c8 --- /dev/null +++ b/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch @@ -0,0 +1,13 @@ +diff --git a/bin/fiber/fiber.ml b/bin/fiber/fiber.ml +index 188a92cc9..6087a8687 100644 +--- a/bin/fiber/fiber.ml ++++ b/bin/fiber/fiber.ml +@@ -129,7 +129,7 @@ let worker pool = + + let get_concurrency () = + try +- let ic = Unix.open_process_in "getconf _NPROCESSORS_ONLN" in ++ let ic = Unix.open_process_in "@getconf@/bin/getconf _NPROCESSORS_ONLN" in + let close () = ignore (Unix.close_process_in ic) in + let sc = Scanf.Scanning.from_channel ic in + try diff --git a/pkgs/development/ocaml-modules/carton/default.nix b/pkgs/development/ocaml-modules/carton/default.nix index ae58d206c04c..b075ea53021a 100644 --- a/pkgs/development/ocaml-modules/carton/default.nix +++ b/pkgs/development/ocaml-modules/carton/default.nix @@ -3,6 +3,7 @@ , checkseum, logs, psq, fmt , result, rresult, fpath, base64, bos, digestif, alcotest , crowbar, alcotest-lwt, lwt, findlib, mirage-flow, cmdliner, hxd +, getconf, substituteAll }: buildDunePackage rec { @@ -16,6 +17,13 @@ buildDunePackage rec { sha256 = "sha256-NAm4Xq7L0Dgynr8cKZQ356M4GR6D19LbCRxvnSlIf1U="; }; + patches = [ + (substituteAll { + src = ./carton-find-getconf.patch; + getconf = "${getconf}"; + }) + ]; + # remove changelogs for mimic and the git* packages postPatch = '' rm CHANGES.md