mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
Merge pull request #300012 from mattpolzin/build-idris-path
idris2Packages.buildIdris: better nix-shell support via shellHook
This commit is contained in:
commit
57936619f3
@ -32,28 +32,34 @@ let
|
||||
"idrisLibraries"
|
||||
];
|
||||
|
||||
sharedAttrs = drvAttrs // {
|
||||
pname = ipkgName;
|
||||
inherit version;
|
||||
src = src;
|
||||
nativeBuildInputs = [ idris2 makeWrapper ] ++ attrs.nativeBuildInputs or [];
|
||||
buildInputs = propagatedIdrisLibraries ++ attrs.buildInputs or [];
|
||||
derivation = stdenv.mkDerivation (finalAttrs:
|
||||
drvAttrs // {
|
||||
pname = ipkgName;
|
||||
inherit version;
|
||||
src = src;
|
||||
nativeBuildInputs = [ idris2 makeWrapper ] ++ attrs.nativeBuildInputs or [];
|
||||
buildInputs = propagatedIdrisLibraries ++ attrs.buildInputs or [];
|
||||
|
||||
IDRIS2_PACKAGE_PATH = libDirs;
|
||||
IDRIS2_PACKAGE_PATH = libDirs;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
idris2 --build ${ipkgFileName}
|
||||
runHook postBuild
|
||||
'';
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
idris2 --build ${ipkgFileName}
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit propagatedIdrisLibraries;
|
||||
};
|
||||
};
|
||||
passthru = {
|
||||
inherit propagatedIdrisLibraries;
|
||||
};
|
||||
|
||||
shellHook = ''
|
||||
export IDRIS2_PACKAGE_PATH="${finalAttrs.IDRIS2_PACKAGE_PATH}"
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
in {
|
||||
executable = stdenv.mkDerivation (sharedAttrs // {
|
||||
executable = derivation.overrideAttrs {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
@ -76,11 +82,11 @@ in {
|
||||
fi
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
};
|
||||
|
||||
library = { withSource ? false }:
|
||||
let installCmd = if withSource then "--install-with-src" else "--install";
|
||||
in stdenv.mkDerivation (sharedAttrs // {
|
||||
in derivation.overrideAttrs {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/${libSuffix}
|
||||
@ -88,5 +94,5 @@ in {
|
||||
idris2 ${installCmd} ${ipkgFileName}
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user