Idris2/nix/support.nix
Mathew Polzin 7d33c0438a
Nix buildIdris improvement: precisely target executable (#3330)
* don't assume all .so files are the exectuable

* don't rebuild support or the compiler if only the buildIdris nix function has changed

* fixes to nix buildIdris function
2024-06-25 19:03:54 -05:00

33 lines
755 B
Nix

{ stdenv, lib, overrideSDK, gmp, idris2Version }:
let
stdenv' = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv;
in
stdenv'.mkDerivation rec {
pname = "libidris2_support";
version = idris2Version;
# we don't rebuild Idris when changing the buildIdris nix
# function:
src = with lib.fileset; toSource {
root = ../.;
fileset = difference ../. ../nix/buildIdris.nix;
};
strictDeps = true;
buildInputs = [ gmp ];
makeFlags = [
"PREFIX=$(out)"
] ++ lib.optional stdenv'.isDarwin "OS=";
buildFlags = [ "support" ];
installTargets = "install-support";
postInstall = ''
mv $out/idris2-${version}/lib $out/lib
mv $out/idris2-${version}/support $out/share
rmdir $out/idris2-${version}
'';
}