MacOS Building MacOS Binaries

Setup

Install XCode and its command line tools.

Workaround curl certificate issue

This step is optional and only needed if curl fails to validate SSL connections.

curl -k -sSL http://curl.haxx.se/ca/cacert.pem >> cacert.pem
export CURL_CA_BUNDLE=`pwd`/cacert.pem
export SSL_CERT_FILE=`pwd`/cacert.pem

On some older versions of MacOS, you may also need:

git config --global http.sslverify "false"

At least initially.

Setup gtk-osx

Download the latest version of the gtk-osx setup script and run it:

curl -o ~/gtk-osx-setup.sh \
     https://raw.githubusercontent.com/Xpra-org/gtk-osx-build/master/gtk-osx-setup.sh
sh gtk-osx-setup.sh

This will have installed jhbuild in ~/.new_local/bin, so let's add this to our $PATH:

export PATH=$PATH:~/.new_local/bin/
Configure `jhbuild` to use our modules
curl -o ~/.config/jhbuildrc-custom \
     https://raw.githubusercontent.com/Xpra-org/gtk-osx-build/master/jhbuildrc-custom-xpra

Bootstrap:

jhbuild bootstrap-gtk-osx

Optional: install pandoc

Build all the libraries

jhbuild update
SETUPTOOLS_USE_DISTUTILS=stdlib jhbuild build
#some python libraries have to be installed via pip in a jhbuild shell:
jhbuild shell
pip3 install --prefix $JHBUILD_PREFIX packaging
pip3 install --prefix $JHBUILD_PREFIX parsing
pip3 install --prefix $JHBUILD_PREFIX typing_extensions

(building from the 3.1.x branch also requires lz4 and numpy)

Build and Package Xpra

git clone https://github.com/Xpra-org/xpra
cd xpra/packaging/MacOS/
sh ./make-app.sh
sh ./make-DMG.sh

Signing the resulting .app, DMG and PKG images requires setting up certificates.