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

Qt4: Fix Darwin build #30238

Merged
merged 1 commit into from Oct 11, 2017
Merged

Qt4: Fix Darwin build #30238

merged 1 commit into from Oct 11, 2017

Conversation

lukeadams
Copy link
Contributor

@lukeadams lukeadams commented Oct 8, 2017

Motivation for this change

This PR fixes qt4 on Darwin. At some point, the qmake-generated installer broke, despite the buildPhase compiling the library correctly. This PR manually copies the files to the required directories on Darwin. I realize this isn't ideal.
I've tested this with qjson, which built and linked with no issue.

Things done
  • installPhase overridden on Darwin
  • enableParallelBuilding on Darwin
  • Tested using sandboxing (relaxed)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

fixes #28385 which has more details and logs on the actual error

@lukeadams lukeadams changed the title Qt4 darwin fix master Qt4: Fix Darwin build Oct 8, 2017
@lukeadams lukeadams mentioned this pull request Oct 9, 2017
8 tasks
@@ -183,10 +183,36 @@ stdenv.mkDerivation rec {
sed -i 's/^\(LIBS[[:space:]]*=.*$\)/\1 -lobjc/' ./src/corelib/Makefile.Release
'';

postInstall =
''
installPhase = optionalString stdenv.isDarwin ''
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be a runHook preInstall here.

Similarly for postInstall at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Oct 9, 2017
@@ -164,7 +164,7 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ perl pkgconfig which ];

enableParallelBuilding = false;
enableParallelBuilding = stdenv.isDarwin;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if we want to enable this since it's only for darwin; I haven't tested to see if it even improves build time.

Copy link
Member

Choose a reason for hiding this comment

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

da91151, might be safer to keep it disabled.

Copy link
Contributor Author

@lukeadams lukeadams Oct 10, 2017

Choose a reason for hiding this comment

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

I'm pretty it still only used one build process with it enabled now that I think about it.
Reverted. Should I rebase? apparently the original commit has a formatting change

Copy link
Member

Choose a reason for hiding this comment

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

yeah, I'll merge and backport this if you squash the commits

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@LnL7 LnL7 merged commit 5e8bd5d into NixOS:master Oct 11, 2017
@LnL7 LnL7 added the 8.has: port to stable A PR already has a backport to the stable release. label Oct 11, 2017
@lukeadams
Copy link
Contributor Author

lukeadams commented Oct 20, 2017

I may need to add fix-darwin-frameworks as a build step to fix potential cf issues.
Currently experiencing problems with pyqt4 segfaulting since qt / python use different cfs since the fixDarwinFrameworks hook only seems to operate on .dylib not contents of .framework

Turns out to just be a configuration issue on my end.

orivej added a commit that referenced this pull request Dec 10, 2017
Since keeping `installPhase = ""` to signify "use the default installPhase" will
be surprising, this deletes the installPhase and rebuilds qt4 on all platforms.

Fixes #30238
@lukeadams lukeadams deleted the qt4-darwin-fix-master branch May 26, 2021 21:49
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 8.has: port to stable A PR already has a backport to the stable release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

qt4 build fails during installPhase [Darwin]
3 participants