1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch2,
6 mock,
7 pytestCheckHook,
8 nix-update-script,
9}:
10
11buildPythonPackage rec {
12 pname = "vdf";
13 version = "3.4";
14 format = "setuptools";
15
16 src = fetchFromGitHub {
17 owner = "ValvePython";
18 repo = "vdf";
19 tag = "v${version}";
20 hash = "sha256-6ozglzZZNKDtADkHwxX2Zsnkh6BE8WbcRcC9HkTTgPU=";
21 };
22
23 patches = [
24 # Support appinfo.vdf v29 (required by protontricks 1.12.0)
25 (fetchpatch2 {
26 url = "https://github.com/Matoking/vdf/commit/981cad270c2558aeb8eccaf42cfcf9fabbbed199.patch";
27 hash = "sha256-kLAbbB0WHjxq4rokLoGTPx43BU44EshteR59Ey9JnXo=";
28 })
29 ];
30
31 nativeCheckInputs = [
32 mock
33 pytestCheckHook
34 ];
35
36 pythonImportsCheck = [ "vdf" ];
37
38 # Use nix-update-script instead of the default python updater
39 # The python updater requires GitHub releases, but vdf only uses tags
40 passthru.updateScript = nix-update-script { };
41
42 meta = with lib; {
43 description = "Library for working with Valve's VDF text format";
44 homepage = "https://github.com/ValvePython/vdf";
45 license = licenses.mit;
46 maintainers = with maintainers; [ kira-bruneau ];
47 };
48}