#!/usr/bin/env bash # Ninja, pinned, from the upstream release binary. # # Shared by all four build images (docker/*/Dockerfile). The build context is docker/, so each # Dockerfile reaches this with COPY common/. Version inputs come from that Dockerfile's ARGs. # # Pinned for the same reason as CMake: the distro versions span 1.8.2 (EL8) to 1.11.1 (Noble), and # 1.8.2 is too old to parse what recent Qt generates -- it fails with "multiple outputs aren't # supported by depslog", which is a ninja limitation lifted in 1.10, not anything wrong with Qt. # # The zip is unpacked with python3 rather than unzip: python3 is in every image already and unzip # is not, so this needs no extra package. set -eux : "${NINJA_VERSION:?set NINJA_VERSION}" : "${NINJA_SHA256:?set NINJA_SHA256}" cd /tmp curl -fLO "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux.zip" echo "${NINJA_SHA256} ninja-linux.zip" | sha256sum -c - mkdir -p "/opt/ninja-${NINJA_VERSION}/bin" python3 -m zipfile -e ninja-linux.zip "/opt/ninja-${NINJA_VERSION}/bin" chmod +x "/opt/ninja-${NINJA_VERSION}/bin/ninja" rm -f ninja-linux.zip test "$("/opt/ninja-${NINJA_VERSION}/bin/ninja" --version)" = "${NINJA_VERSION}"