about summary refs log tree commit diff
path: root/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix
blob: e44ffe1ec1d29c9fbbe0281e2fae906634d88cf4 (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
{ stdenv
, lib
, fetchFromGitHub
, meson
, ninja
, pkg-config
, xdg-desktop-portal
, gtk3
, gnome
, gnome-desktop
, glib
, wrapGAppsHook
, gsettings-desktop-schemas
, buildPortalsInGnome ? true
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "xdg-desktop-portal-gtk";
  version = "1.15.1";

  src = fetchFromGitHub {
    owner = "flatpak";
    repo = "xdg-desktop-portal-gtk";
    rev = finalAttrs.version;
    sha256 = "sha256-uXVjKsqoIjqJilJq8ERRzEqGKbkzc+Zl6y+37CAcYro=";
  };

  nativeBuildInputs = [
    meson
    ninja
    pkg-config
    wrapGAppsHook
  ];

  buildInputs = [
    glib
    gtk3
    xdg-desktop-portal
  ] ++ lib.optionals buildPortalsInGnome [
    gsettings-desktop-schemas # settings exposed by settings portal
    gnome-desktop
    gnome.gnome-settings-daemon # schemas needed for settings api (mostly useless now that fonts were moved to g-d-s, just mouse and xsettings)
  ];

  mesonFlags = lib.optionals (!buildPortalsInGnome) [
    "-Dwallpaper=disabled"
    "-Dsettings=disabled"
    "-Dappchooser=disabled"
    "-Dlockdown=disabled"
  ];

  meta = with lib; {
    description = "Desktop integration portals for sandboxed apps";
    maintainers = with maintainers; [ jtojnar ];
    platforms = platforms.linux;
    license = licenses.lgpl21Plus;
  };
})