From a9ce6d8c7d58c7e2fd967c2f2c9bee8d3258224f Mon Sep 17 00:00:00 2001 From: Pierre Roux Date: Fri, 20 Dec 2024 16:45:01 +0100 Subject: [PATCH] coq: keep compiling master (cherry picked from commit 531093ccbd5706ab0d56becac92c35a937ea53a8) --- pkgs/applications/science/logic/coq/default.nix | 9 ++++++--- pkgs/development/coq-modules/stdlib/default.nix | 13 ++++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix index 5ae405b0a94f2..24d9f8bd27968 100644 --- a/pkgs/applications/science/logic/coq/default.nix +++ b/pkgs/applications/science/logic/coq/default.nix @@ -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 '' @@ -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 diff --git a/pkgs/development/coq-modules/stdlib/default.nix b/pkgs/development/coq-modules/stdlib/default.nix index 86db7159031ec..e75d62a0ce34b 100644 --- a/pkgs/development/coq-modules/stdlib/default.nix +++ b/pkgs/development/coq-modules/stdlib/default.nix @@ -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 = {