nixpkgs/pkgs/applications/science/logic/elan/default.nix

45 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, pkg-config, curl, openssl, zlib, fetchFromGitHub, rustPlatform }:
2018-04-10 09:36:12 -07:00
rustPlatform.buildRustPackage rec {
2019-08-31 04:41:23 -07:00
pname = "elan";
2021-01-18 07:20:28 -08:00
version = "0.10.3";
2018-04-10 09:36:12 -07:00
src = fetchFromGitHub {
owner = "kha";
repo = "elan";
rev = "v${version}";
2021-01-18 07:20:28 -08:00
sha256 = "sha256-YkGfuqtvVfPcxJ8UqD5QidcNEy5brTWGEK4fR64Yz70=";
2018-04-10 09:36:12 -07:00
};
2021-01-18 07:20:28 -08:00
cargoSha256 = "sha256-2fYicpoEERwD4OjdpseKQOkDvZlb7NnOZcb6Tu+rQdA=";
nativeBuildInputs = [ pkg-config ];
2018-04-10 09:36:12 -07:00
buildInputs = [ curl zlib openssl ];
cargoBuildFlags = [ "--features no-self-update" ];
postInstall = ''
pushd $out/bin
mv elan-init elan
2020-05-07 06:35:13 -07:00
for link in lean leanpkg leanchecker leanc leanmake; do
2018-04-10 09:36:12 -07:00
ln -s elan $link
done
popd
# tries to create .elan
export HOME=$(mktemp -d)
mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
$out/bin/elan completions bash > "$out/share/bash-completion/completions/elan"
$out/bin/elan completions fish > "$out/share/fish/vendor_completions.d/elan.fish"
$out/bin/elan completions zsh > "$out/share/zsh/site-functions/_elan"
'';
meta = with lib; {
2018-04-10 09:36:12 -07:00
description = "Small tool to manage your installations of the Lean theorem prover";
homepage = "https://github.com/Kha/elan";
license = with licenses; [ asl20 /* or */ mit ];
maintainers = with maintainers; [ gebner ];
};
}