summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-bitcoinlib/default.nix
blob: 7d85630bb15bcf2726d4fb680f6ebdc0a78a130d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
  stdenv,
  lib,
  buildPythonPackage,
  isPy3k,
  fetchFromGitHub,
  openssl,
}:

buildPythonPackage rec {
  pname = "python-bitcoinlib";
  version = "0.12.2";
  format = "setuptools";

  disabled = !isPy3k;

  src = fetchFromGitHub {
    owner = "petertodd";
    repo = "python-bitcoinlib";
    tag = "python-bitcoinlib-v${version}";
    hash = "sha256-jfd2Buy6GSCH0ZeccRREC1NmlS6Mq1qtNv/NLNJOsX0=";
  };

  postPatch = ''
    substituteInPlace bitcoin/core/key.py --replace \
      "ctypes.util.find_library('ssl.35') or ctypes.util.find_library('ssl') or ctypes.util.find_library('libeay32')" \
      "'${lib.getLib openssl}/lib/libssl${stdenv.hostPlatform.extensions.sharedLibrary}'"
  '';

  pythonImportsCheck = [
    "bitcoin"
    "bitcoin.core.key"
  ];

  meta = {
    homepage = "https://github.com/petertodd/python-bitcoinlib";
    description = "Easy interface to the Bitcoin data structures and protocol";
    changelog = "https://github.com/petertodd/python-bitcoinlib/raw/${src.rev}/release-notes.md";
    license = with lib.licenses; [ lgpl3Plus ];
    maintainers = with lib.maintainers; [ jb55 ];
  };
}