1{ stdenv, lib, buildPythonPackage, isPy3k, fetchFromGitHub, openssl }: 2 3buildPythonPackage rec { 4 pname = "bitcoinlib"; 5 version = "0.11.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 sha256 = "sha256-/VgCTN010W/Svdrs0mGA8W1YZnyTHhcaWJKgP/c8CN8="; 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 '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}