From 8ad58c00a89c33ff240651788e27d2e3296d140f Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Thu, 19 Feb 2026 17:04:41 +0100 Subject: [PATCH] coqPackages.mkCoqDerivation: move env variables into env for structuredAttrs --- pkgs/build-support/coq/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/coq/default.nix b/pkgs/build-support/coq/default.nix index 33305b6dd1a0..3c9670f4f65e 100644 --- a/pkgs/build-support/coq/default.nix +++ b/pkgs/build-support/coq/default.nix @@ -98,6 +98,7 @@ let "dropAttrs" "dropDerivationAttrs" "keepAttrs" + "env" ] ++ dropAttrs ) keepAttrs; @@ -162,8 +163,8 @@ let "COQPLUGININSTALL=$(OCAMLFIND_DESTDIR)" ]; docdir-flags = [ "COQDOCINSTALL=$(out)/share/coq/${coq.coq-version}/user-contrib" ]; + COQUSERCONTRIB = "$out/lib/coq/${coq.coq-version}/user-contrib"; in - stdenv.mkDerivation ( removeAttrs ( { @@ -187,6 +188,15 @@ stdenv.mkDerivation ( args.overrideBuildInputs or ([ coq ] ++ (args.buildInputs or [ ]) ++ extraBuildInputs); inherit enableParallelBuilding; + env = + optionalAttrs setCOQBIN { + COQBIN = "${coq}/bin/"; + } + // optionalAttrs (args ? useMelquiondRemake) { + inherit COQUSERCONTRIB; + } + // (args.env or { }); + meta = ( { @@ -208,7 +218,6 @@ stdenv.mkDerivation ( // (args.meta or { }); } - // (optionalAttrs setCOQBIN { COQBIN = "${coq}/bin/"; }) // (optionalAttrs (!args ? installPhase && !args ? useMelquiondRemake) { installFlags = coqlib-flags ++ docdir-flags ++ extraInstallFlags; }) @@ -226,8 +235,7 @@ stdenv.mkDerivation ( runHook postInstall ''; }) - // (optionalAttrs (args ? useMelquiondRemake) rec { - COQUSERCONTRIB = "$out/lib/coq/${coq.coq-version}/user-contrib"; + // (optionalAttrs (args ? useMelquiondRemake) { preConfigurePhases = [ "autoconf" ]; configureFlags = [ "--libdir=${COQUSERCONTRIB}/${useMelquiondRemake.logpath or ""}" ]; buildPhase = "./remake -j$NIX_BUILD_CORES";