summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pysim/default.nix
blob: 741d3171114b6c8f3ba26f583816b052718fa197 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  pytestCheckHook,
  colorlog,
  smpp-pdu,
  pyscard,
  packaging,
  gsm0338,
  bidict,
  jsonpath-ng,
  termcolor,
  pyyaml,
  pycryptodomex,
  construct,
  pyserial,
  pytlv,
  cmd2,
}:

buildPythonPackage {
  pname = "pysim";
  version = "unstable-2023-08-13";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "osmocom";
    repo = "pysim";
    rev = "09ff0e2b433b7143d5b40b4494744569b805e554";
    hash = "sha256-7IwIovGR0GcS1bidSqoytmombK6NkLSVAfKB2teW2JU=";
  };

  postPatch = ''
    substituteInPlace setup.py --replace 'smpp.pdu @ git+https://github.com/hologram-io/smpp.pdu' 'smpp.pdu'
  '';

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    bidict
    cmd2
    colorlog
    construct
    gsm0338
    jsonpath-ng
    packaging
    pycryptodomex
    pyscard
    pyserial
    pytlv
    pyyaml
    smpp-pdu
    termcolor
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "pySim" ];

  meta = {
    description = "Python tool to program SIMs / USIMs / ISIMs";
    homepage = "https://github.com/osmocom/pysim";
    license = lib.licenses.gpl2;
    maintainers = with lib.maintainers; [ flokli ];
  };
}