qtbase: Fix build for aarch64-darwin#180327
Conversation
|
Some part of the solution was discussed here: #174008 |
|
I've found in GitHub original commit used in homebrew and after applying it and removing |
|
I have a patch to avoid rebuilding the stdenv: diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index 63350cde271..fede4647080 100644
--- a/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -129,9 +129,11 @@ stdenv.mkDerivation {
-e 's|/usr/bin/xcodebuild|xcodebuild|' \
-e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
./configure
- substituteInPlace ./mkspecs/common/mac.conf \
- --replace "/System/Library/Frameworks/OpenGL.framework/" "${OpenGL}/Library/Frameworks/OpenGL.framework/" \
- --replace "/System/Library/Frameworks/AGL.framework/" "${AGL}/Library/Frameworks/AGL.framework/"
+ substituteInPlace ./mkspecs/common/mac.conf \
+ --replace "/System/Library/Frameworks/OpenGL.framework/" "${OpenGL}/Library/Frameworks/OpenGL.framework/" \
+ --replace "/System/Library/Frameworks/AGL.framework/" "${AGL}/Library/Frameworks/AGL.framework/"
+ substituteInPlace ./mkspecs/features/toolchain.prf \
+ --replace "/dev/null" "\$\$(TMP)/qtbase_toolchain_link_test"
'' else lib.optionalString libGLSupported ''
sed -i mkspecs/common/linux.conf \
-e "/^QMAKE_INCDIR_OPENGL/ s|$|${libGL.dev or libGL}/include|" \
diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix
index 2e93c672fd9..47dd47aedea 100644
--- a/pkgs/top-level/darwin-packages.nix
+++ b/pkgs/top-level/darwin-packages.nix
@@ -120,10 +120,8 @@ impure-cmds // appleSourcePackages // chooseLibs // {
executable = true;
text = ''
- if [ "$linkerOutput" != "/dev/null" ]; then
- CODESIGN_ALLOCATE=${targetPrefix}codesign_allocate \
- ${self.sigtool}/bin/codesign -f -s - "$linkerOutput"
- fi
+ CODESIGN_ALLOCATE=${targetPrefix}codesign_allocate \
+ ${self.sigtool}/bin/codesign -f -s - "$linkerOutput"
'';
}; |
|
@jiegec I will check this patch and update PR. But AFAIK |
Yes, but that rebuilds the toolchain, and this pr should be moved to target staging branch for that. |
|
So maybe we will move |
|
FYI, the staging cycles recently take around 10 days, so you can expect delay 10--20 days between merging and appearing in |
Have you encountered issues other than qt regarding this change? |
Please do the changes in a clean way even if it triggers a stdenv rebuild. Trying to avoid rebuilds with some hacks is not necessary. |
PR is merged, but for the history - it seems your diff was enough to build qt. I didn't faced with no other issues. |
Description of changes
Trying to fix qtbase build on aarch64-darwin platform. There is 2 issues:
cc <file> -o /dev/nullfails on aarch64-darwin #154203 - issue with codesign on aarch64-darwin. I don't think that changes I suggest is a good solution, it is more workaround.nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
Lines 372 to 376 in 235c1c1
0002-qtbase-mac-arm64.patch.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes