1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchPypi,
6 wasmer,
7 wasmer-compiler-cranelift,
8 py,
9 pytestCheckHook,
10 pytest-benchmark,
11}:
12
13buildPythonPackage rec {
14 pname = "fastdiff";
15 version = "0.3.0";
16 format = "setuptools";
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "4dfa09c47832a8c040acda3f1f55fc0ab4d666f0e14e6951e6da78d59acd945a";
21 };
22
23 postPatch = ''
24 substituteInPlace setup.py \
25 --replace 'pytest-runner' ""
26 substituteInPlace setup.cfg \
27 --replace "collect_ignore = ['setup.py']" ""
28 '';
29
30 propagatedBuildInputs = [
31 wasmer
32 wasmer-compiler-cranelift
33 ];
34
35 nativeCheckInputs = [
36 py
37 pytestCheckHook
38 pytest-benchmark
39 ];
40
41 pytestFlags = [ "--benchmark-skip" ];
42
43 pythonImportsCheck = [ "fastdiff" ];
44
45 meta = with lib; {
46 description = "Fast native implementation of diff algorithm with a pure Python fallback";
47 homepage = "https://github.com/syrusakbary/fastdiff";
48 license = licenses.mit;
49 maintainers = [ ];
50 # resulting compiled object panics at import
51 broken = stdenv.hostPlatform.is32bit;
52 };
53}