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

qt-{5,6}.qtbase: fix build after Darwin stdenv bump #234900

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 3 additions & 0 deletions pkgs/development/libraries/qt-5/5.15/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ let
./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch

./qtbase.patch.d/0014-aarch64-darwin.patch
] ++ lib.optionals (stdenv.isDarwin && lib.hasPrefix "cctools-llvm" (lib.getName darwin.cctools)) [
# When the Darwin stdenv uses llvm-ranlib, it does not support/need -no_warning_for_no_symbols
./qtbase.patch.d/0015-cctools-llvm-ranlib.patch
] ++ [
./qtbase.patch.d/0003-qtbase-mkspecs.patch
./qtbase.patch.d/0004-qtbase-replace-libdir.patch
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
index 61bea952b2..eb7622974a 100644
--- a/mkspecs/common/mac.conf
+++ b/mkspecs/common/mac.conf
@@ -47,5 +47,5 @@ QMAKE_STRIP = $${CROSS_COMPILE}strip
QMAKE_STRIPFLAGS_LIB += -S -x

QMAKE_AR = $${CROSS_COMPILE}ar cq
-QMAKE_RANLIB = $${CROSS_COMPILE}ranlib -s
+QMAKE_RANLIB = $${CROSS_COMPILE}ranlib
QMAKE_NM = $${CROSS_COMPILE}nm -P
diff --git a/mkspecs/features/mac/no_warn_empty_obj_files.prf b/mkspecs/features/mac/no_warn_empty_obj_files.prf
index 598938ab12..7d75fa566d 100644
--- a/mkspecs/features/mac/no_warn_empty_obj_files.prf
+++ b/mkspecs/features/mac/no_warn_empty_obj_files.prf
@@ -1,7 +1,2 @@
-# Prevent warnings about object files without any symbols. This is a common
-# thing in Qt as we tend to build files unconditionally, and then use ifdefs
-# to compile out parts that are not relevant.
-QMAKE_RANLIB += -no_warning_for_no_symbols
-
# We have to tell 'ar' to not run ranlib by itself
QMAKE_AR += -S
3 changes: 3 additions & 0 deletions pkgs/development/libraries/qt-6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ let
./patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch
./patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch
./patches/0007-qtbase-find-qt-tools-in-QTTOOLSPATH.patch
] ++ lib.optionals (stdenv.isDarwin && lib.hasPrefix "cctools-llvm" (lib.getName darwin.cctools)) [
# When the Darwin stdenv uses llvm-ranlib, it does not support/need -no_warning_for_no_symbols
./patches/0008-qtbase-cctools-llvm-ranlib.patch
];
};
env = callPackage ./qt-env.nix { };
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 1469abf176..b57dbc49e8 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -431,7 +431,7 @@ if(CMAKE_HOST_APPLE AND APPLE)
# We have to tell 'ar' to not run ranlib by itself, by passing the 'S' option
set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> qcS <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qS <TARGET> <LINK_FLAGS> <OBJECTS>")
- set(CMAKE_${lang}_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols <TARGET>")
+ set(CMAKE_${lang}_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
endforeach()
endif()

diff --git a/mkspecs/features/mac/no_warn_empty_obj_files.prf b/mkspecs/features/mac/no_warn_empty_obj_files.prf
index 598938ab12..7d75fa566d 100644
--- a/mkspecs/features/mac/no_warn_empty_obj_files.prf
+++ b/mkspecs/features/mac/no_warn_empty_obj_files.prf
@@ -1,7 +1,2 @@
-# Prevent warnings about object files without any symbols. This is a common
-# thing in Qt as we tend to build files unconditionally, and then use ifdefs
-# to compile out parts that are not relevant.
-QMAKE_RANLIB += -no_warning_for_no_symbols
-
# We have to tell 'ar' to not run ranlib by itself
QMAKE_AR += -S