1{ lib, stdenv, fetchFromGitHub, ... }:
2
3stdenv.mkDerivation {
4 pname = "serpent";
5
6 # I can't find any version numbers, so we're just using the date
7 # of the last commit.
8 version = "2016-03-05";
9
10 src = fetchFromGitHub {
11 owner = "ethereum";
12 repo = "serpent";
13 rev = "51ee60857fe53c871fa916ef66fc1b4255bb9433";
14 sha256 = "1bns9wgn5i1ahj19qx7v1wwdy8ca3q3pigxwznm5nywsw7s7lqxs";
15 };
16
17 postPatch = ''
18 substituteInPlace Makefile --replace 'g++' '${stdenv.cc.targetPrefix}c++'
19 '';
20
21 installPhase = ''
22 mkdir -p $out/bin
23 mv serpent $out/bin
24 '';
25
26 meta = with lib; {
27 description = "Compiler for the Serpent language for Ethereum";
28 longDescription = ''
29 Serpent is one of the high-level programming languages used to
30 write Ethereum contracts. The language, as suggested by its name,
31 is designed to be very similar to Python; it is intended to be
32 maximally clean and simple, combining many of the efficiency
33 benefits of a low-level language with ease-of-use in programming
34 style, and at the same time adding special domain-specific
35 features for contract programming.
36 '';
37 homepage = "https://github.com/ethereum/wiki/wiki/Serpent";
38 license = with licenses; [ wtfpl ];
39 maintainers = with maintainers; [ ];
40 platforms = platforms.all;
41 };
42}