Skip to content

Commit 6a7fd39

Browse files
committed
Add support for arm64 docker builds
Update README.md Added Docker instructions for static Linux arm64 builds relaunch check Update Makefile /bin/sh compatibility fix
1 parent b0050f3 commit 6a7fd39

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

Dockerfile.linux

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1-
FROM ubuntu:16.04
1+
ARG UBUNTU_VERSION=16.04
2+
FROM ubuntu:${UBUNTU_VERSION}
3+
ARG UBUNTU_VERSION
24

35
ARG THREADS=1
46
ARG QT_VERSION=v5.15.3-lts-lgpl
7+
ARG DEBIAN_FRONTEND=noninteractive
58

69
ENV CFLAGS="-fPIC"
710
ENV CPPFLAGS="-fPIC"
811
ENV CXXFLAGS="-fPIC"
912
ENV SOURCE_DATE_EPOCH=1397818193
1013

1114
RUN apt update && \
15+
if [ "$UBUNTU_VERSION" = "18.04" ]; then \
16+
export BUILD_DEPS="build-essential libpng-dev libx11-xcb-dev libxext-dev"; \
17+
else \
18+
export BUILD_DEPS="libpng12-dev"; \
19+
fi && \
1220
apt install -y automake autopoint bison gettext git gperf libgl1-mesa-dev libglib2.0-dev \
13-
libpng12-dev libpthread-stubs0-dev libsodium-dev libtool-bin libudev-dev libusb-1.0-0-dev mesa-common-dev \
14-
pkg-config python wget xutils-dev
21+
libpthread-stubs0-dev libsodium-dev libtool-bin libudev-dev libusb-1.0-0-dev mesa-common-dev \
22+
pkg-config python wget xutils-dev $BUILD_DEPS
1523

1624
RUN git clone -b xorgproto-2020.1 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xorgproto && \
1725
cd xorgproto && \
@@ -194,9 +202,16 @@ RUN wget https://www.nlnetlabs.nl/downloads/unbound/unbound-1.13.2.tar.gz && \
194202
make -j$THREADS install && \
195203
rm -rf $(pwd)
196204

197-
RUN rm /usr/lib/x86_64-linux-gnu/libX11.a && \
198-
rm /usr/lib/x86_64-linux-gnu/libXext.a && \
199-
rm /usr/lib/x86_64-linux-gnu/libX11-xcb.a && \
205+
RUN if [ "$(uname -m)" = "aarch64" ]; then \
206+
export LIBDIR="/usr/lib/aarch64-linux-gnu"; \
207+
export QT_PLATFORM="linux-aarch64-gnu-g++"; \
208+
else \
209+
export LIBDIR="/usr/lib/x86_64-linux-gnu"; \
210+
export QT_PLATFORM="linux-g++-64"; \
211+
fi && \
212+
rm $LIBDIR/libX11.a && \
213+
rm $LIBDIR/libXext.a && \
214+
rm $LIBDIR/libX11-xcb.a && \
200215
git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \
201216
cd qt5 && \
202217
git clone git://code.qt.io/qt/qtbase.git -b ${QT_VERSION} --depth 1 && \
@@ -215,7 +230,7 @@ RUN rm /usr/lib/x86_64-linux-gnu/libX11.a && \
215230
sed -ri s/\(Libs:.*\)/\\1\ -lz/ /usr/local/lib/pkgconfig/freetype2.pc && \
216231
sed -ri s/\(Libs:.*\)/\\1\ -lXau/ /usr/local/lib/pkgconfig/xcb.pc && \
217232
sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf && \
218-
./configure --prefix=/usr -platform linux-g++-64 -opensource -confirm-license -release -static -no-avx \
233+
./configure --prefix=/usr -platform $QT_PLATFORM -opensource -confirm-license -release -static -no-avx \
219234
-opengl desktop -qpa xcb -xcb -xcb-xlib -feature-xlib -system-freetype -fontconfig -glib \
220235
-no-dbus -no-feature-qml-worker-script -no-linuxfb -no-openssl -no-sql-sqlite -no-kms -no-use-gold-linker \
221236
-qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ release-linux-ppc64le:
5656
release-static:
5757
mkdir -p $(builddir)/release && cd $(builddir)/release && cmake -D STATIC=ON -D DEV_MODE=$(or ${DEV_MODE},OFF) -DMANUAL_SUBMODULES=${MANUAL_SUBMODULES} -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
5858
59+
release-static-linux-armv8:
60+
mkdir -p $(builddir)/release && cd $(builddir)/release && cmake -D STATIC=ON -D DEV_MODE=$(or ${DEV_MODE},OFF) -DMANUAL_SUBMODULES=${MANUAL_SUBMODULES} -D ARCH="armv8-a" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
61+
5962
debug-static-win64:
6063
mkdir -p $(builddir)/debug && cd $(builddir)/debug && cmake -D STATIC=ON -G "MSYS Makefiles" -D DEV_MODE=$(or ${DEV_MODE},ON) -DMANUAL_SUBMODULES=${MANUAL_SUBMODULES} -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Debug -D BUILD_TAG="win-x64" -D CMAKE_TOOLCHAIN_FILE=$(topdir)/cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=$(shell cd ${MINGW_PREFIX}/.. && pwd -W) -D MINGW=ON $(topdir) && $(MAKE)
6164

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ Packaging for your favorite distribution would be a welcome contribution!
138138
docker build --tag monero:build-env-linux --build-arg THREADS=4 --file Dockerfile.linux .
139139
```
140140
\* `4` - number of CPU threads to use
141+
142+
For arm64 builds, add `--build-arg UBUNTU_VERSION=18.04` as an argument.
141143

142144
4. Build
143145
```
144146
docker run --rm -it -v <MONERO_GUI_DIR_FULL_PATH>:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make release-static -j4'
145147
```
146148
\* `<MONERO_GUI_DIR_FULL_PATH>` - absolute path to `monero-gui` directory
149+
\* `release-static` - replace with `release-static-linux-armv8` if building for arm64
147150
\* `4` - number of CPU threads to use
151+
148152
5. Monero GUI Linux static binaries will be placed in `monero-gui/build/release/bin` directory
149153
6. (*Optional*) Compare `monero-wallet-gui` SHA-256 hash to the one obtained from a trusted source
150154
```

0 commit comments

Comments
 (0)