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

harfbuzz: add mingw32 support #273663

Closed

Conversation

seanybaggins
Copy link
Contributor

Description of changes

Adding mingw32 host platform build support for harfbuzz. Depency update needed to add mingw32 build support for qt6. See #272538

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot requested a review from edolstra December 12, 2023 02:51
@seanybaggins seanybaggins changed the title Add mingw32 support harfbuzz harfbuzz: add mingw32 support Dec 12, 2023
@seanybaggins
Copy link
Contributor Author

@edolstra Any chance I can snag a review :)?

@seanybaggins seanybaggins force-pushed the add-mingw32-support-harfbuzz branch from ab64bd1 to 0899577 Compare December 20, 2023 20:47
@seanybaggins seanybaggins force-pushed the add-mingw32-support-harfbuzz branch 2 times, most recently from 3dbbdac to bdb9552 Compare December 26, 2023 18:08
@seanybaggins seanybaggins force-pushed the add-mingw32-support-harfbuzz branch from bdb9552 to 85e203e Compare January 4, 2024 00:11
++ lib.optionals withCoreText [ ApplicationServices CoreText ];

propagatedBuildInputs = lib.optional withGraphite2 graphite2
++ lib.optionals withIcu [ icu harfbuzz ];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was also causing a circular dependency when trying to build mingw. Perhaps I should do...

propagateHarfbuzz ? if stdenv.hostplatform.isMinGW then false else true
...
++ lib.optionals withIcu [ icu ]
++ lib.optionals propagateHarfbuzz [ harfbuzz ]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thoughts?

Copy link
Member

@wegank wegank Jan 4, 2024

Choose a reason for hiding this comment

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

It's clear from withIcu ? stdenv.hostPlatform.isMinGW that ICU support is enforced for MinGW (why?), so just pass (withIcu && !stdenv.hostPlatform.isMinGW) here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had trouble getting this to compile without icu.

Copy link
Contributor Author

@seanybaggins seanybaggins Jan 12, 2024

Choose a reason for hiding this comment

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

Added recommended changes

++ lib.optionals withCoreText [ ApplicationServices CoreText ];

propagatedBuildInputs = lib.optional withGraphite2 graphite2
++ lib.optionals withIcu [ icu harfbuzz ];
++ lib.optionals withIcu [ icu ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
++ lib.optionals withIcu [ icu ];
++ lib.optionals withIcu [ icu ]
++ lib.optionals (withIcu && !stdenv.hostPlatform.isMinGW) [ harfbuzz ]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used suggestion

@@ -18,13 +18,14 @@
, ApplicationServices
, CoreText
, withCoreText ? false
, withIcu ? false # recommended by upstream as default, but most don't needed and it's big
, withGraphite2 ? true # it is small and major distros do include it
, withIcu ? if stdenv.hostPlatform.isMinGW then true else false
Copy link
Member

@wegank wegank Jan 4, 2024

Choose a reason for hiding this comment

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

Suggested change
, withIcu ? if stdenv.hostPlatform.isMinGW then true else false
, withIcu ? stdenv.hostPlatform.isMinGW # recommended by upstream as default, but most don't needed and it's big

Copy link
Contributor Author

Choose a reason for hiding this comment

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

used suggestion

, withGraphite2 ? true # it is small and major distros do include it
, withIcu ? if stdenv.hostPlatform.isMinGW then true else false
, withGlib ? lib.meta.availableOn stdenv.hostPlatform glib
, withGraphite2 ? lib.meta.availableOn stdenv.hostPlatform graphite2
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
, withGraphite2 ? lib.meta.availableOn stdenv.hostPlatform graphite2
, withGraphite2 ? lib.meta.availableOn stdenv.hostPlatform graphite2 # it is small and major distros do include it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used suggestion

@wegank
Copy link
Member

wegank commented Jan 11, 2024

Wait, pkgsCross.mingw{32,W64}.harfbuzz build well on master with #280197 and NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 passed. Are most of the changes really needed?

@wegank wegank marked this pull request as draft January 11, 2024 05:24
@seanybaggins seanybaggins force-pushed the add-mingw32-support-harfbuzz branch from 85e203e to 67024cb Compare January 12, 2024 18:46
@seanybaggins
Copy link
Contributor Author

Wait, pkgsCross.mingw{32,W64}.harfbuzz build well on master with #280197 and NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 passed. Are most of the changes really needed?

Oof. I am not sure. My goal is to get this dependency working for qt6.qtbase. I have a hello world application working with the changes here. I may publish my overlays so the community can upstream/improve the packages

@seanybaggins
Copy link
Contributor Author

Closing PR since upstream changes seemed to have implemented this better than I have when I started.

Here is the repo to my overlays that I mentioned in my previous comment.
https://github.com/seanybaggins/qt-package-overalys

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.

3 participants