coqPackages.mkCoqDerivation: move env variables into env for structuredAttrs

This commit is contained in:
Stefan Frijters 2026-02-19 17:04:41 +01:00
commit 8ad58c00a8
No known key found for this signature in database
GPG key ID: 7619A6BC6E7DFA6F

View file

@ -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";