Merge pull request #247844 from uninsane/pr-gtk-compile-schemasE

This commit is contained in:
Artturi 2023-09-08 04:26:04 +03:00 committed by GitHub
commit 57a51d9968
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -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

View file

@ -1,5 +1,6 @@
{ lib
, stdenv
, buildPackages
, substituteAll
, fetchurl
, pkg-config
@ -7,6 +8,7 @@
, graphene
, gi-docgen
, meson
, mesonEmulatorHook
, ninja
, python3
, makeWrapper
@ -45,6 +47,7 @@
, wayland-scanner
, xineramaSupport ? stdenv.isLinux
, cupsSupport ? stdenv.isLinux
, compileSchemas ? stdenv.hostPlatform.emulatorAvailable buildPackages
, cups
, AppKit
, Cocoa
@ -99,6 +102,8 @@ stdenv.mkDerivation rec {
sassc
gi-docgen
libxml2 # for xmllint
] ++ lib.optionals (compileSchemas && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
] ++ lib.optionals waylandSupport [
wayland-scanner
] ++ setupHooks;
@ -190,6 +195,10 @@ stdenv.mkDerivation rec {
};
postPatch = ''
# 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/gen-demo-header.py
demos/gtk-demo/geninclude.py