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

WIP: wxwidgets: fix build on darwin #150908

Closed
wants to merge 3 commits into from
Closed

Conversation

willcohen
Copy link
Contributor

@willcohen willcohen commented Dec 15, 2021

Motivation for this change

darwin packaging depending on wxwidgets fail due to #126101. Rather than forcing all upstream dependencies not needing webkitgtk to exclude it, it may be simpler to exclude here until fixed. Additionally, AVFoundation appears to be needed on my x86 machine to complete a build.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-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.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Dec 15, 2021
@ofborg ofborg bot requested a review from tfmoraes December 15, 2021 23:03
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Dec 15, 2021
@willcohen
Copy link
Contributor Author

@peterhoeg while in some sense the wxGTK30: You cannot enable withWebKit when using withGtk2. failure is irrelevant to darwin and this particular PR since webkit has to be entirely disabled, should webkit be disabled by default for all while #73145 is pending?

@willcohen
Copy link
Contributor Author

Additionally, the reason I only enabled darwin builds on wxGTK30 and not wxGTK31 is that for 3.1, the build fails on my machine with because of

[ "--with-cocoa" "--enable-universal-binaries" "--with-macosx-version-min=10.7" ]
, with --enable-universal-binaries being considered an invalid option, while it worked fine for 3.0.

@@ -7,8 +7,8 @@
, libGLU, libGL
, compat24 ? false, compat26 ? true, unicode ? true
, withGtk2 ? true
, withWebKit ? false, webkitgtk
, AGL, Carbon, Cocoa, Kernel, QTKit
, withWebKit ? !stdenv.isDarwin, webkitgtk # Disable webkitgtk on darwin pending #126101
Copy link
Member

Choose a reason for hiding this comment

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

Actually, the original value was already false, so setting it to !stdenv.isDarwin would enable it on non-darwin. And I don't see any override in all-packages.nix

Suggested change
, withWebKit ? !stdenv.isDarwin, webkitgtk # Disable webkitgtk on darwin pending #126101
, withWebKit ? false, webkitgtk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Does that mean that the original version would be preferable (to modify buildInputs to ++ optional (withWebKit && !stdenv.isDarwin) webkitgtk # Disable webkitgtk on darwin pending #126101)? That way all-packages doesn't need a bunch of darwin overrides for each way it gets called? If so, can update accordingly.

@veprbl
Copy link
Member

veprbl commented Dec 16, 2021

Additionally, the reason I only enabled darwin builds on wxGTK30 and not wxGTK31 is that for 3.1, the build fails on my machine with because of

[ "--with-cocoa" "--enable-universal-binaries" "--with-macosx-version-min=10.7" ]

, with --enable-universal-binaries being considered an invalid option, while it worked fine for 3.0.

Usually autotools only prints warnings on seeing unknown options. What is the error that you see?

@veprbl
Copy link
Member

veprbl commented Dec 16, 2021

Also, just to make sure, you really want wxGTK running on darwin? or wxmac would work for your case too?

@willcohen
Copy link
Contributor Author

Additionally, the reason I only enabled darwin builds on wxGTK30 and not wxGTK31 is that for 3.1, the build fails on my machine with because of

[ "--with-cocoa" "--enable-universal-binaries" "--with-macosx-version-min=10.7" ]

, with --enable-universal-binaries being considered an invalid option, while it worked fine for 3.0.

Usually autotools only prints warnings on seeing unknown options. What is the error that you see?

Error is here:

✗ nix-build $NIXPKGS -A wxGTK31
this derivation will be built:
  /nix/store/92mxyb43xk6gaiibiplyi20rx7q9mpj8-wxwidgets-3.1.4.drv
building '/nix/store/92mxyb43xk6gaiibiplyi20rx7q9mpj8-wxwidgets-3.1.4.drv'...
unpacking sources
unpacking source archive /nix/store/fj73kzws14adlvh6rhibl2mih9c37s82-source
source root is source
patching sources
applying patch /nix/store/nnd4xngbv13436vyf1sckvbw2nhd32i7-fix_assertion_using_hide_in_destroy.diff
patching file src/common/toplvcmn.cpp
Hunk #1 succeeded at 124 (offset 2 lines).
configuring
substituteStream(): WARNING: pattern 'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' doesn't match anything in file 'configure'
fixing libtool script ./src/expat/expat/conftools/ltmain.sh
fixing libtool script ./src/png/ltmain.sh
fixing libtool script ./src/jpeg/ltmain.sh
fixing libtool script ./src/tiff/config/ltmain.sh
configure flags: --disable-dependency-tracking --prefix=/nix/store/c0kwgpiyc1zrflzdg9f86l2y9s08m7wr-wxwidgets-3.1.4 --disable-precomp-headers --enable-mediactrl --disable-compat28 --enable-compat30 --enable-unicode --with-opengl --with-cocoa --enable-universal-binaries --with-macosx-version-min=10.7
configure: error: unrecognized options: --enable-universal-binaries
error: builder for '/nix/store/92mxyb43xk6gaiibiplyi20rx7q9mpj8-wxwidgets-3.1.4.drv' failed with exit code 1;
       last 10 log lines:
       > patching file src/common/toplvcmn.cpp
       > Hunk #1 succeeded at 124 (offset 2 lines).
       > configuring
       > substituteStream(): WARNING: pattern 'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' doesn't match anything in file 'configure'
       > fixing libtool script ./src/expat/expat/conftools/ltmain.sh
       > fixing libtool script ./src/png/ltmain.sh
       > fixing libtool script ./src/jpeg/ltmain.sh
       > fixing libtool script ./src/tiff/config/ltmain.sh
       > configure flags: --disable-dependency-tracking --prefix=/nix/store/c0kwgpiyc1zrflzdg9f86l2y9s08m7wr-wxwidgets-3.1.4 --disable-precomp-headers --enable-mediactrl --disable-compat28 --enable-compat30 --enable-unicode --with-opengl --with-cocoa --enable-universal-binaries --with-macosx-version-min=10.7
       > configure: error: unrecognized options: --enable-universal-binaries
       For full logs, run 'nix log /nix/store/92mxyb43xk6gaiibiplyi20rx7q9mpj8-wxwidgets-3.1.4.drv'.

@willcohen
Copy link
Contributor Author

Also, just to make sure, you really want wxGTK running on darwin? or wxmac would work for your case too?

@veprbl I think I may have missed this very obvious solution before embarking on this workaround. I'm not actually sure that GTK is necessary for the use cases I'm envisioning. I need to test dependencies accordingly, but to your point this entire PR might actually be redundant.

@willcohen willcohen marked this pull request as draft December 16, 2021 18:11
@willcohen willcohen changed the title wxwidgets: fix build on darwin WIP: wxwidgets: fix build on darwin Dec 16, 2021
@veprbl
Copy link
Member

veprbl commented Dec 16, 2021

configure: error: unrecognized options: --enable-universal-binaries

Well, then this option should not passed.

I think I may have missed this very obvious solution before embarking on this workaround. I'm not actually sure that GTK is necessary for the use cases I'm envisioning.

To avoid such confusion, we probably need to add a generic wxWidgets attribute that would point to the one most proliferent implementation on the current platform.

@willcohen
Copy link
Contributor Author

In the interest of not over-complicating something that isn't particularly broken or creating yet more churn over something which probably isn't top of the list for ways to make the ecosystem less confusing for newbies, I'm inclined to simply close this PR and leave it as a bit of keyword-appropriate guidance for someone who finds themselves in a similar situation. wxmac solves all the needs I have!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 11-100 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants