about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/hjson/default.nix
blob: 44aa789f0d04306a9e8d19585565ca8c9e83b9b4 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, python
, makeWrapper
}:

buildPythonPackage rec {
  pname = "hjson";
  version = "3.0.2";
  format = "setuptools";

  # N.B. pypi src tarball does not have tests
  src = fetchFromGitHub {
    owner = "hjson";
    repo = "hjson-py";
    rev = "v${version}";
    sha256 = "1jc7j790rcqnhbrfj4lhnz3f6768dc55aij840wmx16jylfqpc2n";
  };

  nativeBuildInputs = [ makeWrapper ];

  pythonImportsCheck = [ "hjson" ];

  postInstall = ''
    rm $out/bin/hjson.cmd
    wrapProgram $out/bin/hjson  \
      --set PYTHONPATH "$PYTHONPATH" \
      --prefix PATH : ${lib.makeBinPath [ python ]}
  '';

  meta = with lib; {
    description = "A user interface for JSON";
    mainProgram = "hjson";
    homepage = "https://github.com/hjson/hjson-py";
    license = licenses.mit;
    maintainers = with maintainers; [ bhipple ];
  };
}