summary refs log tree commit diff
path: root/modules/packages/xdg-desktop-portal-gtk.nix
blob: cfe48d47019259323513f9012188521b341936ae (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
{
  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
      gsettings-desktop-schemas # settings exposed by settings portal
      #fontconfig
    ]
    ++ 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=enabled"
    "-Dappchooser=enabled"
    "-Dlockdown=disabled"
  ];

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