Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb39784d authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Use latest ccache for builds

parent ade7e449
Loading
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -8,9 +8,14 @@ RUN apt-get update && \

RUN dpkg --add-architecture i386

RUN apt-get update && \
    apt-get -f -y install sudo lsb-release cl-base64 bash wget apt-utils ccache jq file \
    python-is-python3 sed tzdata build-essential lib32gcc-9-dev g++-multilib dos2unix wiggle git curl
RUN apt-get update && apt-get -f -y install \
    apt-utils bash build-essential cl-base64 cmake curl dos2unix \
    file g++-multilib git jq lib32gcc-9-dev libzstd-dev lsb-release \
    pkg-config python-is-python3 sed sudo tzdata wget wiggle

COPY install-latest-ccache.sh /usr/local/bin/install-latest-ccache.sh
RUN chmod +x /usr/local/bin/install-latest-ccache.sh && \
    /usr/local/bin/install-latest-ccache.sh

RUN mkdir ${CHROMIUM_DIR}

+41 −0
Original line number Diff line number Diff line
#!/usr/bin/env sh
set -eu

CCACHE_REPO="https://github.com/ccache/ccache"
WORKDIR="${WORKDIR:-/tmp}"

echo "Resolving latest ccache version..."

CCACHE_VERSION="$(
  curl -fsSL -o /dev/null -w '%{url_effective}' \
    "${CCACHE_REPO}/releases/latest" |
    sed 's|.*/tag/v||'
)"

if [ -z "$CCACHE_VERSION" ]; then
  echo "Failed to determine latest ccache version"
  exit 1
fi

echo "Latest ccache version: ${CCACHE_VERSION}"

TARBALL="ccache-${CCACHE_VERSION}.tar.xz"
DOWNLOAD_URL="${CCACHE_REPO}/releases/download/v${CCACHE_VERSION}/${TARBALL}"

cd "$WORKDIR"
echo "Downloading ${DOWNLOAD_URL} ..."
curl -fsSL -o "$TARBALL" "$DOWNLOAD_URL"

echo "Building ccache ${CCACHE_VERSION} ..."
tar -xf "$TARBALL"
cd "ccache-${CCACHE_VERSION}"

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j"$(nproc)"
cmake --install build

cd /
rm -rf "${WORKDIR}/ccache-${CCACHE_VERSION}" "${WORKDIR}/${TARBALL}"

echo "Installed ccache version:"
ccache --version