2022-01-03 16:56:52 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, runCommand }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "elvish";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "0.18.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
subPackages = [ "cmd/elvish" ];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X src.elv.sh/pkg/buildinfo.Version==${version}" "-X src.elv.sh/pkg/buildinfo.Reproducible=true" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "elves";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-AyTkJiNebpq17vdPluwJBztivezd+c1KAdWFTYYDIFE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
vendorSha256 = "sha256-iuklI7XEQUgZ2ObYRROxyiccZ1JkajK5OJA7hIcpRZQ=";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
strictDeps = true;
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
$out${passthru.shellPath} -c "
|
|
|
|
fn expect {|key expected|
|
|
|
|
var actual = \$buildinfo[\$key]
|
|
|
|
if (not-eq \$actual \$expected) {
|
|
|
|
fail '\$buildinfo['\$key']: expected '(to-string \$expected)', got '(to-string \$actual)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
expect version ${version}
|
|
|
|
expect reproducible \$true
|
|
|
|
"
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A friendly and expressive command shell";
|
|
|
|
longDescription = ''
|
|
|
|
Elvish is a friendly interactive shell and an expressive programming
|
|
|
|
language. It runs on Linux, BSDs, macOS and Windows. Despite its pre-1.0
|
|
|
|
status, it is already suitable for most daily interactive use.
|
|
|
|
'';
|
|
|
|
homepage = "https://elv.sh/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ vrthra AndersonTorres ];
|
|
|
|
};
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
passthru.shellPath = "/bin/elvish";
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|