elvish: rewrite
This commit is contained in:
parent
4dc8a5c2dc
commit
6477d7f0ea
1 changed files with 31 additions and 17 deletions
|
@ -1,30 +1,42 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, runCommand }:
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, runCommand
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
let
|
||||
pname = "elvish";
|
||||
version = "0.19.2";
|
||||
|
||||
subPackages = [ "cmd/elvish" ];
|
||||
|
||||
ldflags = [ "-s" "-w" "-X src.elv.sh/pkg/buildinfo.Version==${version}" ];
|
||||
shellPath = "/bin/elvish";
|
||||
in
|
||||
buildGoModule {
|
||||
inherit pname version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "elves";
|
||||
repo = pname;
|
||||
repo = "elvish";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-eCPJXCgmMvrJ2yVqYgXHXJWb6Ec0sutc91LNs4yRBYk=";
|
||||
hash = "sha256-eCPJXCgmMvrJ2yVqYgXHXJWb6Ec0sutc91LNs4yRBYk=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-VMI20IP1jVkUK3rJm35szaFDfZGEEingUEL/xfVJ1cc=";
|
||||
vendorHash = "sha256-VMI20IP1jVkUK3rJm35szaFDfZGEEingUEL/xfVJ1cc=";
|
||||
|
||||
subPackages = [ "cmd/elvish" ];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X src.elv.sh/pkg/buildinfo.Version==${version}"
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
doCheck = false;
|
||||
|
||||
doCheck = false;
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
$out${passthru.shellPath} -c "
|
||||
$out${shellPath} -c "
|
||||
fn expect {|key expected|
|
||||
var actual = \$buildinfo[\$key]
|
||||
if (not-eq \$actual \$expected) {
|
||||
|
@ -38,17 +50,19 @@ buildGoModule rec {
|
|||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
passthru = {
|
||||
inherit shellPath;
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://elv.sh/";
|
||||
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 ];
|
||||
license = lib.licenses.bsd2;
|
||||
maintainers = with lib.maintainers; [ vrthra AndersonTorres ];
|
||||
};
|
||||
|
||||
passthru.shellPath = "/bin/elvish";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue