Skip to content

Commit

Permalink
build latest cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulchen-Panther committed Jan 28, 2024
1 parent 6ee3327 commit 3460a15
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
18 changes: 9 additions & 9 deletions debian-armv6
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ RUN $APT_INSTALL \
libraspberrypi-dev \
libglib2.0-dev

# install cmake on debian buster from buster-backports
RUN if [ "$SUITE" = "buster" ]; then \
echo "deb http://deb.debian.org/debian buster-backports main contrib non-free" > /etc/apt/sources.list.d/buster-backports-sources.list; \
apt-key adv --keyserver keyserver.ubuntu.com --recv-key 0E98404D386FA1D9 6ED0E7B82643E131; \
$APT_UPDATE && $APT_INSTALL -t buster-backports cmake; \
rm /etc/apt/sources.list.d/buster-backports-sources.list; \
else \
$APT_INSTALL cmake; \
fi
# install latest cmake
ARG CMAKE_VERSION=3.28.1
ARG CMAKE_VERSION_DOT=v3.28
RUN set -ex \
&& CMAKE_BUILD_DIR=$(mktemp -d) \
&& trap "rm -rf $CMAKE_BUILD_DIR" EXIT \
&& cd $CMAKE_BUILD_DIR && curl -sL https://cmake.org/files/${CMAKE_VERSION_DOT}/cmake-${CMAKE_VERSION}.tar.gz -o cmake.tar.gz \
&& tar xf cmake.tar.gz --strip-components 1 \
&& ./configure && make && make install

# download qemu and set exec flag
RUN curl -kL https://github.com/balena-io/qemu/releases/download/v7.0.0%2Bbalena1/qemu-7.0.0.balena1-arm.tar.gz | tar zxvf - -C . --strip-components 1 && mv qemu-arm-static /usr/bin/qemu-static && chmod +x /usr/bin/qemu-static
Expand Down
25 changes: 10 additions & 15 deletions ubuntu_debian
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,6 @@ RUN $APT_INSTALL \
libssl-dev \
libglib2.0-dev

# install cmake
# - on debian buster from buster-backports
# - on ubuntu focal (armhf) from ubuntu bionic
RUN if [ "$SUITE" = "buster" ]; then \
echo "deb http://deb.debian.org/debian buster-backports main contrib non-free" > /etc/apt/sources.list.d/buster-backports-sources.list; \
$APT_UPDATE && $APT_INSTALL -t buster-backports cmake; \
rm /etc/apt/sources.list.d/buster-backports-sources.list; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ] && [ "$SUITE" = "focal" ]; then \
echo "deb [arch=armhf] http://ports.ubuntu.com/ bionic main restricted" > /etc/apt/sources.list.d/bionic-sources.list; \
$APT_UPDATE && $APT_INSTALL -t bionic cmake; \
rm /etc/apt/sources.list.d/bionic-sources.list; \
else \
$APT_INSTALL cmake; \
fi

# install X11/XCB on Ubuntu for all arch and on Debian for amd64
# install libraspberrypi-dev on Debian for arm64/armhf
RUN if [ "$DIST" = "ubuntu" ] || [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
Expand All @@ -101,6 +86,16 @@ elif [ "$TARGETPLATFORM" = "linux/arm64" ] || [ "$TARGETPLATFORM" = "linux/arm/v
rm /etc/apt/sources.list.d/raspi.list; \
fi

# install latest cmake
ARG CMAKE_VERSION=3.28.1
ARG CMAKE_VERSION_DOT=v3.28
RUN set -ex \
&& CMAKE_BUILD_DIR=$(mktemp -d) \
&& trap "rm -rf $CMAKE_BUILD_DIR" EXIT \
&& cd $CMAKE_BUILD_DIR && curl -sL https://cmake.org/files/${CMAKE_VERSION_DOT}/cmake-${CMAKE_VERSION}.tar.gz -o cmake.tar.gz \
&& tar xf cmake.tar.gz --strip-components 1 \
&& ./configure && make && make install

# download qemu
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
curl -kL https://github.com/balena-io/qemu/releases/download/v7.0.0%2Bbalena1/qemu-7.0.0.balena1-aarch64.tar.gz | tar zxvf - -C . --strip-components 1 && mv qemu-aarch64-static /usr/bin/qemu-static; \
Expand Down

0 comments on commit 3460a15

Please sign in to comment.