about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/gpib-ctypes/default.nix
blob: 42c07a9ef42181c1df0e119cf611cd25803db88f (plain) (blame)
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
43
44
{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, pytestCheckHook
, linux-gpib
}:

buildPythonPackage rec {
  pname = "gpib-ctypes";
  version = "0.3.0";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    pname = "gpib_ctypes";
    inherit version;
    hash = "sha256-c9l6TNmM4PtbvopnnFi5R1dQ9o3MI39BHHHPSGqfjCY=";
  };

  nativeCheckInputs = [
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace gpib_ctypes/gpib/gpib.py \
      --replace "libgpib.so.0" "${linux-gpib}/lib/libgpib.so.0"
    substituteInPlace setup.py \
      --replace "'pytest-runner'," ""
  '';

  pythonImportsCheck = [
    "gpib_ctypes.gpib"
  ];

  meta = with lib; {
    description = "Cross-platform Python bindings for the NI GPIB and linux-gpib C interfaces";
    homepage = "https://github.com/tivek/gpib_ctypes/";
    changelog = "https://github.com/tivek/gpib_ctypes/blob/${version}/HISTORY.rst";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ fsagbuya ];
  };
}