Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
chatterino2: fix install on macOS #79067
On Darwin/macOS, chatterino2's install phase copies no files into the output.
Additionally, apply a workaround for issue #42893. Otherwise, the installed .app crashes unless qtbase is separately installed in the user's environment.
Motivation for this change
On Darwin/macOS, chatterino2's install phase copies no files into the output. `make install` does not copy chatterino2.app. Copy the .app manually, fixing the installation. With this patch, chatterino2 almost works on macOS. Issue #42893 applies, so to make chatterino2 work, you must install qtbase in your environment. For example: $ nix-env -iA nixpkgs.qt5.qtbase $ open ~/.nix-profile/Applications/chatterino.app
Thanks for pointing this out to me! It looks like that feature has no effect on macOS binaries installed in Applications. I'll look into fixing that.
EDIT: Actually, it looks like wrapQtAppsHook's automatic wrapping is ELF-specific . I'll explicitly call wrapQtApp here as a workaround.
wrapQtAppsHook ignores Mach-O binaries . Additionally, wrapQtAppsHook doesn't look inside $out/Applications , which is where chatterino2 is installed. This means chatterino2 for Darwin/macOS is not wrapped properly, causing the following error when launched: > qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in "" > > This application failed to start because no Qt platform plugin could > be initialized. Reinstalling the application may fix this problem. On macOS, explicitly wrap chatterino2's executable.  pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh line 85  pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh line 76