Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Mar 29, 2022

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
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux cross from x86_64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

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.

@ghost ghost mentioned this pull request Mar 29, 2022
13 tasks
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 #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.
@ghost ghost mentioned this pull request Mar 29, 2022
9 tasks
@ofborg ofborg bot requested review from 7c6f434c, amaxine, dasj19, hedning and jtojnar March 29, 2022 10:31
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Mar 29, 2022
@Mindavi Mindavi added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Mar 29, 2022
@ghost
Copy link
Author

ghost commented Mar 31, 2022

Closed in favor of #148618, which does a much better job.

@ghost ghost closed this Mar 31, 2022
@ghost ghost deleted the gtk3-fix-crosscompile-wayland branch January 23, 2024 06:45
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant