elvish: refactor
- move installCheck to passthru.tests - migrate to by-name
This commit is contained in:
@@ -1,13 +1,12 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, buildGoModule
|
, buildGoModule
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, runCommand
|
, callPackage
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
pname = "elvish";
|
pname = "elvish";
|
||||||
version = "0.19.2";
|
version = "0.19.2";
|
||||||
shellPath = "/bin/elvish";
|
|
||||||
in
|
in
|
||||||
buildGoModule {
|
buildGoModule {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
@@ -32,26 +31,12 @@ buildGoModule {
|
|||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
doInstallCheck = true;
|
|
||||||
installCheckPhase = ''
|
|
||||||
runHook preInstallCheck
|
|
||||||
|
|
||||||
$out${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}
|
|
||||||
"
|
|
||||||
|
|
||||||
runHook postInstallCheck
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit shellPath;
|
shellPath = "/bin/elvish";
|
||||||
|
tests = {
|
||||||
|
expectVersion = callPackage ./tests/expect-version.nix { };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
@@ -63,6 +48,6 @@ buildGoModule {
|
|||||||
status, it is already suitable for most daily interactive use.
|
status, it is already suitable for most daily interactive use.
|
||||||
'';
|
'';
|
||||||
license = lib.licenses.bsd2;
|
license = lib.licenses.bsd2;
|
||||||
maintainers = with lib.maintainers; [ vrthra AndersonTorres ];
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
8
pkgs/by-name/el/elvish/tests/expect-version.elv
Normal file
8
pkgs/by-name/el/elvish/tests/expect-version.elv
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
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@
|
||||||
25
pkgs/by-name/el/elvish/tests/expect-version.nix
Normal file
25
pkgs/by-name/el/elvish/tests/expect-version.nix
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, elvish
|
||||||
|
, substituteAll
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "elvish-simple-test";
|
||||||
|
inherit (elvish) version;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ elvish ];
|
||||||
|
|
||||||
|
dontInstall = true;
|
||||||
|
|
||||||
|
buildCommand = ''
|
||||||
|
elvish ${substituteAll {
|
||||||
|
src = ./expect-version.elv;
|
||||||
|
inherit (elvish) version;
|
||||||
|
}}
|
||||||
|
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta.timeout = 10;
|
||||||
|
}
|
||||||
@@ -3749,8 +3749,6 @@ with pkgs;
|
|||||||
|
|
||||||
sedutil = callPackage ../tools/security/sedutil { };
|
sedutil = callPackage ../tools/security/sedutil { };
|
||||||
|
|
||||||
elvish = callPackage ../shells/elvish { };
|
|
||||||
|
|
||||||
emplace = callPackage ../tools/package-management/emplace { };
|
emplace = callPackage ../tools/package-management/emplace { };
|
||||||
|
|
||||||
enchive = callPackage ../tools/security/enchive { };
|
enchive = callPackage ../tools/security/enchive { };
|
||||||
|
|||||||
Reference in New Issue
Block a user