Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtk/3.x.nix: fix cross-compilation #166219

Closed
wants to merge 1 commit into from
Closed

gtk/3.x.nix: fix cross-compilation #166219

wants to merge 1 commit into from

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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant