1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, unittestCheckHook
6}:
7
8buildPythonPackage rec {
9 pname = "bitstring";
10 version = "3.1.9";
11
12 src = fetchFromGitHub {
13 owner = "scott-griffiths";
14 repo = pname;
15 rev = "bitstring-${version}";
16 sha256 = "0y2kcq58psvl038r6dhahhlhp1wjgr5zsms45wyz1naq6ri8x9qa";
17 };
18
19 patches = [
20 (fetchpatch {
21 name = "fix-running-unit-tests-using-unittest-hook.patch";
22 url = "https://github.com/scott-griffiths/bitstring/commit/e5ee3fd41cad2ea761f4450b13b0424ae7262331.patch";
23 hash = "sha256-+ZGywIfQQcYXJlYZBi402ONnysYm66G5zE4duJE40h8=";
24 })
25 ];
26
27 checkInputs = [ unittestCheckHook ];
28
29 unittestFlagsArray = [ "-s" "test" ];
30
31 pythonImportsCheck = [ "bitstring" ];
32
33 meta = with lib; {
34 description = "Module for binary data manipulation";
35 homepage = "https://github.com/scott-griffiths/bitstring";
36 license = licenses.mit;
37 platforms = platforms.unix;
38 maintainers = with maintainers; [ bjornfor ];
39 };
40}