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

qt6, python3Packages.pyqt6: unbreak on darwin #204724

Merged
merged 5 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkgs/development/libraries/qt-6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ let
inherit bison cups harfbuzz libGL dconf gtk3 developerBuild cmake;
inherit (darwin.apple_sdk_11_0.frameworks) AGL AVFoundation AppKit GSS MetalKit;
patches = [
./patches/qtbase-qmake-mkspecs-mac.patch
./patches/qtbase-qmake-pkg-config.patch
./patches/qtbase-tzdir.patch
# Remove symlink check causing build to bail out and fail.
Expand Down
19 changes: 11 additions & 8 deletions pkgs/development/libraries/qt-6/modules/qtbase.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ stdenv.mkDerivation rec {
unixODBCDrivers.psql
unixODBCDrivers.sqlite
unixODBCDrivers.mariadb
] ++ lib.optionals stdenv.isLinux [
util-linux
] ++ lib.optionals systemdSupport [
systemd
] ++ [
] ++ lib.optionals stdenv.isLinux [
util-linux
mtdev
lksctp-tools
libselinux
Expand Down Expand Up @@ -223,8 +222,8 @@ stdenv.mkDerivation rec {
"-DQT_FEATURE_journald=${if systemdSupport then "ON" else "OFF"}"
"-DQT_FEATURE_vulkan=ON"
] ++ lib.optionals stdenv.isDarwin [
# build as a set of dynamic libraries
"-DFEATURE_framework=OFF"
Comment on lines -226 to -227
Copy link
Member

Choose a reason for hiding this comment

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

What's the benefits/implications of building as frameworks?

Copy link
Member Author

Choose a reason for hiding this comment

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

qmake generates erroneous link args (e.g. -lQtNetwork.1) when not building as frameworks on darwin, so I don't have much choice...

# error: 'path' is unavailable: introduced in macOS 10.15
"-DQT_FEATURE_cxx17_filesystem=OFF"
];

NIX_LDFLAGS = toString (lib.optionals stdenv.isDarwin [
Expand Down Expand Up @@ -270,13 +269,17 @@ stdenv.mkDerivation rec {
moveToOutput libexec "$dev"

# fixup .pc file (where to find 'moc' etc.)
sed -i "$dev/lib/pkgconfig/Qt6Core.pc" \
-e "/^bindir=/ c bindir=$dev/bin"
if [ -f "$dev/lib/pkgconfig/Qt6Core.pc" ]; then
sed -i "$dev/lib/pkgconfig/Qt6Core.pc" \
-e "/^bindir=/ c bindir=$dev/bin"
fi

patchShebangs $out $dev

# QTEST_ASSERT and other macros keeps runtime reference to qtbase.dev
substituteInPlace "$dev/include/QtTest/qtestassert.h" --replace "__FILE__" "__BASE_FILE__"
if [ -f "$dev/include/QtTest/qtestassert.h" ]; then
substituteInPlace "$dev/include/QtTest/qtestassert.h" --replace "__FILE__" "__BASE_FILE__"
fi
'';

dontStrip = debugSymbols;
Expand Down
Loading