I’m trying to package rstudio in MacBook Air 2019 with Intel CPU. Using nixos-21.11
packages with few tweaking through overlay
in flake.nix
, I’ve managed to pass through installPhase
with the command nix develop .#pkgs_2111.x86_64-darwin.rstudioWrapper
. However, when I try to nix run .#pkgs_2111.x86_64-darwin.rstudioWrapper
, the following error occurs.
It is complaining that libQt5Core.5.dylib
is in both qtbase
package and rstudio
package. I’ve inspected them with nix-tree
and qtbase
is from qtwebengine
needed by rstudio
. rstudio
itself has libQt5Core.5.dylib
directly.
objc[49639]: Class QMacAutoReleasePoolTracker is implemented in both /nix/store/r2jrhrwr9r1c2x2i06radsgvqqirz3vl-RStudio-1.4.1717/lib/rstudio/RStudio.app/Contents/Frameworks/libQt5Core.5.dylib (0x105cc6ab
8) and /nix/store/rhrhv2dgpb79wcj1rqlmv8nqrnyj6d7p-qtbase-5.12.10/lib/libQt5Core.5.12.10.dylib (0x111cb5ab8). One of the two will be used. Which one is undefined.
objc[49639]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /nix/store/r2jrhrwr9r1c2x2i06radsgvqqirz3vl-RStudio-1.4.1717/lib/rstudio/RStudio.ap
p/Contents/Frameworks/libQt5Core.5.dylib (0x105cc6b30) and /nix/store/rhrhv2dgpb79wcj1rqlmv8nqrnyj6d7p-qtbase-5.12.10/lib/libQt5Core.5.12.10.dylib (0x111cb5b30). One of the two will be used. Which one is
undefined.
objc[49639]: Class KeyValueObserver is implemented in both /nix/store/r2jrhrwr9r1c2x2i06radsgvqqirz3vl-RStudio-1.4.1717/lib/rstudio/RStudio.app/Contents/Frameworks/libQt5Core.5.dylib (0x105cc6b58) and /ni
x/store/rhrhv2dgpb79wcj1rqlmv8nqrnyj6d7p-qtbase-5.12.10/lib/libQt5Core.5.12.10.dylib (0x111cb5b58). One of the two will be used. Which one is undefined.
objc[49639]: Class RunLoopModeTracker is implemented in both /nix/store/r2jrhrwr9r1c2x2i06radsgvqqirz3vl-RStudio-1.4.1717/lib/rstudio/RStudio.app/Contents/Frameworks/libQt5Core.5.dylib (0x105cc6ba8) and /
nix/store/rhrhv2dgpb79wcj1rqlmv8nqrnyj6d7p-qtbase-5.12.10/lib/libQt5Core.5.12.10.dylib (0x111cb5ba8). One of the two will be used. Which one is undefined.
objc[49639]: Class QCocoaPageLayoutDelegate is implemented in both /nix/store/r2jrhrwr9r1c2x2i06radsgvqqirz3vl-RStudio-1.4.1717/lib/rstudio/RStudio.app/Contents/Frameworks/libQt5PrintSupport.5.dylib (0x10
2e70478) and /nix/store/rhrhv2dgpb79wcj1rqlmv8nqrnyj6d7p-qtbase-5.12.10/lib/libQt5PrintSupport.5.12.10.dylib (0x106e01478). One of the two will be used. Which one is undefined.
objc[49639]: Class QCocoaPrintPanelDelegate is implemented in both /nix/store/r2jrhrwr9r1c2x2i06radsgvqqirz3vl-RStudio-1.4.1717/lib/rstudio/RStudio.app/Contents/Frameworks/libQt5PrintSupport.5.dylib (0x10
2e704f0) and /nix/store/rhrhv2dgpb79wcj1rqlmv8nqrnyj6d7p-qtbase-5.12.10/lib/libQt5PrintSupport.5.12.10.dylib (0x106e014f0). One of the two will be used. Which one is undefined.
QObject::moveToThread: Current thread (0x6000031c0070) is not the object's thread (0x6000031c8fc0).
Cannot move to target thread (0x6000031c0070)
You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries
are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: cocoa, minimal, offscreen.
I’ve tried erasing libQt5Core.5.dylib
in rstudio
output with overriden postInstall
phase as follows.
postInstall = old.postInstall + ''
rm -r $out/lib/rstudio/RStudio.app/Contents/Frameworks/{libQt5Core.5.dylib,libQt5PrintSupport.5.dylib}
'';
Then the following error occurs.
dyld[11901]: Library not loaded: '@executable_path/../Frameworks/libQt5PrintSupport.5.dylib'
Referenced from: '/nix/store/py0xap4y2h3mjcy2l7ai9iahi4vljr2n-RStudio-1.4.1717/lib/rstudio/RStudio.app/Contents/MacOS/RStudio'
Reason: tried: '/nix/store/py0xap4y2h3mjcy2l7ai9iahi4vljr2n-RStudio-1.4.1717/lib/rstudio/RStudio.app/Contents/MacOS/../Frameworks/libQt5PrintSupport.5.dylib' (no such file), '/usr/local/lib/libQt5PrintS
upport.5.dylib' (no such file), '/usr/lib/libQt5PrintSupport.5.dylib'
How do I set it so that it only reference libQt5PrintSupport.5.dylib
from rstudio
and not from qtbase
?