about summary refs log tree commit diff
path: root/pkgs/by-name/zx/zxpy/package.nix
blob: 1735a6523b0b06d3d11a5ef564d47f330687ea5c (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
45
46
47
48
49
50
51
52
53
{ lib
, python3
, fetchFromGitHub
, fetchpatch
, deterministic-uname
}:

python3.pkgs.buildPythonApplication rec {
  pname = "zxpy";
  version = "1.6.3";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "tusharsadhwani";
    repo = "zxpy";
    rev = version;
    hash = "sha256-/sOLSIqaAUkaAghPqe0Zoq7C8CSKAd61o8ivtjJFcJY=";
  };

  patches = [
    # fix test caused by `uname -p` printing unknown
    # https://github.com/tusharsadhwani/zxpy/pull/53
    (fetchpatch {
      name = "allow-unknown-processor-in-injection-test.patch";
      url = "https://github.com/tusharsadhwani/zxpy/commit/95ad80caddbab82346f60ad80a601258fd1238c9.patch";
      hash = "sha256-iXasOKjWuxNjjTpb0umNMNhbFgBjsu5LsOpTaXllATM=";
    })
  ];

  nativeBuildInputs = [
    python3.pkgs.setuptools
    python3.pkgs.wheel
  ];

  nativeCheckInputs = [
    deterministic-uname
    python3.pkgs.pytestCheckHook
  ];

  preCheck = ''
    export PATH=$out/bin:$PATH
  '';

  pythonImportsCheck = [ "zx" ];

  meta = with lib; {
    description = "Shell scripts made simple";
    homepage = "https://github.com/tusharsadhwani/zxpy";
    license = licenses.mit;
    maintainers = with maintainers; [ figsoda ];
    mainProgram = "zxpy";
  };
}