forked from dapphub/dapptools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
46 lines (41 loc) · 1.33 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ lib, stdenv, fetchFromGitHub, makeWrapper, glibcLocales, solc, nix
, bc, coreutils, curl, ethsign, git, gnused, jq, jshon, nodejs, tre, perl
, gnugrep, hevm, shellcheck, dapptoolsSrc }:
stdenv.mkDerivation rec {
name = "seth-${version}";
version = "0.12.0";
src = ./.;
nativeBuildInputs = [ nodejs makeWrapper shellcheck ];
dontBuild = true;
doCheck = true;
checkTarget = "test";
makeFlags = ["prefix=$(out)"];
postInstall =
let
path = lib.makeBinPath [
bc coreutils curl ethsign git gnused nix jq hevm jshon nodejs tre perl solc
gnugrep
];
in
''
wrapProgram "$out/bin/seth" \
--prefix PATH : ${path} \
--set DAPPTOOLS ${dapptoolsSrc} \
${lib.optionalString (glibcLocales != null) ''
--set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive
''}
'';
# the patching of nodejs shebangs is needed by the seth invocations in
# src/dapp-tests/integration/tests.sh.
# that's also the reason why nodejs is added to nativeBuildInputs
postFixup = ''
patchShebangs $out/libexec/seth
'';
meta = {
description = "Command-line client for talking to Ethereum nodes";
homepage = https://github.com/dapphub/dapptools/src/seth/;
maintainers = [lib.maintainers.dbrock];
license = lib.licenses.gpl3;
inherit version;
};
}