1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 pytestCheckHook,
7 pytest-asyncio,
8 colorlog,
9 smpp-pdu,
10 pyscard,
11 packaging,
12 gsm0338,
13 bidict,
14 jsonpath-ng,
15 termcolor,
16 pyyaml,
17 pycryptodomex,
18 construct,
19 pyserial,
20 pytlv,
21 cmd2,
22}:
23
24buildPythonPackage {
25 pname = "pysim";
26 version = "unstable-2023-08-13";
27 format = "pyproject";
28
29 src = fetchFromGitHub {
30 owner = "osmocom";
31 repo = "pysim";
32 rev = "09ff0e2b433b7143d5b40b4494744569b805e554";
33 hash = "sha256-7IwIovGR0GcS1bidSqoytmombK6NkLSVAfKB2teW2JU=";
34 };
35
36 postPatch = ''
37 substituteInPlace setup.py --replace 'smpp.pdu @ git+https://github.com/hologram-io/smpp.pdu' 'smpp.pdu'
38 '';
39
40 nativeBuildInputs = [ setuptools ];
41
42 propagatedBuildInputs = [
43 bidict
44 cmd2
45 colorlog
46 construct
47 gsm0338
48 jsonpath-ng
49 packaging
50 pycryptodomex
51 pyscard
52 pyserial
53 pytlv
54 pyyaml
55 smpp-pdu
56 termcolor
57 ];
58
59 nativeCheckInputs = [ pytestCheckHook ];
60
61 pythonImportsCheck = [ "pySim" ];
62
63 meta = with lib; {
64 description = "A python tool to program SIMs / USIMs / ISIMs.";
65 homepage = "https://github.com/osmocom/pysim";
66 license = licenses.gpl2;
67 maintainers = with maintainers; [
68 flokli
69 janik
70 ];
71 };
72}