nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 fetchurl,
3 fetchpatch,
4 replaceVars,
5 lib,
6 stdenv,
7 docutils,
8 meson,
9 ninja,
10 pkg-config,
11 gnome,
12 json-glib,
13 gettext,
14 libsecret,
15 python3,
16 polkit,
17 networkmanager,
18 gi-docgen,
19 at-spi2-core,
20 unzip,
21 shared-mime-info,
22 libgweather,
23 libjxl,
24 librsvg,
25 webp-pixbuf-loader,
26 geoclue2,
27 desktop-file-utils,
28 libpulseaudio,
29 libical,
30 gobject-introspection,
31 wrapGAppsHook4,
32 libxslt,
33 gcr_4,
34 accountsservice,
35 gdk-pixbuf,
36 gdm,
37 upower,
38 ibus,
39 libnma-gtk4,
40 gnome-desktop,
41 gsettings-desktop-schemas,
42 gnome-keyring,
43 glib,
44 gjs,
45 mutter,
46 evolution-data-server-gtk4,
47 gtk4,
48 libadwaita,
49 sassc,
50 systemd,
51 pipewire,
52 gst_all_1,
53 adwaita-icon-theme,
54 glycin-loaders,
55 gnome-bluetooth,
56 gnome-clocks,
57 gnome-settings-daemon,
58 gnome-autoar,
59 gnome-tecla,
60 bash-completion,
61 lcms2,
62 libgbm,
63 libGL,
64 libXi,
65 libX11,
66 libxkbcommon,
67 libsoup_3,
68 libxml2,
69}:
70
71let
72 pythonEnv = python3.withPackages (ps: with ps; [ pygobject3 ]);
73in
74stdenv.mkDerivation (finalAttrs: {
75 pname = "gnome-shell";
76 version = "49.3";
77
78 outputs = [
79 "out"
80 "devdoc"
81 ];
82
83 src = fetchurl {
84 url = "mirror://gnome/sources/gnome-shell/${lib.versions.major finalAttrs.version}/gnome-shell-${finalAttrs.version}.tar.xz";
85 hash = "sha256-KPDb1kRS8AVxKfImdTyV0nJt4H8fX0c63cfDxQem0xo=";
86 };
87
88 patches = [
89 # Hardcode paths to various dependencies so that they can be found at runtime.
90 (replaceVars ./fix-paths.patch {
91 glib_compile_schemas = "${glib.dev}/bin/glib-compile-schemas";
92 gsettings = "${glib.bin}/bin/gsettings";
93 tecla = "${lib.getBin gnome-tecla}/bin/tecla";
94 unzip = "${lib.getBin unzip}/bin/unzip";
95 })
96
97 # Use absolute path for libshew installation to make our patched gobject-introspection
98 # aware of the location to hardcode in the generated GIR file.
99 ./shew-gir-path.patch
100
101 # Make D-Bus services wrappable.
102 ./wrap-services.patch
103
104 # Fix greeter logo being too big.
105 # https://gitlab.gnome.org/GNOME/gnome-shell/issues/2591
106 # Reverts https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1101
107 ./greeter-logo-size.patch
108
109 # Work around failing fingerprint auth
110 (fetchpatch {
111 url = "https://src.fedoraproject.org/rpms/gnome-shell/raw/dcd112d9708954187e7490564c2229d82ba5326f/f/0001-gdm-Work-around-failing-fingerprint-auth.patch";
112 hash = "sha256-mgXty5HhiwUO1UV3/eDgWtauQKM0cRFQ0U7uocST25s=";
113 })
114
115 # Fix crash when switching to hands-free mode on a bluetooth headset
116 (fetchpatch {
117 name = "fix-bluetooth-handsfree-crash.patch";
118 url = "https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/merge_requests/31.patch";
119 hash = "sha256-jFbItlXT05nnp825R/HvsWDFxAMzL4z36CsxhQ2sEIY=";
120 stripLen = 1;
121 extraPrefix = "subprojects/gvc/";
122 })
123 ];
124
125 nativeBuildInputs = [
126 docutils # for rst2man
127 meson
128 ninja
129 pkg-config
130 gettext
131 gi-docgen
132 wrapGAppsHook4
133 sassc
134 desktop-file-utils
135 libxslt.bin
136 gobject-introspection
137 ];
138
139 buildInputs = [
140 systemd
141 gsettings-desktop-schemas
142 gnome-keyring
143 glib
144 gcr_4
145 accountsservice
146 libsecret
147 polkit
148 gdk-pixbuf
149 librsvg
150 networkmanager
151 gjs
152 mutter
153 libpulseaudio
154 evolution-data-server-gtk4
155 libical
156 gtk4
157 libadwaita
158 gdm
159 geoclue2
160 adwaita-icon-theme
161 gnome-bluetooth
162 gnome-clocks # schemas needed
163 at-spi2-core
164 upower
165 ibus
166 gnome-desktop
167 gnome-settings-daemon
168 lcms2 # required by mutter-clutter
169 libgbm
170 libGL # for egl, required by mutter-clutter
171 libXi # required by libmutter
172 libX11
173 libxkbcommon
174 libsoup_3
175 libxml2
176
177 # recording
178 pipewire
179 gst_all_1.gstreamer
180 gst_all_1.gst-plugins-base
181 gst_all_1.gst-plugins-good
182
183 # not declared at build time, but typelib is needed at runtime
184 libgweather
185 libnma-gtk4
186
187 # for gnome-extension tool
188 bash-completion
189 gnome-autoar
190 json-glib
191
192 # for tools
193 pythonEnv
194 ];
195
196 mesonFlags = [
197 "-Dgtk_doc=true"
198 "-Dtests=false"
199 ];
200
201 postPatch = ''
202 patchShebangs \
203 src/data-to-c.py \
204 build-aux/generate-app-list.py
205
206 # We can generate it ourselves.
207 rm -f man/gnome-shell.1
208 rm data/theme/gnome-shell-{light,dark}.css
209 '';
210
211 preInstall = ''
212 # gnome-shell contains GSettings schema overrides for Mutter.
213 schemadir="$out/share/glib-2.0/schemas"
214 mkdir -p "$schemadir"
215 cp "${glib.getSchemaPath mutter}/org.gnome.mutter.gschema.xml" "$schemadir"
216 '';
217
218 postInstall = ''
219 # Pull in WebP and JXL support for gnome-backgrounds.
220 # In postInstall to run before gappsWrapperArgsHook.
221 export GDK_PIXBUF_MODULE_FILE="${
222 gnome._gdkPixbufCacheBuilder_DO_NOT_USE {
223 extraLoaders = [
224 libjxl
225 librsvg
226 webp-pixbuf-loader
227 ];
228 }
229 }"
230 '';
231
232 preFixup = ''
233 gappsWrapperArgs+=(
234 --prefix XDG_DATA_DIRS : ${
235 lib.makeSearchPath "share" [
236 # Until glib’s xdgmime is patched
237 # Fixes “Failed to load resource:///org/gnome/shell/theme/noise-texture.png: Unrecognized image file format”
238 shared-mime-info
239 # For background images https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4554
240 glycin-loaders
241 ]
242 }
243 )
244 '';
245
246 postFixup = ''
247 # The services need typelibs.
248 for svc in org.gnome.ScreenSaver org.gnome.Shell.Extensions org.gnome.Shell.Notifications org.gnome.Shell.Screencast; do
249 wrapGApp $out/share/gnome-shell/$svc
250 done
251
252 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
253 moveToOutput "share/doc" "$devdoc"
254 '';
255
256 separateDebugInfo = true;
257
258 passthru = {
259 mozillaPlugin = "/lib/mozilla/plugins";
260 updateScript = gnome.updateScript {
261 packageName = "gnome-shell";
262 };
263 };
264
265 meta = {
266 description = "Core user interface for the GNOME 3 desktop";
267 homepage = "https://gitlab.gnome.org/GNOME/gnome-shell";
268 changelog = "https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/${finalAttrs.version}/NEWS?ref_type=tags";
269 license = lib.licenses.gpl2Plus;
270 teams = [ lib.teams.gnome ];
271 platforms = lib.platforms.linux;
272 };
273
274})