Swordfish90 / cool-retro-term

A good looking terminal emulator which mimics the old cathode display...
21.78k stars 837 forks source link

Improve the wiki on Dependencies for Compiling from source on macos #761

Open ad-chaos opened 1 year ago

ad-chaos commented 1 year ago

I don't know what's the best course of action since the wiki is open to the public but editing it directly felt wrong, so here I am instead making an issue instead, lemme know if this is fine to include :)

For some reason I wasn't able to use the dmg from the releases and kept getting hit by errors saying that the binary wasn't signed and such, compiling from source helped.


Dependencies

Let's start by downloading them from the official website: https://qt-project.org/downloads or from homebrew using

brew install qt@5

Then set the appropriate environment variables to your current shell session:

export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" 
export LDFLAGS="-L/opt/homebrew/opt/qt@5/lib" 
export CPPFLAGS="-I/opt/homebrew/opt/qt@5/include" PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig"

Or better yet, just launch a subshell with those environment vars set:

PATH="/opt/homebrew/opt/qt@5/bin:$PATH" LDFLAGS="-L/opt/homebrew/opt/qt@5/lib" CPPFLAGS="-I/opt/homebrew/opt/qt@5/include" PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig" zsh
vballestra-latch commented 1 year ago

HI, I too had to compile from source to get an M1 native binary. I did the same, by installing QT5 from brew and defining the envs... and it works if I run it directly from the generated .app. The I wanted to create a dmg to install it on another mac ... but I get the "unsigned error". I tried signing with a self signed cert (using macdeployqt sign option): macdeployqt cool-retro-term.app -always-overwrite -qmldir=app/qml -dmg -fs=APFS -codesign="MyCert" -sign-for-notarization="MyCert"

but still doesn't work. It refuses to load some QT libs :

Termination Reason:    Namespace DYLD, Code 1 Library missing
Library not loaded: @executable_path/../Frameworks/QtQuickControls2.framework/Versions/5/QtQuickControls2
Referenced from: <8517D06D-D016-39BE-A44D-F78788EC693B> /Users/USER/*/cool-retro-term.app/Contents/MacOS/cool-retro-term
Reason: tried: '/Users/xxx/tmp/cool-retro-term/cool-retro-term.app/Contents/Frameworks/QtQuickControls2.framework/Versions/5/QtQuickControls2' (code signature in <8E2241C8-AF12-35D0-A3BF-F9F15DA6A227> '/Users/xxx/tmp/cool-retro-term/cool-retro-term.app/Contents/Frameworks/QtQuickControls2.framework/Versions/5/QtQuickControls2' not valid for use in process: mapped file has no Team ID and is not a platform binary

Do you know how can I fix this ?

ad-chaos commented 1 year ago

I think you're best option is to compile it from source on that other mac as well (or maybe just install qt on it?), I am not too well versed with creating portable binaries on mac so I am afraid that's probably all I can say.