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 mainProgram = "serpent";
29 longDescription = ''
30 Serpent is one of the high-level programming languages used to
31 write Ethereum contracts. The language, as suggested by its name,
32 is designed to be very similar to Python; it is intended to be
33 maximally clean and simple, combining many of the efficiency
34 benefits of a low-level language with ease-of-use in programming
35 style, and at the same time adding special domain-specific
36 features for contract programming.
37 '';
38 homepage = "https://github.com/ethereum/wiki/wiki/Serpent";
39 license = with licenses; [ wtfpl ];
40 maintainers = [ ];
41 platforms = platforms.all;
42 };
43}