nixpkgs/pkgs/applications/science/logic/elan/default.nix
Benjamin Hipple eb11feaa0b treewide: change fetchCargoTarball default to opt-out
Changes the default fetcher in the Rust Platform to be the newer
`fetchCargoTarball`, and changes every application using the current default to
instead opt out.

This commit does not change any hashes or cause any rebuilds. Once integrated,
we will start deleting the opt-outs and recomputing hashes.

See #79975 for details.
2020-02-13 22:41:37 -08:00

48 lines
1.4 KiB
Nix

{ stdenv, pkgconfig, curl, openssl, zlib, fetchFromGitHub, rustPlatform }:
rustPlatform.buildRustPackage rec {
pname = "elan";
version = "0.7.5";
# Delete this on next update; see #79975 for details
legacyCargoFetcher = true;
cargoSha256 = "0q0xlvyyf88dbz43r7kk9v8rrp6hj0nl5i2i9mg6ibk2gphgdv6v";
src = fetchFromGitHub {
owner = "kha";
repo = "elan";
rev = "v${version}";
sha256 = "1147f3lzr6lgvf580ppspn20bdwnf6l8idh1h5ana0p0lf5a0dn1";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ curl zlib openssl ];
cargoBuildFlags = [ "--features no-self-update" ];
postInstall = ''
pushd $out/bin
mv elan-init elan
for link in lean leanpkg leanchecker; do
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 stdenv.lib; {
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 ];
};
}