1{ stdenv, lib, buildPythonPackage, isPy3k, fetchFromGitHub, openssl }:
2
3buildPythonPackage rec {
4 pname = "bitcoinlib";
5 version = "0.12.2";
6
7 disabled = !isPy3k;
8
9 src = fetchFromGitHub {
10 owner = "petertodd";
11 repo = "python-bitcoinlib";
12 rev = "refs/tags/python-bitcoinlib-v${version}";
13 hash = "sha256-jfd2Buy6GSCH0ZeccRREC1NmlS6Mq1qtNv/NLNJOsX0=";
14 };
15
16 postPatch = ''
17 substituteInPlace bitcoin/core/key.py --replace \
18 "ctypes.util.find_library('ssl.35') or ctypes.util.find_library('ssl') or ctypes.util.find_library('libeay32')" \
19 "'${lib.getLib openssl}/lib/libssl${stdenv.hostPlatform.extensions.sharedLibrary}'"
20 '';
21
22 pythonImportsCheck = [ "bitcoin" "bitcoin.core.key" ];
23
24 meta = with lib; {
25 homepage = "https://github.com/petertodd/python-bitcoinlib";
26 description = "Easy interface to the Bitcoin data structures and protocol";
27 changelog = "https://github.com/petertodd/python-bitcoinlib/raw/${src.rev}/release-notes.md";
28 license = with licenses; [ lgpl3Plus ];
29 maintainers = with maintainers; [ jb55 ];
30 };
31}