From 8fd975270a0049367ae73b6def3c0c9b011f79eb Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 15 Apr 2023 14:23:33 +0200 Subject: [PATCH] Update macOS build instructions & fix release artifacts (#4545) --- .github/workflows/build.yml | 13 +++++++++++- BUILDING_ON_MAC.md | 40 ++++++++++++++++++------------------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 530dc5de5..b786a4157 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -359,52 +359,63 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # allows for tags access + - uses: actions/download-artifact@v3 + name: Windows Qt5.15.2 with: name: chatterino-windows-x86-64-Qt-5.15.2.zip path: release-artifacts/ - uses: actions/download-artifact@v3 + name: Windows Qt5.15 symbols with: name: chatterino-windows-x86-64-Qt-5.15.2-symbols.pdb.7z path: release-artifacts/ - uses: actions/download-artifact@v3 + name: Windows Qt6.5.0 with: - name: chatterino-windows-x86-Qt-64-6.5.0.zip + name: chatterino-windows-x86-64-Qt-6.5.0.zip path: release-artifacts/ - uses: actions/download-artifact@v3 + name: Windows Qt6.5.0 symbols with: name: chatterino-windows-x86-64-Qt-6.5.0-symbols.pdb.7z path: release-artifacts/ - uses: actions/download-artifact@v3 + name: Linux Qt5.12.12 AppImage with: name: Chatterino-x86_64-5.12.12.AppImage path: release-artifacts/ - uses: actions/download-artifact@v3 + name: Ubuntu 20.04 Qt5.12.12 deb with: name: Chatterino-ubuntu-20.04-Qt-5.12.12.deb path: release-artifacts/ - uses: actions/download-artifact@v3 + name: Ubuntu 22.04 Qt5.15.2 deb with: name: Chatterino-ubuntu-22.04-Qt-5.15.2.deb path: release-artifacts/ - uses: actions/download-artifact@v3 + name: Ubuntu 22.04 Qt6.2.4 deb with: name: Chatterino-ubuntu-22.04-Qt-6.2.4.deb path: release-artifacts/ - uses: actions/download-artifact@v3 + name: macOS x86_64 Qt5.15.2 dmg with: name: chatterino-osx-Qt-5.15.2.dmg path: release-artifacts/ - uses: actions/download-artifact@v3 + name: macOS x86_64 Qt6.5.0 dmg with: name: chatterino-osx-Qt-6.5.0.dmg path: release-artifacts/ diff --git a/BUILDING_ON_MAC.md b/BUILDING_ON_MAC.md index cedfc5c0e..53e29cac6 100644 --- a/BUILDING_ON_MAC.md +++ b/BUILDING_ON_MAC.md @@ -1,32 +1,32 @@ # Building on macOS -#### Note - If you want to develop Chatterino 2 you might also want to install Qt Creator (make sure to install **Qt 5.12 or newer**), it is not required though and any C++ IDE (might require additional setup for cmake to find Qt libraries) or a normal text editor + running cmake from terminal should work as well +Chatterino2 is built in CI on Intel on macOS 12. +Local dev machines for testing are available on Apple Silicon on macOS 13. -#### Note - Chatterino 2 is only tested on macOS 10.14 and above - anything below that is considered unsupported. It may or may not work on earlier versions +## Installing dependencies 1. Install Xcode and Xcode Command Line Utilities 1. Start Xcode, go into Settings -> Locations, and activate your Command Line Tools -1. Install brew https://brew.sh/ -1. Install the dependencies using `brew install boost openssl rapidjson cmake` -1. Install Qt5 using `brew install qt@5` -1. (_OPTIONAL_) Install [ccache](https://ccache.dev) (used to speed up compilation by using cached results from previous builds) using `brew install ccache` -1. Go into the project directory -1. Create a build folder and go into it (`mkdir build && cd build`) -1. Compile using `cmake .. && make` +1. Install [Homebrew](https://brew.sh/#install) + We use this for dependency management on macOS +1. Install all dependencies: + `brew install boost openssl@1.1 rapidjson cmake qt@5` -If the Project does not build at this point, you might need to add additional Paths/Libs, because brew does not install openssl and boost in the common path. You can get their path using +## Building -`brew info openssl` -`brew info boost` +### Building from terminal -If brew doesn't link OpenSSL properly then you should be able to link it yourself by using these two commands: +1. Open a terminal +1. Go to the project directory where you cloned Chatterino2 & its submodules +1. Create a build directory and go into it: + `mkdir build && cd build` +1. Run cmake: + `cmake -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt@5 -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@1.1 ..` +1. Build: + `make` -- `ln -s /usr/local/opt/openssl/lib/* /usr/local/lib` -- `ln -s /usr/local/opt/openssl/include/openssl /usr/local/include/openssl` +Your binary can now be found under bin/chatterino.app/Contents/MacOS/chatterino directory -The lines which you need to add to your project file should look similar to this +### Other building methods -``` -INCLUDEPATH += /usr/local/opt/openssl/include -LIBS += -L/usr/local/opt/openssl/lib -``` +You can achieve similar results by using an IDE like Qt Creator, although this is undocumented but if you know the IDE you should have no problems applying the terminal instructions to your IDE.