-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Hi!
By now I'm figuring out how to integrate simplicity contracts with blockstream apps.
I attempted to build qt app on mac yesterday, but it was unsuccessfull.
Below are the intructions about how to build curent version of project on macOS, which was created together with my colleague.
My colleague has succeed building app macOS 15.1.1, but mine version 15.7.2 failed to build.
The last error which I encountered with on step 8 is the following.

Possible steps to solve a problem:
- update
Build.mdfile - fix AGL removal by Apple (Compilation fails on MacOS 26 due to the upstream removal of AGL azahar-emu/azahar#1188)
(version of qt has to be bumped at least to 6.9.3) - move usage of
getoptutil from/usr/local/opt/gnu-getopt/bin/getoptpath to/usr/bin/getopton M chip macs - specify version of macOS that is suitable for builds
Instruction for building on macOS
Step 1: Install Xcode Command Line Tools
xcode-select --installFollow the prompts to install the command line tools.
Step 2: Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Add Homebrew to your PATH as instructed by the installer.
Step 3: Install Required System Dependencies
brew install cmake ninja pkg-config autoconf automake libtool gnu-sed python3
brew install boost@1.85
brew install libusb hidapi libserialport
brew install gpgme
brew install qt
brew install gnu-getopt
./tools/buildzxing.sh
brew install nlohmann-jsonboost 1.84 isn't available
Note: Boost 1.85 is used as it's the latest versioned formula available in Homebrew. ZXing will be built from source in Step 5.6.
Step 4: Set Up Build Environment
Navigate to the project directory and set environment variables:
cd /path/to/green_qt
export HOST=macos
export ARCH=arm64
export PREFIX=$PWD/depends/$HOST-$ARCH
export PATH=$PREFIX/bin:$PATHStep 5: Build Static Dependencies
Build each dependency in the correct order:
5.1 Build breakpad
./tools/buildbreakpad.sh5.2 Build crashpad
./tools/buildcrashpad.sh5.3 Build libusb
./tools/buildlibusb.sh5.4 Build hidapi
./tools/buildhidapi.sh5.5 Build countly
./tools/buildcountly.sh5.6 Build ZXing
./tools/buildzxing.sh5.7 Build libserialport
./tools/buildlibserialport.sh5.8 Build KDSingleApplication
./tools/buildkdsingleapplication.shStep 6: Build Qt Statically
./tools/buildqt.shThis will download and build Qt 6.8.2 with static linking. This step takes significant time and disk space.
Step 7: Build GDK (Green Development Kit)
First, fix bash syntax issues in the build scripts (macOS uses bash 3.2):
# Fix tools/buildgdk.sh
sed -i '' 's/${BUILDTYPE^}/$(echo $BUILDTYPE | tr '\''[:lower:]'\'' '\''[:upper:]'\'')/g' tools/buildgdk.sh
# Now run buildgdk.sh once to clone the GDK repository
./tools/buildgdk.sh --static
# This will fail but will clone GDK to build/gdk
# Fix GDK's internal build scripts
cd build/gdk
# Fix getopt path for Apple Silicon
sed -i '' 's|GETOPT='\''/usr/local/opt/gnu-getopt/bin/getopt'\''|if [ -f '\''/opt/homebrew/opt/gnu-getopt/bin/getopt'\'' ]; then GETOPT='\''/opt/homebrew/opt/gnu-getopt/bin/getopt'\''; else GETOPT='\''/usr/local/opt/gnu-getopt/bin/getopt'\''; fi|' tools/build.sh
# Fix bash 4+ syntax in GDK internal scripts
sed -i '' 's/${BUILDTYPE^}/$(echo $BUILDTYPE | tr '\''[:lower:]'\'' '\''[:upper:]'\'')/g' tools/build.sh
sed -i '' 's/${BUILDTYPE^}/$(echo $BUILDTYPE | tr '\''[:lower:]'\'' '\''[:upper:]'\'')/g' tools/builddeps.sh
# Fix fall-through case syntax
sed -i '' 's/;&/;;/g' tools/buildlibwally-core.sh
# Fix zlib build issue for macOS Xcode 17
sed -i '' 's/# define fdopen(fd,mode) NULL/\/\* # define fdopen(fd,mode) NULL *\//' tools/builddeps.sh
# Actually, this is already done above in the builddeps.sh file
cd ../..Now build GDK:
./tools/buildgdk.sh --staticexport HOST=macos && export ARCH=arm64 && export PREFIX=$PWD/depends/$HOST-$ARCH && export PATH=$PREFIX/bin:$PATH && ./tools/buildgdk.sh --staticThis will take 15-30 minutes. The build compiles libwally-core, zlib, libevent, openssl, boost, and other dependencies.
Step 8: Configure the Project with CMake
After GDK is successfully built, configure the Qt application:
export HOST=macos
export ARCH=arm64
export PREFIX=$PWD/depends/$HOST-$ARCH
export CMAKE_PREFIX_PATH="/opt/homebrew/opt/boost@1.85:$PREFIX"
qt-cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DGREEN_ENV=Development \
-DGREEN_BUILD_ID=-dev \
-DGREEN_LOG_FILE=dev \
-DGREEN_WAYLAND=OFF \
-DENABLE_SENTRY=OFFNote: The GDK CMake config files should be automatically found in $PREFIX/lib/cmake/gdk after the build completes.
Step 9: Build the Application
cmake --build build --parallel 4Step 10: Run the Application
open build/Blockstream.app