summaryrefslogtreecommitdiff
path: root/pkgs/by-name/re/refine/package.nix
blob: 6445c28e93592986a739d3ecaa3902be59415d7f (about) (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
  lib,
  fetchFromGitLab,
  nix-update-script,
  blueprint-compiler,
  desktop-file-utils,
  libadwaita,
  meson,
  ninja,
  pkg-config,
  wrapGAppsHook4,
  python3,
  libxml2,
  python3Packages,
  libportal,
  libportal-gtk4,
  appstream,
  gtk4,
  glib,
}:

let
  libadwaita' = libadwaita.overrideAttrs (oldAttrs: {
    version = "1.6.2-unstable-2025-01-02";
    src = oldAttrs.src.override {
      tag = null;
      rev = "f5f0e7ce69405846a8f8bdad11cef2e2a7e99010";
      hash = "sha256-n5RbGHtt2g627T/Tg8m3PjYIl9wfYTIcrplq1pdKAXk=";
    };

    # `test-application-window` is flaky on aarch64-linux
    doCheck = false;
  });
in

python3Packages.buildPythonApplication rec {
  pname = "refine";
  version = "0.5.6";
  pyproject = false; # uses meson

  src = fetchFromGitLab {
    domain = "gitlab.gnome.org";
    owner = "TheEvilSkeleton";
    repo = "Refine";
    tag = version;
    hash = "sha256-cIJWTzeLm2YP8Pm/nzcYHIGzBOmQlPe0lQ+b6BufIMg=";
  };

  nativeBuildInputs = [
    appstream
    blueprint-compiler
    glib # For `glib-compile-schemas`
    gtk4 # For `gtk-update-icon-cache`
    meson
    ninja
    pkg-config
    wrapGAppsHook4
    python3
    desktop-file-utils
  ];

  buildInputs = [
    libxml2
    libadwaita'
  ];

  dependencies =
    [
      libportal
      libportal-gtk4
    ]
    ++ (with python3Packages; [
      pygobject3
    ]);

  strictDeps = true;

  mesonFlags = [ (lib.mesonBool "network_tests" false) ];

  dontWrapGApps = true;

  makeWrapperArgs = [ "\${gappsWrapperArgs[@]}" ];

  # NOTE: `postCheck` is intentionally not used here, as the entire checkPhase
  # is skipped by `buildPythonApplication`
  # https://github.com/NixOS/nixpkgs/blob/9d4343b7b27a3e6f08fc22ead568233ff24bbbde/pkgs/development/interpreters/python/mk-python-derivation.nix#L296
  postInstallCheck = ''
    mesonCheckPhase
  '';

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Tweak various aspects of GNOME";
    homepage = "https://gitlab.gnome.org/TheEvilSkeleton/Refine";
    mainProgram = "refine";
    platforms = lib.platforms.linux;
    license = with lib.licenses; [ gpl3Plus ];
    maintainers = with lib.maintainers; [ getchoo ];
  };
}