Quick start: Run the automated build script from the repository root:
./doc/linux/build.shThe script checks prerequisites, builds dependencies, and compiles the app. If a step fails, run it again to resume. Use ./doc/linux/build.sh --restart to start over.
-
Distro: Ubuntu 22.04+ (or compatible). On Fedora/RHEL use
dnf install libcap-devel(and the dnf equivalent of the packages below). -
Packages (roughly matching
ci/linux-x86_64/setup.sh):sudo apt update sudo apt install -y \ build-essential clang llvm-dev cmake ninja-build git python3 python3-venv python3-pip pkg-config \ libgl1-mesa-dev libfontconfig1-dev libfreetype6-dev \ libcap-dev \ libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev \ libxcb1-dev libxkbcommon-dev libx11-xcb-dev libxcb-glx0-dev libxkbcommon-x11-dev \ libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev \ libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev \ libxcb-render-util0-dev libxcb-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev \ libxkbcommon-dev libxkbcommon-x11-dev libxcb-xinput-dev libxcb-cursor-dev \ libudev-dev libbluetooth-dev bluez libdbus-1-dev libpulse-dev \ libwayland-dev wayland-protocols \ yasm nasm curl ca-certificates wget \ libtool autoconf libcurl4-openssl-dev libclang-dev libssl-dev
-
Rust: Required for GDK build. Install via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh . "$HOME/.cargo/env" rustup install 1.81.0
git clone https://github.com/Blockstream/green_qt.git
cd green_qtRun:
export HOST=linux
export ARCH=x86_64
export PREFIX="$PWD/depends/linux-x86_64"
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
export CMAKE_INSTALL_PREFIX="$PREFIX"You can reuse this layout for local builds.
Important: You must install Qt from the online installer, not from source. QtWebEngine (required by the application) cannot be built statically and must come from the Qt online installer. Since QtWebEngine requires the full Qt installation, you need to install the entire Qt from the online installer.
-
Download the Qt online installer from
https://www.qt.io/download-qt-installer -
Install Qt 6.8.3 for Linux (x86_64), including:
- Qt Quick / Qt Quick Controls 2
- Qt Widgets / Qt Quick Widgets
- Qt XML / Qt Core5Compat
- Qt Bluetooth
- Qt SerialPort
- Qt Multimedia
- Qt WebEngine (extension)
- Qt WebView
- Qt WebChannel
-
Set the Qt installation path and update your environment (adjust the path to match your installation):
export QT_ROOT="$HOME/Qt/6.8.3/gcc_64" export PATH="$QT_ROOT/bin:$PREFIX/bin:$PATH" export CMAKE_PREFIX_PATH="$QT_ROOT:$PREFIX"
If you prefer to build dependencies manually instead of using ./doc/linux/build.sh, run:
rm -rf "$PREFIX"
tools/buildgdk.sh --static
tools/buildbreakpad.sh
tools/buildcrashpad.sh
tools/buildgpgme.sh
tools/buildlibusb.sh
tools/buildhidapi.sh
tools/buildcountly.sh
tools/buildzxing.sh
tools/buildlibserialport.sh --disable-shared
tools/buildkdsingleapplication.sh
tools/buildlwk.sh
tools/buildleveldb.shAll of these install into $PREFIX. This is the slow part; subsequent builds can reuse the same prefix.
For a RelWithDebInfo build, you can run:
qt-cmake -S . -B build \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DGREEN_ENV=Development \
-DGREEN_BUILD_ID="-dev" \
-DGREEN_LOG_FILE=dev \
-DGREEN_WAYLAND=ON \
-DENABLE_SENTRY=OFFThen build:
cmake --build build --parallel 4The resulting binary is:
build/blockstream
Run it directly:
./build/blockstreamNote: You may need to set LD_LIBRARY_PATH at runtime to find Qt libraries:
export LD_LIBRARY_PATH="$QT_ROOT/lib:$LD_LIBRARY_PATH"
./build/blockstream