1{ lib
2, buildPythonPackage
3, fetchpatch
4, fetchFromGitHub
5, cython
6, nose
7}:
8
9buildPythonPackage rec {
10 pname = "reedsolo";
11 version = "1.5.4";
12
13 # Pypi does not have the tests
14 src = fetchFromGitHub {
15 owner = "tomerfiliba";
16 repo = "reedsolomon";
17 rev = "v${version}";
18 hash = "sha256-GUMdL5HclXxqMYasq9kUE7fCqOkjr1D20wjd/E+xPBk=";
19 };
20
21 patches = [
22 (fetchpatch {
23 # python3.10 compat; https://github.com/tomerfiliba/reedsolomon/pull/38
24 url = "https://github.com/tomerfiliba/reedsolomon/commit/63e5bd9fc3ca503990c212eb2c77c10589e6d6c3.patch";
25 hash = "sha256-47g+jUsJEAyqGnlzRA1oSyc2XFPUOfH0EW+vcOJzsxI=";
26 })
27 ];
28
29 nativeBuildInputs = [ cython ];
30
31 checkInputs = [ nose ];
32 checkPhase = "nosetests";
33
34 meta = with lib; {
35 description = "Pure-python universal errors-and-erasures Reed-Solomon Codec";
36 homepage = "https://github.com/tomerfiliba/reedsolomon";
37 license = licenses.publicDomain;
38 maintainers = with maintainers; [ yorickvp ];
39 };
40}