2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, writeText, asttokens
|
2021-01-11 01:01:47 +00:00
|
|
|
, pycryptodome, pytest_xdist, pytestcov, recommonmark, semantic-version, sphinx
|
|
|
|
, sphinx_rtd_theme, pytestrunner }:
|
|
|
|
|
|
|
|
let
|
|
|
|
sample-contract = writeText "example.vy" ''
|
|
|
|
count: int128
|
|
|
|
|
|
|
|
@external
|
|
|
|
def __init__(foo: address):
|
|
|
|
self.count = 1
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "vyper";
|
2021-03-10 09:30:27 +00:00
|
|
|
version = "0.2.11";
|
2021-01-11 01:01:47 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-10 09:30:27 +00:00
|
|
|
sha256 = "e763561a161c35c03b92a0c176096dd9b4c78ab003c2f08324d443f459b3de84";
|
2021-01-11 01:01:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pytestrunner ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'asttokens==' 'asttokens>=' \
|
|
|
|
--replace 'subprocess.check_output("git rev-parse HEAD".split())' "' '" \
|
|
|
|
--replace 'commithash.decode("utf-8").strip()' "'069936fa3fee8646ff362145593128d7ef07da38'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
asttokens
|
|
|
|
pycryptodome
|
|
|
|
semantic-version
|
|
|
|
|
|
|
|
# docs
|
|
|
|
recommonmark
|
|
|
|
sphinx
|
|
|
|
sphinx_rtd_theme
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
$out/bin/vyper "${sample-contract}"
|
|
|
|
'';
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-01-11 01:01:47 +00:00
|
|
|
description = "Pythonic Smart Contract Language for the EVM";
|
|
|
|
homepage = "https://github.com/vyperlang/vyper";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ siraben ];
|
|
|
|
};
|
|
|
|
}
|