Skip to content

Compiling KVIrc on macOS

ctrlaltca edited this page Mar 5, 2024 · 4 revisions

Up to date steps can be found in the CI build recipe at https://github.com/kvirc/KVIrc/blob/master/.github/workflows/build_macos.yml

  1. Install Homebrew if you haven’t already. This will also install the Xcode Command Line Tools (llvm/clang, make, etc). There’s no need to install Xcode from the App Store.

  2. Install The prerequisites from Homebrew.

    brew install cmake enchant qt@6 openssl@3

  3. Download the KVIrc sourcetree with Git and create a build folder as usual. Git was already installed alongside Homebrew.

  4. Run CMake, telling it where Qt is installed:

    cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt6/ ..

This folder might change in the future, Homebrew tells you where Qt 6 is going to be installed, so just read its output.

  1. Compile and install:

    make install creates an .app bundle in the build folder.

    macdeployqt "build/KVIrc.app" -appstore-compliant is needed to add all the necessary dependencies.

To launch it, double click it. To “install” it, drag it to the Applications folder, but this is not necessary. You can redistribute this bundle to other users and they’ll be able to install it right away. Remember, though, that an .app bundle is actually a folder, so you’ll need to compress it first. Right-clicking it and selecting “Compress” will be enough.

  1. Optional codesign:

On recent macOS you'll need to codesign the application (and its libraries) in order to be able to run it. The following script should take care of that:

find . -iname '*framework' -type d | while read dir; do codesign --force --deep -s - $dir; done find . -iname '*dylib' | while read dir; do codesign --force --deep -s - $dir; done codesign --force --deep -s - KVIrc.app

Please consult https://github.com/kvirc/KVIrc/issues/2529 for more information on the codesign step.