Building Status Desktop

Building

0. Prerequesites

On windows you can simply run the scripts/windows_build_setup.ps1 script in a PowerShell with Administrator privileges.

Install Chocolatey --> <https://chocolatey.org/install#individual>

Install Make --> <https://community.chocolatey.org/packages/make>

Install cmake --> <https://community.chocolatey.org/packages/cmake>

Install mingw --> <https://community.chocolatey.org/packages/mingw>

Install GNU wget --> <https://community.chocolatey.org/packages/Wget/1.20.3.20190531>

Install Go --> <https://go.dev/doc/install>

On Mac Install brew and run the following commands

# Brew
Install Brew and follow the instructions on <https://brew.sh/>

- brew install cmake
- brew install pkg-config

# Go - (used to build status-go)
- brew install go

# JQ and Node
- brew install jq
- curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh> | bash

 # Then add this to .zshrc
- 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

# finally, run
- nvm install --lts
# or
- nvm install 14
- nvm use 14

# update npm
- npm install -g npm@latest

On Linux Install these dependency first:

# Debian/Ubuntu:
- sudo apt install libpcsclite-dev
- sudo apt install libpcre3-dev
- sudo apt install build-essential
- sudo apt install mesa-common-dev libglu1-mesa-dev
- sudo apt install libssl-dev
- sudo apt install cmake

* Go - (used to build status-go)
Install GO -Follow the instructions in <https://golang.org/doc/install>

* JQ and Node
- sudo apt install jq
- curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh> | bash

# Then 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

# finally, run
- nvm install lts
# or
- nvm install 14
- nvm use 14

# update npm
- npm install -g npm@latest

1. Install QT, and add it to the PATH

IMPORTANT: Due to a bug in version 5.15.0, this project is locked to version 5.14.2. Make sure to select version 5.14.2 when installing Qt via the installer.

Install QT from https://www.qt.io/download-qt-installer and add it to the PATH

# Linux
export PATH=$PATH:/path/to/Qt/5.14.2/gcc_64/bin
export QTDIR="/path/to/Qt/5.14.2/gcc_64"
export PATH="${QTDIR}/bin:${PATH}"

# macos (~/.zshrc)
export PATH=$PATH:/path/to/Qt/5.14.2/clang_64/bin
export QTDIR="/path/to/Qt/5.14.2/clang_64"
export PATH="${QTDIR}/bin:${PATH}"

# On MacOS in addtion to above the below needs to be set
export GITHUB_USER=<user name>
export GITHUB_TOKEN=<personal access token from github>

# Windows
***On Windows***: Ensure that the following env vars point correctly:
- QTDIR --> [PATH_TO_QT installation]/5.14.2/msvc2017_64
- QTBASE --> [PATH_TO_QT installation]
- QTPATH --> [PATH_TO_QT installation]/5.14.2

And add the following bin paths to PATH:
- [PATH_TO_QT installation]/5.14.2/msvc2017_64/bin
- [PATH_TO_QT installation]/Tools/mingw730_64/bin
- [PATH_TO_QT installation]/Tools/CMake_64/bin

2. Clone the repo and build dependencies (Mac, Windows,linux)

Ideally, run these on a Bash terminal rather than Powershell:

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

Note: It might take a while to compile Nim

For more output use make V=1 ....

Use 4 CPU cores with make -j4 ....