summary refs log tree commit diff
path: root/pkgs/os-specific/linux/switcheroo-control/default.nix
blob: 38945c7062210261ee6fc67efbd68cb4e8413e9d (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
54
55
56
57
58
{ lib
, ninja
, meson
, fetchFromGitLab
, systemd
, libgudev
, pkg-config
, glib
, python3
, gobject-introspection
}:

python3.pkgs.buildPythonApplication rec {
  pname = "switcheroo-control";
  version = "2.3";

  format = "other";

  src = fetchFromGitLab {
    domain = "gitlab.freedesktop.org";
    owner = "hadess";
    repo = pname;
    rev = version;
    hash = "sha256-1Pze2TJ9mggfcpiLFwJ7/9WhsdJx4G3GoA7+Z47shuc=";
  };

  nativeBuildInputs = [
    ninja
    meson
    pkg-config

    # needed for glib-compile-resources
    glib
  ];

  buildInputs = [
    systemd
    libgudev
  ];

  propagatedBuildInputs = [
    python3.pkgs.pygobject3
  ];

  mesonFlags = [
    "-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
    "-Dhwdbdir=${placeholder "out"}/etc/udev/hwdb.d"
  ];

  meta = with lib; {
    description = "D-Bus service to check the availability of dual-GPU";
    homepage = "https://gitlab.freedesktop.org/hadess/switcheroo-control/";
    changelog = "https://gitlab.freedesktop.org/hadess/switcheroo-control/-/blob/${version}/NEWS";
    license = licenses.gpl3Plus;
    maintainers = [ ];
    platforms = platforms.linux;
  };
}