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 23, 2022
1 parent 457dabe commit 7df69c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; cross-compiled GMP
;ZQ cross-compiled GMP

(library
(name gmp)
Expand All @@ -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 7df69c6

Please sign in to comment.