Skip to content

Commit 4cdfe91

Browse files
committed
add evmd
rm dapp
1 parent 5bd3c38 commit 4cdfe91

File tree

4 files changed

+83
-15
lines changed

4 files changed

+83
-15
lines changed

tests/integration_tests/shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pkgs.mkShell {
88
pkgs.test-env
99
pkgs.poetry
1010
pkgs.solc
11-
# pkgs.evmd
11+
pkgs.evmd
1212
];
1313
shellHook = ''
1414
export TMPDIR=/tmp

tests/nix/default.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import sources.nixpkgs {
77
overlays = [
88
(_: pkgs: {
99
flake-compat = import sources.flake-compat;
10-
dapp = pkgs.dapp;
1110
})
1211
(import "${sources.poetry2nix}/overlay.nix")
1312
(_: pkgs: { test-env = pkgs.callPackage ./testenv.nix { }; })

tests/nix/evm/default.nix

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
lib,
3+
stdenv,
4+
buildGo123Module,
5+
fetchFromGitHub,
6+
rev ? "dirty",
7+
nativeByteOrder ? true, # nativeByteOrder mode will panic on big endian machines
8+
fetchurl,
9+
pkgsStatic,
10+
}:
11+
let
12+
version = "v0.5.0";
13+
pname = "evmd";
14+
15+
# Use static packages for Linux to ensure musl compatibility
16+
buildPackages = if stdenv.isLinux then pkgsStatic else { inherit stdenv buildGo123Module; };
17+
buildStdenv = buildPackages.stdenv;
18+
buildGo123Module' = if stdenv.isLinux then buildPackages.buildGo123Module else buildGo123Module;
19+
20+
tags =
21+
[
22+
"ledger"
23+
"netgo"
24+
"osusergo"
25+
"pebbledb"
26+
]
27+
++ lib.optionals nativeByteOrder [ "nativebyteorder" ]
28+
++ lib.optionals buildStdenv.isLinux [ "muslc" ];
29+
30+
ldflags =
31+
[
32+
"-X github.com/cosmos/cosmos-sdk/version.Name=evmd"
33+
"-X github.com/cosmos/cosmos-sdk/version.AppName=${pname}"
34+
"-X github.com/cosmos/cosmos-sdk/version.Version=${version}"
35+
"-X github.com/cosmos/cosmos-sdk/version.BuildTags=${lib.concatStringsSep "," tags}"
36+
"-X github.com/cosmos/cosmos-sdk/version.Commit=${rev}"
37+
]
38+
++ [
39+
"-w"
40+
"-s"
41+
"-linkmode=external"
42+
]
43+
++ lib.optionals buildStdenv.isLinux [
44+
"-extldflags '-static -lm'"
45+
];
46+
47+
in
48+
buildGo123Module' rec {
49+
inherit
50+
pname
51+
version
52+
tags
53+
ldflags
54+
;
55+
stdenv = buildStdenv;
56+
src = fetchFromGitHub {
57+
owner = "cosmos";
58+
repo = "evm";
59+
rev = "733ea6190eb1be15ed1276ab54f4a8b511ff1c66";
60+
hash = "sha256-mZQhW6CpIUGPj3WWw5v2Zeov1mMnKx+ZqNX3YcFOcVE=";
61+
};
62+
63+
vendorHash = "sha256-IDJHj2e2LBMe0BtwduG7/wLM/C2rRQyIUpbMawJAilk=";
64+
proxyVendor = true;
65+
sourceRoot = "source/evmd";
66+
subPackages = [ "cmd/evmd" ];
67+
CGO_ENABLED = "1";
68+
69+
preBuild = ''
70+
mkdir -p $TMPDIR/lib
71+
export CGO_LDFLAGS="-L$TMPDIR/lib $CGO_LDFLAGS"
72+
'';
73+
74+
doCheck = false;
75+
meta = with lib; {
76+
description = "An EVM compatible framework for blockchain development with the Cosmos SDK";
77+
homepage = "https://github.com/cosmos/evm";
78+
license = licenses.asl20;
79+
mainProgram = "evmd" + buildStdenv.hostPlatform.extensions.executable;
80+
platforms = platforms.all;
81+
};
82+
}

tests/nix/sources.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,5 @@
4646
"type": "tarball",
4747
"url": "https://github.com/nix-community/poetry2nix/archive/d90f9db68a4bda31c346be16dfd8d3263be4547e.tar.gz",
4848
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
49-
},
50-
"dapptools": {
51-
"branch": "master",
52-
"description": "Dapp, Seth, Hevm, and more",
53-
"homepage": "https://dapp.tools",
54-
"owner": "dapphub",
55-
"repo": "dapptools",
56-
"rev": "a782a9dfcbf87756170c975c30e83339a99194b5",
57-
"sha256": "sha256:0fsp4pvip77qjb3yciz2a3224ir8wvbb1snc851fbgmf34q7dqfi",
58-
"type": "tarball",
59-
"url": "https://github.com/dapphub/dapptools/archive/a782a9dfcbf87756170c975c30e83339a99194b5.tar.gz",
60-
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
61-
"version": "hevm/0.49.0"
6249
}
6350
}

0 commit comments

Comments
 (0)