Skip to content

Commit

Permalink
remove opam dependancy
Browse files Browse the repository at this point in the history
if the `opam config subst` call fails, substitute the jobs variable with the number of physical cores in the machine
  • Loading branch information
Ryan Gibb committed Sep 26, 2022
1 parent 457dabe commit a4a4639
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
"%{ocaml-config:native_c_libraries}"))))

(rule
(targets build.sh)
(target build.sh)
(deps build.sh.in)
(mode fallback)
(action
(run opam config subst "build.sh")))
(bash "opam config subst %{target} ||
(CORES=`grep '^core id' /proc/cpuinfo | sort -u| wc -l`;
sed \"s/\%{jobs}\%/$CORES/g\" %{target}.in > %{target})")))

0 comments on commit a4a4639

Please sign in to comment.