parameters: build_type: '' cmake_flags: '' generation_path: '' steps: - bash: | # Ignore Homebrew uninstall errors ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" || true displayName: 'Uninstall brew' - bash: | sudo mkdir "${{parameters.generation_path}}" sudo chown $USER "${{parameters.generation_path}}" cd "${{parameters.generation_path}}" curl -L -o gtk-bin.tar.gz https://github.com/xournalpp/xournalpp-pipeline-dependencies/raw/macos-10.15-jhbuild/gtk/gtk-bin.tar.gz tar -xzf gtk-bin.tar.gz displayName: 'Unpack GTK' - bash: | curl -L -o libxml.tar.gz https://github.com/xournalpp/xournalpp-pipeline-dependencies/raw/macos-10.15-jhbuild/libxml/libxml.tar.gz sudo tar -xzf libxml.tar.gz -C / enabled: false displayName: 'Unpack libxml' - bash: | mkdir build displayName: 'Create Build Directory' - bash: | # Ninja >= 1.10.0 binaries depend on Catalina or newer, so use 1.9.0 instead. curl -L -o ninja-mac.zip https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-mac.zip # curl -L -o ninja-mac.zip $(curl -s https://api.github.com/repos/ninja-build/ninja/releases/latest | grep "browser_download_url.*mac\.zip" | cut -d : -f 2,3 | tr -d '"') # Fallback to version 1.9.0 if the previous request fails for some reason if [ ! -f ninja-mac.zip ]; then curl -L -o ninja-mac.zip https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-mac.zip fi unzip ninja-mac.zip -d "${{parameters.generation_path}}"/gtk/inst/bin displayName: 'Get Ninja' - bash: | # Lua 5.4 is only supported with cmake >= 3.18, so use Lua 5.3 instead cd "${{parameters.generation_path}}" curl -R -O http://www.lua.org/ftp/lua-5.3.6.tar.gz tar zxf lua-5.3.6.tar.gz cd lua-5.3.6 make macosx all make install INSTALL_TOP="${{parameters.generation_path}}"/gtk/inst displayName: 'Get Lua' - bash: | export PKG_CONFIG_PATH="${{parameters.generation_path}}"/gtk/inst/lib/pkgconfig:"${{parameters.generation_path}}"/gtk/inst/share/pkgconfig:/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/pkgconfig export PREFIX="${{parameters.generation_path}}"/gtk/inst export PATH="$HOME/.local/bin:"${{parameters.generation_path}}"/gtk/inst/bin:$PATH" cmake -GNinja -DCMAKE_INSTALL_PREFIX:PATH="${{parameters.generation_path}}"/gtk/inst .. -DCMAKE_BUILD_TYPE=${{ parameters.build_type }} ${{ parameters.cmake_flags }} # Make sure pot is up to date with sources (maybe translation pipeline is currently running) cmake --build . --target pot cmake --build . --target translations # Build Xournal++ cmake --build . cmake --build . --target install workingDirectory: ./build displayName: 'Build Xournal++'