Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / desktops / gnome / core / gnome-shell-extensions / default.nix
blobcb5feb26e4080fc7642713c6c16ecb138f364388
2   lib,
3   stdenv,
4   fetchurl,
5   meson,
6   ninja,
7   gettext,
8   pkg-config,
9   libgtop,
10   glib,
11   gnome,
12   gnome-menus,
13   substituteAll,
16 stdenv.mkDerivation (finalAttrs: {
17   pname = "gnome-shell-extensions";
18   version = "46.2";
20   src = fetchurl {
21     url = "mirror://gnome/sources/gnome-shell-extensions/${lib.versions.major finalAttrs.version}/gnome-shell-extensions-${finalAttrs.version}.tar.xz";
22     hash = "sha256-1ELp0mklEl/yFaXBNCkElWVTgHQdqvuzejqZ1vDH2G8=";
23   };
25   patches = [
26     (substituteAll {
27       src = ./fix_gmenu.patch;
28       gmenu_path = "${gnome-menus}/lib/girepository-1.0";
29     })
30     (substituteAll {
31       src = ./fix_gtop.patch;
32       gtop_path = "${libgtop}/lib/girepository-1.0";
33     })
34   ];
36   nativeBuildInputs = [
37     meson
38     ninja
39     pkg-config
40     gettext
41     glib
42   ];
44   mesonFlags = [ "-Dextension_set=all" ];
46   preFixup = ''
47     # Since we do not install the schemas to central location,
48     # let’s link them to where extensions installed
49     # through the extension portal would look for them.
50     # Adapted from export-zips.sh in the source.
52     extensiondir=$out/share/gnome-shell/extensions
53     schemadir=${glib.makeSchemaPath "$out" "$name"}
55     for f in $extensiondir/*; do
56       name=$(basename "''${f%%@*}")
57       schema=$schemadir/org.gnome.shell.extensions.$name.gschema.xml
58       schemas_compiled=$schemadir/gschemas.compiled
60       if [[ -f $schema ]]; then
61         mkdir "$f/schemas"
62         ln -s "$schema" "$f/schemas"
63         ln -s "$schemas_compiled" "$f/schemas"
64       fi
65     done
66   '';
68   passthru = {
69     updateScript = gnome.updateScript {
70       packageName = "gnome-shell-extensions";
71       attrPath = "gnome.gnome-shell-extensions";
72     };
73   };
75   meta = with lib; {
76     homepage = "https://gitlab.gnome.org/GNOME/gnome-shell-extensions";
77     description = "Modify and extend GNOME Shell functionality and behavior";
78     maintainers = teams.gnome.members;
79     license = licenses.gpl2Plus;
80     platforms = platforms.linux;
81   };