Archive:

Buidling (archive copy from hackmd)

1️⃣ Prerequisites

🪟 Windows

Install choco

Installing Chocolatey

Install choco packages

Run with Admin privileges from PowerShell:

choco install make cmake mingw wget

Install Go 1.21

Download and install - The Go Programming Language

<aside> ☹️ Actually, there is a script scripts/windows_build_setup.ps1. But it seems to be broken.

</aside>

🐧 Linux

Ubuntu

Install packages

sudo apt install libpcsclite-dev libpcre3-dev build-essential mesa-common-dev libglu1-mesa-dev libssl-dev cmake jq libxcb-xinerama0

Install libssl 1.1 (ubuntu)

# Package obtained from <https://answers.launchpad.net/~ubuntu-security-proposed/+archive/ubuntu/ppa/+build/23606713>
wget <https://answers.launchpad.net/~ubuntu-security-proposed/+archive/ubuntu/ppa/+build/23606713/+files/libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb>

sudo dpkg -i libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb

Install go 1.21

Download and install - The Go Programming Language

Install nvm

curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh> | bash

# Add this to .bashrc
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \\. "$NVM_DIR/nvm.sh" # This loads nvm

Install node.js

# Install LTS version. Last tested v18.16.
nvm install lts/*
nvm alias default lts/*nvm alias default lts/*

# update npm
npm install -g npm@latest

Fedora

Install packages

sudo dnf install pcsc-lite-devel pcre-devel ssl-devel crypto-devel

Install openssl 1.1 dev libs

Openssl 1.1 is not available in Fedora since version 40. Meaning with Fedora 39 you should be fine to install openssl-dev 1.1 with dnf.

sudo dnf install perl-FindBin perl-File-Compare perl-File-Copy perl-Pod-Html
wget [<https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz>](<https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz>)
tar xavf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./config --prefix=$HOME/.local/lib/openssl1.1
make && make install

If the make files complains about any file not found, remember you can find the package that provides it this way: dnf provides '*/File/Copy.pm'

🍏 Apple

Install homebrew

Homebrew

Install required packages

We use Qt 5.15.8 in CI builds. But 5.15.10 is tested to work fine.

brew install cmake pkg-config [email protected] qt@5 jq nvm yarn

Install node.js

After brew install, you need to complete the following steps for installing node.js

# You should create NVM's working directory if it doesn't exist:
mkdir ~/.nvm

# Add the following to your shell profile e.g. ~/.profile or ~/.zshrc:
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \\. "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \\. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

# Install node.js LTS version, last tested is 21.1.0
nvm install lts/* # `nvm install --lts` for some versions
nvm alias default lts/*
# Use the ones below if installing package fileicon fails
# nvm install lts/hydrogen
# nvm alias default lts/hydrogen

# update npm
npm install -g npm@latest

# Install dependency
npm install fileicon
# After nix-shell upgrade; see: github.com/status-im/status-go/pull/4388
brew install coreutils

Install python dependencies

If you’re using python ≥ 3.12, you need to install setuptools manually:

python3 -m pip install setuptools --break-system-packages

Related links:

2️⃣ Install Qt

🪟 Windows , 🐧 Linux

Install Qt 5.15.2 with online installer

Download Qt: Get Qt Online Installer

🐧 Linux (alternative)

On Linux you can use any newer 5.15.x version that’s coming with your system

Ubuntu

sudo apt install qtbase5-dev qt5-qmake qtquickcontrols2-5-dev

Fedora

sudo dnf install qt5-qtbase qt5-qtbase-devel qt5-qtquickcontrols

3️⃣ Configure environment

🪟 Windows

Set QTPATH environment variable to:

C:/Qt/5.15.2/5.15.2

Set QTBASE environment variable to:

C:/Qt/5.15.2

Set QTDIR environment variable to:

C:/Qt/5.15.2/msvc2017_64

Add following paths to PATH:

C:/ProgramData/chocolatey/bin
C:/Qt/5.15.2/msvc2019_64/bin

🐧 Linux

(not needed if you use Qt dev packages coming with your system)

export QTDIR="/path/to/Qt/5.15.2/gcc_64"
export PATH="${QTDIR}/bin:${PATH}"
export LD_LIBRARY_PATH=/path/to/openssl1.1/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=/path/to/openssl1.1/lib:$LIBRARY_PATH

🍏 Apple

# export QTDIR="/path/to/Qt/5.15.2/clang_64" # Use this when installed not with `brew`

# Use this when installed with `brew`
# For x86_64
# export QTDIR="/opt/homebrew/opt/qt@5" 
# For arm64, match with your installed Qt version
export QTDIR="/opt/homebrew/Cellar/qt@5/5.15.13" 

export PATH="${QTDIR}/bin:${PATH}"

Note: in brew the path might be this one instead: /usr/local/opt/qt@5

Set GitHub information (probably in ~/.zshrc)

export GITHUB_USER=<user name>
export GITHUB_TOKEN=<personal access token from github>

4️⃣ Clone the repository

git clone <https://github.com/status-im/status-desktop>
cd status-desktop

5️⃣ Build the project

<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/2d4532bb-de8c-4df8-9f40-78503314d490/Windows_logo_-_2012.svg" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/2d4532bb-de8c-4df8-9f40-78503314d490/Windows_logo_-_2012.svg" width="40px" /> On Windows, all commands should be executed under git bash.

</aside>