mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
{coq,rocq}Packages.mk{Coq,Rocq}Derivation: move env variables into env for structuredAttrs (#492142)
This commit is contained in:
commit
9195f26f08
2 changed files with 24 additions and 7 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ let
|
|||
"dropAttrs"
|
||||
"dropDerivationAttrs"
|
||||
"keepAttrs"
|
||||
"env"
|
||||
]
|
||||
++ dropAttrs
|
||||
) keepAttrs;
|
||||
|
|
@ -162,6 +163,7 @@ let
|
|||
"COQPLUGININSTALL=$(OCAMLFIND_DESTDIR)"
|
||||
];
|
||||
docdir-flags = [ "COQDOCINSTALL=$(out)/share/coq/${rocq-core.rocq-version}/user-contrib" ];
|
||||
COQUSERCONTRIB = "$out/lib/coq/${rocq-core.rocq-version}/user-contrib";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (
|
||||
|
|
@ -187,6 +189,15 @@ stdenv.mkDerivation (
|
|||
args.overrideBuildInputs or ([ rocq-core ] ++ (args.buildInputs or [ ]) ++ extraBuildInputs);
|
||||
inherit enableParallelBuilding;
|
||||
|
||||
env =
|
||||
optionalAttrs setROCQBIN {
|
||||
ROCQBIN = "${rocq-core}/bin/";
|
||||
}
|
||||
// optionalAttrs (args ? useMelquiondRemake) {
|
||||
inherit COQUSERCONTRIB;
|
||||
}
|
||||
// (args.env or { });
|
||||
|
||||
meta =
|
||||
(
|
||||
{
|
||||
|
|
@ -208,7 +219,6 @@ stdenv.mkDerivation (
|
|||
// (args.meta or { });
|
||||
|
||||
}
|
||||
// (optionalAttrs setROCQBIN { ROCQBIN = "${rocq-core}/bin/"; })
|
||||
// (optionalAttrs (!args ? installPhase && !args ? useMelquiondRemake) {
|
||||
installFlags = rocqlib-flags ++ docdir-flags ++ extraInstallFlags;
|
||||
})
|
||||
|
|
@ -226,8 +236,7 @@ stdenv.mkDerivation (
|
|||
runHook postInstall
|
||||
'';
|
||||
})
|
||||
// (optionalAttrs (args ? useMelquiondRemake) rec {
|
||||
COQUSERCONTRIB = "$out/lib/coq/${rocq-core.rocq-version}/user-contrib";
|
||||
// (optionalAttrs (args ? useMelquiondRemake) {
|
||||
preConfigurePhases = [ "autoconf" ];
|
||||
configureFlags = [ "--libdir=${COQUSERCONTRIB}/${useMelquiondRemake.logpath or ""}" ];
|
||||
buildPhase = "./remake -j$NIX_BUILD_CORES";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue