about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/cinnamon/cinnamon-settings-daemon/default.nix
blob: 69b08fc64ed997d84842829a498d24c48b11a907 (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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{ fetchFromGitHub
, cinnamon-desktop
, cinnamon-translations
, colord
, glib
, gsettings-desktop-schemas
, gtk3
, lcms2
, libcanberra-gtk3
, libgnomekbd
, libnotify
, libxklavier
, wrapGAppsHook
, pkg-config
, pulseaudio
, lib, stdenv
, systemd
, upower
, dconf
, cups
, polkit
, librsvg
, libwacom
, xf86_input_wacom
, xorg
, fontconfig
, tzdata
, nss
, libgudev
, meson
, ninja
, dbus
, dbus-glib
}:

stdenv.mkDerivation rec {
  pname = "cinnamon-settings-daemon";
  version = "4.8.5";

  /* csd-power-manager.c:50:10: fatal error: csd-power-proxy.h: No such file or directory
   #include "csd-power-proxy.h"
            ^~~~~~~~~~~~~~~~~~~
  compilation terminated. */

  # but this occurs only sometimes, so disabling parallel building
  # also see https://github.com/linuxmint/cinnamon-settings-daemon/issues/248
  enableParallelBuilding = false;

  src = fetchFromGitHub {
    owner = "linuxmint";
    repo = pname;
    rev = version;
    hash = "sha256-PAWVTjGFs8yKXgNQ2ucDnEDS+n7bp2n3lhGl9gHXfdQ=";
  };

  patches = [
    ./csd-backlight-helper-fix.patch
    ./use-sane-install-dir.patch
  ];

  mesonFlags = [ "-Dc_args=-I${glib.dev}/include/gio-unix-2.0" ];

  buildInputs = [
    cinnamon-desktop
    colord
    gtk3
    glib
    gsettings-desktop-schemas
    lcms2
    libcanberra-gtk3
    libgnomekbd
    libnotify
    libxklavier
    pulseaudio
    systemd
    upower
    dconf
    cups
    polkit
    librsvg
    libwacom
    xf86_input_wacom
    xorg.libXext
    xorg.libX11
    xorg.libXi
    xorg.libXtst
    xorg.libXfixes
    fontconfig
    nss
    libgudev
    dbus
    dbus-glib
  ];

  nativeBuildInputs = [
    meson
    ninja
    wrapGAppsHook
    pkg-config
  ];

  outputs = [ "out" "dev" ];

  postPatch = ''
    sed "s|/usr/share/zoneinfo|${tzdata}/share/zoneinfo|g" -i plugins/datetime/system-timezone.h
  '';

  # use locales from cinnamon-translations (not using --localedir because datadir is used)
  postInstall = ''
    ln -s ${cinnamon-translations}/share/locale $out/share/locale
  '';

  # So the polkit policy can reference /run/current-system/sw/bin/cinnamon-settings-daemon/csd-backlight-helper
  postFixup = ''
    mkdir -p $out/bin/cinnamon-settings-daemon
    ln -s $out/libexec/csd-backlight-helper $out/bin/cinnamon-settings-daemon/csd-backlight-helper
  '';

  meta = with lib; {
    homepage = "https://github.com/linuxmint/cinnamon-settings-daemon";
    description = "The settings daemon for the Cinnamon desktop";
    license = licenses.gpl2;
    platforms = platforms.linux;
    maintainers = [ maintainers.mkg20001 ];
  };
}