btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / gs / gsettings-desktop-schemas / package.nix
blobeae3d40569a93c7329b5348f4c7e7b91809f01a5
1 { lib, stdenv
2 , fetchurl
3 , pkg-config
4 , glib
5 , gobject-introspection
6 , buildPackages
7 , withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
8 , meson
9 , ninja
10   # just for passthru
11 , gnome
14 stdenv.mkDerivation rec {
15   pname = "gsettings-desktop-schemas";
16   version = "47.1";
18   src = fetchurl {
19     url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz";
20     hash = "sha256-pgIE2cnAobJk1tDRNKODQLpfxgdqNLhNqUXYv8x6KBU=";
21   };
23   strictDeps = true;
24   depsBuildBuild = [ pkg-config ];
25   nativeBuildInputs = [
26     glib
27     meson
28     ninja
29     pkg-config
30   ] ++ lib.optionals withIntrospection [
31     gobject-introspection
32   ];
34   mesonFlags = [
35     (lib.mesonBool "introspection" withIntrospection)
36   ];
38   preInstall = ''
39     # Meson installs the schemas to share/glib-2.0/schemas
40     # We add the override file there too so it will be compiled and later moved by
41     # glib's setup hook.
42     mkdir -p $out/share/glib-2.0/schemas
43     cat - > $out/share/glib-2.0/schemas/remove-backgrounds.gschema.override <<- EOF
44       # These paths are supposed to refer to gnome-backgrounds
45       # but since we do not use FHS, they are broken.
46       # And we do not want to hardcode the correct paths
47       # since then every GTK app would pull in gnome-backgrounds.
48       # Let’s just override the broken paths so that people are not confused.
49       [org.gnome.desktop.background]
50       picture-uri='''
51       picture-uri-dark='''
53       [org.gnome.desktop.screensaver]
54       picture-uri='''
55     EOF
56   '';
58   passthru = {
59     updateScript = gnome.updateScript {
60       packageName = pname;
61     };
62   };
64   meta = with lib; {
65     homepage = "https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas";
66     description = "Collection of GSettings schemas for settings shared by various components of a desktop";
67     license = licenses.lgpl21Plus;
68     maintainers = teams.gnome.members;
69   };