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

qt58: enable darwin compatibility #24139

Merged
merged 1 commit into from Mar 25, 2017

Conversation

periklis
Copy link
Contributor

@periklis periklis commented Mar 20, 2017

Motivation for this change
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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.

@mention-bot
Copy link

@periklis, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ttuegel, @bjornfor and @orivej to be potential reviewers.

@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Mar 20, 2017
@@ -15,7 +17,8 @@
cups ? null, mysql ? null, postgresql ? null,

# options
mesaSupported, mesa,
mesaSupported ? (!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.

Why would the default value have any difference when mesaSupported is defined in all-packages.nix? And why would you want to disable mesa on Darwin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

afaik, mesa is supported for darwin, but the corresponding mkspecs-libgl.path has to be ported for darwin, too. I assume that the following defs in `mkspecs/common/mac.conf' have to be substituted by the mesa-buildInput:

QMAKE_LIBDIR            =

# sdk.prf will prefix the proper SDK sysroot
QMAKE_INCDIR_OPENGL     = \
    /System/Library/Frameworks/OpenGL.framework/Headers \
    /System/Library/Frameworks/AGL.framework/Headers/

Since this is an issue with all qt-5 releases, i would like to suggest a separate PR. What is your opinion?

Copy link
Member

Choose a reason for hiding this comment

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

mesaSupported and mesaPlatforms are just bad names. On Darwin we do not support mesa itself, but there's the libGL* from the OS that we do support, provided at the same mesa_noglu attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thx for the insights @vcunat . I still propose to re-enable mesa/libGL support in a separate PR for the series of currently maintained qt-5 release. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it seems OK to go without mesa support here for now.

./mkspecs/common/clang-mac.conf
'';
# Note on the above: \x27 is a way if including a single-quote
# character in the sed string arguments.
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a typo in a way if including, but a patch (plus some substituteInPlaces) would be much easier to review and maintain for future Qt releases than this sequence of seds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, i adopted for the start the sed-way, because of it was the natural regex-replace strategy. Does substituteInPlace know regex?

@@ -102,7 +125,7 @@ stdenv.mkDerivation {
-shared
${lib.optionalString developerBuild "-developer-build"}
-accessibility
-rpath
-optimized-qmake
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does this -optimized-qmake come from and what does it do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Afaik this configure option is for cross-compilation, e.g. raspeberry-pi, etc.

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 suspect following reasoning

Shrink the temp directory used for building with qmake.

according to 7a9400d

@@ -155,40 +164,75 @@ stdenv.mkDerivation {
-${lib.optionalString (buildExamples == false) "no"}make examples
-${lib.optionalString (buildTests == false) "no"}make tests
-v
'';
'' + lib.optionalString (!stdenv.isDarwin) ''
-no-rpath
Copy link
Contributor

Choose a reason for hiding this comment

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

You replaced -rpath with -no-rpath.


# Don't move .prl files on darwin because they end up in
# "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent
# use of lndir in the qtbase setup-hook. On Linux, the .prl files
# are in lib, and so do not cause a subsequent recreation of deep
# framework directory trees.
+ lib.optionalString stdenv.isDarwin ''
'' + lib.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.

Why move the quotes around here and 9 lines above?

@@ -266,7 +307,7 @@ stdenv.mkDerivation {
description = "A cross-platform application framework for C++";
license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
maintainers = with maintainers; [ bbenoist qknight ttuegel ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't you like to ensure being notified of future proposed changes to qtbase by listing yourself as a maintainer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@periklis
Copy link
Contributor Author

@orivej Thx again for your time and thorough review. Fyi, this patch is a port of the similar patch for qt-5.6 (7a9400d, intial by @acowley) and porting it by me for qt-5.7 (#23602, #23764). However, atm i ported it to qt-5.7, 5.8 got pushed into staging :)

@periklis periklis force-pushed the topic_qt58_darwin_compatibility branch 3 times, most recently from 5bf2678 to 3181a05 Compare March 22, 2017 14:23
@periklis periklis changed the title [WIP] qt58: enable darwin compatibility qt58: enable darwin compatibility Mar 22, 2017
@periklis
Copy link
Contributor Author

fyi, qt 5.8 does not build with system-libpng anymore, further info QT-Wiki

@periklis periklis force-pushed the topic_qt58_darwin_compatibility branch 4 times, most recently from c6b135f to 89fd0a8 Compare March 24, 2017 07:13
@periklis periklis force-pushed the topic_qt58_darwin_compatibility branch from 89fd0a8 to b97dd5f Compare March 25, 2017 08:48
@ttuegel
Copy link
Member

ttuegel commented Mar 25, 2017

I can't test on macOS myself, but this since this is just a copy of the Qt 5.7 Darwin patches, it looks good enough!

@ttuegel ttuegel merged commit a917289 into NixOS:master Mar 25, 2017
@periklis
Copy link
Contributor Author

@ttuegel i am building this for x86_64-linux and x86_64-darwin on my company's hydra and use it currently myself.

@periklis periklis deleted the topic_qt58_darwin_compatibility branch July 25, 2018 09:22
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants