Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions pkgs/development/libraries/gtk/3.x.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
, broadwaySupport ? true
, wayland-scanner
, testers
, _experimental-update-script-combinators
, makeHardcodeGsettingsPatch
}:

let
Expand Down Expand Up @@ -179,6 +181,12 @@ stdenv.mkDerivation (finalAttrs: {
# See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
env.NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";

prePatch = ''
substitute ${./patches/3.0-hardcode-gsettings.patch} hardcode-gsettings.patch \
--subst-var-by gtk ${glib.makeSchemaPath "$out" "${finalAttrs.pname}-${finalAttrs.version}"}
patches="$patches $PWD/hardcode-gsettings.patch"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs comment.

'';

postPatch = ''
# See https://github.com/NixOS/nixpkgs/issues/132259
substituteInPlace meson.build \
Expand Down Expand Up @@ -233,11 +241,32 @@ stdenv.mkDerivation (finalAttrs: {
'';

passthru = {
updateScript = gnome.updateScript {
packageName = "gtk+";
attrPath = "gtk3";
freeze = true;
hardcodeGsettingsPatch = makeHardcodeGsettingsPatch {
schemaIdToVariableMapping = {
"org.gtk.Settings.ColorChooser" = "gtk";
"org.gtk.Settings.EmojiChooser" = "gtk";
"org.gtk.Settings.FileChooser" = "gtk";
"org.gtk.Demo" = "gtk";
# Not actually installed.
"org.gtk.exampleapp" = "gtk";
};
inherit (finalAttrs) src;
};

updateScript =
let
updateSource = gnome.updateScript {
packageName = "gtk+";
attrPath = "gtk3";
freeze = true;
};
updatePatch = _experimental-update-script-combinators.copyAttrOutputToFile "gtk3.hardcodeGsettingsPatch" ./patches/3.0-hardcode-gsettings.patch;
in
_experimental-update-script-combinators.sequence [
updateSource
updatePatch
];

tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};

Expand Down
Loading