From 5ee69670071f583bdffe2718dc46763fa1698f92 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 7 Aug 2023 07:29:03 +0000 Subject: gtk3: compile schemas even when cross compiling without this applications won't locate gtk3's schemas even if they're on XDG_DATA_DIRS. this patch solves runtime errors of the form: ``` Settings schema 'org.gtk.Settings.FileChooser' is not installed ``` --- pkgs/development/libraries/gtk/3.x.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix index a527faf5a8beb..792f305a83ba6 100644 --- a/pkgs/development/libraries/gtk/3.x.nix +++ b/pkgs/development/libraries/gtk/3.x.nix @@ -24,6 +24,7 @@ , gobject-introspection , buildPackages , withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages +, compileSchemas ? stdenv.hostPlatform.emulatorAvailable buildPackages , fribidi , xorg , libepoxy @@ -110,7 +111,7 @@ stdenv.mkDerivation (finalAttrs: { gtk-doc # For xmllint libxml2 - ] ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + ] ++ lib.optionals ((withIntrospection || compileSchemas) && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ] ++ lib.optionals waylandSupport [ wayland-scanner @@ -183,6 +184,10 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace meson.build \ --replace "x11_enabled = false" "" + # this conditional gates the installation of share/gsettings-schemas/.../glib-2.0/schemas/gschemas.compiled. + substituteInPlace meson.build \ + --replace 'if not meson.is_cross_build()' 'if ${lib.boolToString compileSchemas}' + files=( build-aux/meson/post-install.py demos/gtk-demo/geninclude.py -- cgit 1.4.1