gtk/3.x.nix: fix cross-compilation #166219
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently pkgsCross.aarch64-multiplatform.gtk3 fails for a few
reasons:
gtk-doc does not deal well with cross compilation, so we disable
the docs when cross-compiling.
a few of the buildInputs are executed at runtime: gdk-pixbuf,
glib, and (if waylandSupport==true) wayland-scanner, so we move
those to nativeBuildInputs
introspection data is broken for cross-compilation (see gobject-introspection: fix cross-compilation #166199)
so we disable it with -Dintrospection=false.
gtk3's post-install script, build-aux/meson/post-install.py, was
written without any consideration at all for cross-compilation.
So we need to substituteInPlace it in three places and also pass
it a different PKG_CONFIG_PATH.
With this commit, and #166199 I am able to successfully build
pkgsCross.aarch64-multiplatform.gtk3 on an x86_64 host.
Many of the conditionals are written in slightly-nonstandard form (if
.. then null else ...) to ensure that this commit will not cause a
mass-rebuild of all the non-cross-compiled packages that depend on
gtk3.
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notesCurrently pkgsCross.aarch64-multiplatform.gtk3 fails for a few
reasons:
gtk-doc does not deal well with cross compilation, so we disable
the docs when cross-compiling.
a few of the buildInputs are executed at runtime: gdk-pixbuf,
glib, and (if waylandSupport==true) wayland-scanner, so we move
those to nativeBuildInputs
introspection data is broken for cross-compilation (see gobject-introspection: fix cross-compilation #166199)
so we disable it with -Dintrospection=false.
gtk3's post-install script, build-aux/meson/post-install.py, was
written without any consideration at all for cross-compilation.
So we need to substituteInPlace it in three places and also pass
it a different PKG_CONFIG_PATH.
With this commit, and #166199 I am able to successfully build
pkgsCross.aarch64-multiplatform.gtk3 on an x86_64 host.
Many of the conditionals are written in slightly-nonstandard form (if
.. then null else ...) to ensure that this commit will not cause a
mass-rebuild of all the non-cross-compiled packages that depend on
gtk3.