File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ FROM almalinux:8
33RUN yum install -y \
44 autoconf \
55 automake \
6- cmake \
76 diffutils \
87 gcc-c++ \
98 glibc-devel \
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
44 apt-get update && \
55 apt-get upgrade -y && \
66 apt-get install -y --no-install-recommends \
7- cmake \
87 build-essential \
98 ca-certificates \
109 curl \
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
44 apt-get update && \
55 apt-get upgrade -y && \
66 apt-get install -y --no-install-recommends \
7- cmake \
87 build-essential \
98 ca-certificates \
109 curl \
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ set -evux -o pipefail
55
66PROTOBUF_VERSION=22.5
77ABSL_VERSION=20230125.4
8+ CMAKE_VERSION=3.13.4
89
910# ARCH is x86_64 bit unless otherwise specified.
1011ARCH=" ${ARCH:- x86_64} "
@@ -29,6 +30,16 @@ if [ -f ${INSTALL_DIR}/bin/protoc ]; then
2930 echo " Not building protobuf. Already built"
3031# TODO(ejona): swap to `brew install --devel protobuf` once it is up-to-date
3132else
33+ if [[ ! -d " cmake-${CMAKE_VERSION} " ]]; then
34+ curl -Ls " https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} /cmake-${CMAKE_VERSION} .tar.gz" | tar xz
35+ fi
36+ # the same source dir is used for 32 and 64 bit builds, so we need to clean stale data first
37+ rm -rf " $DOWNLOAD_DIR /cmake-${CMAKE_VERSION} /bin"
38+ cd " $DOWNLOAD_DIR /cmake-${CMAKE_VERSION} "
39+ ./bootstrap
40+ make
41+ make install
42+ ln -s /usr/local/bin/cmake /usr/bin/cmake
3243 if [[ ! -d " protobuf-${PROTOBUF_VERSION} " ]]; then
3344 curl -Ls " https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION} /protobuf-${PROTOBUF_VERSION} .tar.gz" | tar xz
3445 curl -Ls " https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSL_VERSION} .tar.gz" | tar xz
6071 cmake .. \
6172 -DCMAKE_CXX_STANDARD=14 -Dprotobuf_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF \
6273 -DCMAKE_INSTALL_PREFIX=" $INSTALL_DIR " -Dcrosscompile_ARCH=" $GCC_ARCH " \
63- -DCMAKE_TOOLCHAIN_FILE=$BUILDSCRIPTS_DIR /toolchain.cmake
74+ -DCMAKE_TOOLCHAIN_FILE=$BUILDSCRIPTS_DIR /toolchain.cmake \
75+ -B.
6476 fi
6577 export CMAKE_BUILD_PARALLEL_LEVEL=" $NUM_CPU "
6678 cmake --build .
You can’t perform that action at this time.
0 commit comments