Skip to content

Commit

Permalink
Merge pull request #204724 from wegank/qtpbfimageplugin
Browse files Browse the repository at this point in the history
qt6, python3Packages.pyqt6: unbreak on darwin
  • Loading branch information
NickCao committed Jan 17, 2023
2 parents aa7e3b9 + 54452b0 commit 9f3998d
Show file tree
Hide file tree
Showing 5 changed files with 485 additions and 16 deletions.
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"
# 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

0 comments on commit 9f3998d

Please sign in to comment.