about summary refs log tree commit diff
path: root/pkgs/development/python-modules/vdf/default.nix
blob: 28f08948fce1d65092d74263c3669d565c6ff5c2 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch2,
  mock,
  pytestCheckHook,
  nix-update-script,
}:

buildPythonPackage rec {
  pname = "vdf";
  version = "3.4";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "ValvePython";
    repo = "vdf";
    rev = "refs/tags/v${version}";
    hash = "sha256-6ozglzZZNKDtADkHwxX2Zsnkh6BE8WbcRcC9HkTTgPU=";
  };

  patches = [
    # Support appinfo.vdf v29 (required by protontricks 1.12.0)
    (fetchpatch2 {
      url = "https://github.com/Matoking/vdf/commit/981cad270c2558aeb8eccaf42cfcf9fabbbed199.patch";
      hash = "sha256-kLAbbB0WHjxq4rokLoGTPx43BU44EshteR59Ey9JnXo=";
    })
  ];

  nativeCheckInputs = [
    mock
    pytestCheckHook
  ];

  pythonImportsCheck = [ "vdf" ];

  # Use nix-update-script instead of the default python updater
  # The python updater requires GitHub releases, but vdf only uses tags
  passthru.updateScript = nix-update-script { };

  meta = with lib; {
    description = "Library for working with Valve's VDF text format";
    homepage = "https://github.com/ValvePython/vdf";
    license = licenses.mit;
    maintainers = with maintainers; [ kira-bruneau ];
  };
}