Skip to content

Commit

Permalink
coq: keep compiling master
Browse files Browse the repository at this point in the history
(cherry picked from commit 531093c)
  • Loading branch information
proux01 authored and github-actions[bot] committed Dec 24, 2024
1 parent 037a4b4 commit a9ce6d8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
9 changes: 6 additions & 3 deletions pkgs/applications/science/logic/coq/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ self = stdenv.mkDerivation {
cp bin/votour $out/bin/
'' + ''
ln -s $out/lib/coq${suffix} $OCAMLFIND_DESTDIR/coq${suffix}
'' + lib.optionalString (coqAtLeast "8.21") ''
ln -s $out/lib/rocq-runtime $OCAMLFIND_DESTDIR/rocq-runtime
ln -s $out/lib/rocq-core $OCAMLFIND_DESTDIR/rocq-core
'' + lib.optionalString (coqAtLeast "8.14") ''
ln -s $out/lib/coqide-server $OCAMLFIND_DESTDIR/coqide-server
'' + lib.optionalString buildIde ''
Expand All @@ -229,16 +232,16 @@ self = stdenv.mkDerivation {
};
}; in
if coqAtLeast "8.17" then self.overrideAttrs(_: let
init-stdlib-package = if coqAtLeast "8.21" then "rocq-core" else "coq-stdlib"; in {
core-stdlib-package = if coqAtLeast "8.21" then "rocq-core" else "coq-stdlib"; in {
buildPhase = ''
runHook preBuild
make dunestrap
dune build -p coq-core,${init-stdlib-package},coqide-server${lib.optionalString buildIde ",coqide"} -j $NIX_BUILD_CORES
dune build -p coq-core${lib.optionalString (coqAtLeast "8.21") ",rocq-runtime"},${core-stdlib-package},coqide-server${lib.optionalString buildIde ",coqide"} -j $NIX_BUILD_CORES
runHook postBuild
'';
installPhase = ''
runHook preInstall
dune install --prefix $out coq-core ${init-stdlib-package} coqide-server${lib.optionalString buildIde " coqide"}
dune install --prefix $out coq-core ${lib.optionalString (coqAtLeast "8.21") "rocq-runtime"} ${core-stdlib-package} coqide-server${lib.optionalString buildIde " coqide"}
runHook postInstall
'';
}) else self
13 changes: 10 additions & 3 deletions pkgs/development/coq-modules/stdlib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@
useDune = true;

configurePhase = ''
echo "no configure phase"
patchShebangs stdlib/dev/with-rocq-wrap.sh
''; # don't run Coq's configure

preBuild = ''
echo "(dirs stdlib)" > dune
buildPhase = ''
cd stdlib
dev/with-rocq-wrap.sh dune build -p coq-stdlib @install ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
'';

installPhase = ''
dev/with-rocq-wrap.sh dune install --root . coq-stdlib --prefix=$out --libdir $OCAMLFIND_DESTDIR
mkdir $out/lib/coq/
mv $OCAMLFIND_DESTDIR/coq $out/lib/coq/${coq.coq-version}
'';

meta = {
Expand Down

0 comments on commit a9ce6d8

Please sign in to comment.