2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, pkgconfig, curl, openssl, zlib, fetchFromGitHub, rustPlatform }:
|
2018-04-10 17:36:12 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
name = "elan-${version}";
|
2019-03-20 12:33:24 +00:00
|
|
|
version = "0.7.4";
|
2018-04-10 17:36:12 +01:00
|
|
|
|
2018-10-04 15:33:00 +01:00
|
|
|
cargoSha256 = "0vv7kr7rc3lvas7ngp5dp99ajjd5v8k5937ish7zqz1k4970q2f1";
|
2018-04-10 17:36:12 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kha";
|
|
|
|
repo = "elan";
|
|
|
|
rev = "v${version}";
|
2019-03-20 12:33:24 +00:00
|
|
|
sha256 = "0yf8mfgp4l78f5cjq1imh462axaa24jfhn69cgf7prw4jrmw3bch";
|
2018-04-10 17:36:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [ curl zlib openssl ];
|
|
|
|
|
|
|
|
cargoBuildFlags = [ "--features no-self-update" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
pushd $out/bin
|
|
|
|
mv elan-init elan
|
2018-04-11 18:08:22 +01:00
|
|
|
for link in lean leanpkg leanchecker; do
|
2018-04-10 17:36:12 +01: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 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 ];
|
|
|
|
};
|
|
|
|
}
|