1{ stdenv, lib, buildPythonPackage, isPy3k, fetchFromGitHub, openssl }:
2
3let ext = if stdenv.isDarwin then "dylib" else "so";
4in buildPythonPackage rec {
5 pname = "bitcoinlib";
6 version = "0.11.0";
7
8 disabled = !isPy3k;
9
10 src = fetchFromGitHub {
11 owner = "petertodd";
12 repo = "python-bitcoinlib";
13 rev = "python-${pname}-v${version}";
14 sha256 = "0pwypd966zzivb37fvg4l6yr7ihplqnr1jwz9zm3biip7x89bdzm";
15 };
16
17 postPatch = ''
18 substituteInPlace bitcoin/core/key.py --replace \
19 "ctypes.util.find_library('ssl') or 'libeay32'" \
20 "'${openssl.out}/lib/libssl.${ext}'"
21 '';
22
23 meta = {
24 homepage = src.meta.homepage;
25 description = "Easy interface to the Bitcoin data structures and protocol";
26 license = with lib.licenses; [ lgpl3 ];
27 maintainers = with lib.maintainers; [ jb55 ];
28 };
29}