feather/Dockerfile.linux

324 lines
13 KiB
Text
Raw Normal View History

2021-08-29 18:07:19 +00:00
FROM ubuntu:bionic-20210723
2021-06-18 22:06:57 +00:00
2021-06-25 14:14:49 +00:00
ARG THREADS=4
2021-02-01 18:45:47 +00:00
ENV CFLAGS="-fPIC"
ENV CPPFLAGS="-fPIC"
ENV CXXFLAGS="-fPIC"
ENV SOURCE_DATE_EPOCH=1397818193
ENV DEBIAN_FRONTEND=noninteractive
2021-06-18 22:06:57 +00:00
# Feather build flags
ENV CHECK_UPDATES=ON
2021-06-25 14:14:49 +00:00
ENV WITH_SCANNER=ON
2021-06-18 22:06:57 +00:00
2021-08-29 18:07:19 +00:00
COPY --from=featherwallet/feather-deps:linux-1.0.0 /deps /deps
COPY --from=featherwallet/feather-deps:linux-1.0.0 /var/cache/apt/archives /archives
2021-06-18 22:06:57 +00:00
2021-02-01 18:45:47 +00:00
RUN apt-get update && \
2021-06-18 22:06:57 +00:00
apt-get install -y gpg xz-utils ca-certificates wget && \
2021-02-01 18:45:47 +00:00
rm -rf /var/lib/apt/lists/*
2021-06-18 22:06:57 +00:00
COPY contrib/build-deps/verify-packages.sh .
2021-08-29 18:07:19 +00:00
RUN bash verify-packages.sh && \
cd /archives && \
dpkg -i --force-depends *.deb && \
rm -rf /deps /archives
2021-06-18 22:06:57 +00:00
2022-06-23 15:02:56 +00:00
# OpenSSL: Required for CMake, Qt 5.15, libwallet, Tor
2021-06-18 22:06:57 +00:00
ENV OPENSSL_ROOT_DIR=/usr/local/openssl/
2022-07-02 19:33:45 +00:00
RUN git clone -b OpenSSL_1_1_1p --depth 1 https://github.com/openssl/openssl.git && \
2021-06-18 22:06:57 +00:00
cd openssl && \
2022-07-02 19:33:45 +00:00
git reset --hard 8aaca20cf9996257d1ce2e6f4d3059b3698dde3d && \
2021-02-01 18:45:47 +00:00
./config no-shared no-dso --prefix=/usr/local/openssl && \
make -j$THREADS && \
make -j$THREADS install_sw && \
rm -rf $(pwd)
2021-06-18 22:06:57 +00:00
# CMake: Required to build libqrencode, monero-seed, libzip
2022-02-23 16:04:23 +00:00
RUN git clone -b v3.22.2 --depth 1 https://github.com/Kitware/CMake && \
2021-06-18 22:06:57 +00:00
cd CMake && \
2022-02-23 16:04:23 +00:00
git reset --hard 8428e39ed9cddb3b7f1a6f7a58cb8617503183d2 && \
2021-06-18 22:06:57 +00:00
./bootstrap && \
2021-02-01 18:45:47 +00:00
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
2021-06-27 00:41:30 +00:00
# freetype2: Required for Qt 5.15, fontconfig
2020-12-04 15:30:35 +00:00
RUN git clone -b VER-2-10-2 --depth 1 https://git.savannah.gnu.org/git/freetype/freetype2.git && \
cd freetype2 && \
git reset --hard 132f19b779828b194b3fede187cee719785db4d8 && \
./autogen.sh && \
2020-12-04 15:30:35 +00:00
./configure --disable-shared --enable-static --with-zlib=no && \
make -j$THREADS && \
2020-12-04 15:30:35 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
2021-06-18 22:06:57 +00:00
# expat: Required for fontconfig
RUN git clone -b R_2_2_9 --depth 1 https://github.com/libexpat/libexpat && \
cd libexpat/expat && \
git reset --hard a7bc26b69768f7fb24f0c7976fae24b157b85b13 && \
./buildconf.sh && \
2020-12-04 15:30:35 +00:00
./configure --disable-shared --enable-static && \
make -j$THREADS && \
2020-12-04 15:30:35 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
2021-06-18 22:06:57 +00:00
# fontconfig: Required for Qt 5.15
2021-01-13 13:01:51 +00:00
RUN git clone -b 2.13.92 --depth 1 https://gitlab.freedesktop.org/fontconfig/fontconfig && \
cd fontconfig && \
git reset --hard b1df1101a643ae16cdfa1d83b939de2497b1bf27 && \
2020-12-04 15:30:35 +00:00
./autogen.sh --disable-shared --enable-static --sysconfdir=/etc --localstatedir=/var && \
make -j$THREADS && \
2020-12-04 15:30:35 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
2022-07-03 16:11:56 +00:00
COPY contrib/QTBUG-92199-fix.patch .
2022-06-23 15:02:56 +00:00
ENV QT_VERSION=v5.15.5-lts-lgpl
2021-06-18 22:06:57 +00:00
RUN git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \
2020-12-04 15:30:35 +00:00
cd qt5 && \
git clone git://code.qt.io/qt/qtbase.git -b ${QT_VERSION} --depth 1 && \
git clone git://code.qt.io/qt/qtimageformats.git -b ${QT_VERSION} --depth 1 && \
git clone git://code.qt.io/qt/qtmultimedia.git -b ${QT_VERSION} --depth 1 && \
git clone git://code.qt.io/qt/qtsvg.git -b ${QT_VERSION} --depth 1 && \
git clone git://code.qt.io/qt/qttools.git -b ${QT_VERSION} --depth 1 && \
git clone git://code.qt.io/qt/qttranslations.git -b ${QT_VERSION} --depth 1 && \
git clone git://code.qt.io/qt/qtx11extras.git -b ${QT_VERSION} --depth 1 && \
git clone git://code.qt.io/qt/qtwebsockets.git -b ${QT_VERSION} --depth 1 && \
sed -ri s/\(Libs:.*\)/\\1\ -lexpat/ /usr/local/lib/pkgconfig/fontconfig.pc && \
sed -ri s/\(Libs:.*\)/\\1\ -lz/ /usr/local/lib/pkgconfig/freetype2.pc && \
2022-07-03 16:11:56 +00:00
sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf && \
cd qtbase && cat ../../QTBUG-92199-fix.patch && git apply ../../QTBUG-92199-fix.patch
2021-06-18 22:06:57 +00:00
2021-08-29 22:09:11 +00:00
RUN cd qt5 && \
if [ "$(uname -m)" = "aarch64" ]; then \
2021-08-29 18:07:19 +00:00
export LIBDIR="/usr/lib/aarch64-linux-gnu"; \
export QT_PLATFORM="linux-aarch64-gnu-g++"; \
else \
export LIBDIR="/usr/lib/x86_64-linux-gnu"; \
export QT_PLATFORM="linux-g++-64"; \
2021-08-29 22:09:11 +00:00
fi && \
2021-08-29 18:07:19 +00:00
rm $LIBDIR/libX11.a && \
rm $LIBDIR/libX11-xcb.a && \
OPENSSL_LIBS="-lssl -lcrypto -lpthread -ldl" \
2021-08-29 18:07:19 +00:00
./configure --prefix=/usr -platform $QT_PLATFORM -opensource -confirm-license -release -static -no-avx \
2021-06-18 22:06:57 +00:00
-no-opengl -qpa xcb --xcb -xcb-xlib -feature-xlib -openssl-linked -I /usr/local/openssl/include \
-L /usr/local/openssl/lib -system-freetype -fontconfig -glib \
-no-dbus -no-sql-sqlite -no-use-gold-linker -no-kms \
-qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \
-skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d \
-skip qtdoc -skip qtquickcontrols -skip qtquickcontrols2 -skip qtspeech -skip qtgamepad \
-skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing -optimize-size \
-skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools \
-skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview \
-skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine \
-skip qtdeclarative -gstreamer \
-no-feature-cups -no-feature-ftp -no-feature-pdf -no-feature-animation \
-nomake examples -nomake tests -nomake tools && \
make -j$THREADS && \
2020-12-04 15:30:35 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
2021-06-18 22:06:57 +00:00
# boost: Required for libwallet
RUN wget https://downloads.sourceforge.net/project/boost/boost/1.73.0/boost_1_73_0.tar.bz2 && \
echo "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402 boost_1_73_0.tar.bz2" | sha256sum -c && \
tar -xvf boost_1_73_0.tar.bz2 && \
rm boost_1_73_0.tar.bz2 && \
cd boost_1_73_0 && \
./bootstrap.sh && \
./b2 --with-atomic --with-system --with-filesystem --with-thread --with-date_time --with-chrono --with-regex --with-serialization --with-program_options --with-locale variant=release link=static runtime-link=static cflags="${CFLAGS}" cxxflags="${CXXFLAGS}" install -a --prefix=/usr && \
rm -rf $(pwd)
# libusb: Required for libwallet
2021-05-04 23:09:19 +00:00
RUN git clone -b v1.0.24 --depth 1 https://github.com/libusb/libusb && \
cd libusb && \
2021-05-04 23:09:19 +00:00
git reset --hard c6a35c56016ea2ab2f19115d2ea1e85e0edae155 && \
2020-12-04 15:30:35 +00:00
./autogen.sh --disable-shared --enable-static && \
make -j$THREADS && \
2020-12-04 15:30:35 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
2021-06-18 22:06:57 +00:00
# hidapi: Required for libwallet
2021-05-04 23:09:19 +00:00
RUN git clone -b hidapi-0.10.1 --depth 1 https://github.com/libusb/hidapi && \
cd hidapi && \
2021-05-04 23:09:19 +00:00
git reset --hard f6d0073fcddbdda24549199445e844971d3c9cef && \
./bootstrap && \
2020-12-04 15:30:35 +00:00
./configure --disable-shared --enable-static && \
make -j$THREADS && \
2020-12-04 15:30:35 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
2022-02-23 21:00:45 +00:00
# libsodium: Required for libwallet
2021-06-18 22:06:57 +00:00
RUN git clone -b 1.0.18-RELEASE --depth 1 https://github.com/jedisct1/libsodium.git && \
cd libsodium && \
git reset --hard 940ef42797baa0278df6b7fd9e67c7590f87744b && \
./autogen.sh && \
./configure --disable-shared --enable-static && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
# protobuf: Required for libwallet
RUN git clone -b v3.10.0 --depth 1 https://github.com/protocolbuffers/protobuf && \
cd protobuf && \
git reset --hard 6d4e7fd7966c989e38024a8ea693db83758944f1 && \
./autogen.sh && \
2021-06-18 22:06:57 +00:00
./configure --enable-static --disable-shared && \
make -j$THREADS && \
2020-12-04 15:30:35 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
2022-05-23 09:36:06 +00:00
# unbound: Required for libwallet
RUN git clone -b release-1.13.2 --depth 1 https://github.com/NLnetLabs/unbound.git && \
cd unbound && \
git reset --hard 8e538dcaa8df2d0fab8ff3dcf94ac1f972450b66 && \
./configure --disable-shared --enable-static --without-pyunbound --with-libexpat=/usr/local/ --with-ssl=/usr/local/openssl --with-libevent=no --without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only --with-pic && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
2021-06-18 22:06:57 +00:00
# squashfs-tools: Used to create Feather AppImage
RUN git clone https://github.com/plougher/squashfs-tools.git && \
cd squashfs-tools/squashfs-tools && \
git reset --hard 38fa0720526222827da44b3b6c3f7eb63e8f5c2f && \
make && \
make install && \
rm -rf $(pwd)
# patchelf: Required by linuxdeployqt
RUN git clone -b 0.12 --depth 1 https://github.com/NixOS/patchelf.git && \
cd patchelf && \
git reset --hard 8d3a16e97294e3c5521c61b4c8835499c9918264 && \
./bootstrap.sh && \
./configure && \
make -j$THREADS && \
make install && \
rm -rf $(pwd)
# linuxdeployqt: Used to create Feather AppImage
2021-08-29 18:07:19 +00:00
# build from source because latest release does not allow glibc 2.27
2021-06-18 22:06:57 +00:00
RUN git clone https://github.com/probonopd/linuxdeployqt.git && \
cd linuxdeployqt && \
git reset --hard b4697483c98120007019c3456914cfd1dba58384 && \
qmake && \
make -j$THREADS && \
2021-06-18 22:06:57 +00:00
make install && \
2020-12-04 15:30:35 +00:00
rm -rf $(pwd)
2021-06-18 22:06:57 +00:00
# libevent: Required for Tor
RUN wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz && \
echo "92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb libevent-2.1.12-stable.tar.gz" | sha256sum -c && \
tar -zxvf libevent-2.1.12-stable.tar.gz && \
cd libevent-2.1.12-stable && \
PKG_CONFIG_PATH=/usr/local/openssl/lib/pkgconfig/ \
./configure --prefix=/usr/local/libevent \
--disable-shared \
--enable-static \
--with-pic && \
make -j$THREADS && \
2020-12-04 15:30:35 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
2021-06-18 22:06:57 +00:00
# zlib: Required for Tor
RUN git clone -b v1.2.11 --depth 1 https://github.com/madler/zlib && \
cd zlib && \
git reset --hard cacf7f1d4e3d44d871b605da3b647f07d718623f && \
./configure --static --prefix=/usr/local/zlib && \
2020-12-04 15:30:35 +00:00
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
2022-02-23 16:04:23 +00:00
# Tor: Optional for Feather (-DTOR_DIR)
2021-06-18 22:06:57 +00:00
# Binary can be embedded in Feather
2022-02-23 16:04:23 +00:00
# TOR_VERSION is used by CMAKE to determine embedded version
2022-06-23 11:45:08 +00:00
ENV TOR_VERSION=0.4.7.8
2022-02-23 21:00:45 +00:00
ENV TOR_DIR=/usr/local/tor/bin/
2022-06-23 11:45:08 +00:00
RUN git clone -b tor-0.4.7.8 --depth 1 https://git.torproject.org/tor.git && \
2021-06-18 22:06:57 +00:00
cd tor && \
2022-06-23 11:45:08 +00:00
git reset --hard 7528524aee3ffe3c9b7c69fa18f659e1993f59a3 && \
2021-06-18 22:06:57 +00:00
./autogen.sh && \
./configure \
--disable-asciidoc \
--disable-manpage \
--disable-html-manual \
--disable-system-torrc \
--disable-module-relay \
--disable-lzma \
--disable-zstd \
--enable-static-tor \
--with-libevent-dir=/usr/local/libevent \
--with-openssl-dir=/usr/local/openssl \
--with-zlib-dir=/usr/local/zlib \
--disable-tool-name-check \
--enable-fatal-warnings \
--prefix=/usr/local/tor && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd) && \
2022-02-23 21:00:45 +00:00
strip -s -D /usr/local/tor/bin/tor && \
rm /usr/local/tor/bin/tor?*
2021-06-18 22:06:57 +00:00
# libqrencode: Required for Feather
# Used to display QR Codes
2021-05-04 23:09:19 +00:00
RUN git clone -b v4.1.1 --depth 1 https://github.com/fukuchi/libqrencode.git && \
cd libqrencode && \
2021-05-04 23:09:19 +00:00
git reset --hard 715e29fd4cd71b6e452ae0f4e36d917b43122ce8 && \
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr . && \
make -j$THREADS && \
2020-12-04 15:30:35 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
2021-06-18 22:06:57 +00:00
# libzip: Required for Feather
# Used to unzip updates downloaded by the built-in updater
2021-05-04 23:09:19 +00:00
RUN git clone -b v1.7.3 --depth 1 https://github.com/nih-at/libzip.git && \
2021-04-26 10:56:04 +00:00
cd libzip && \
git reset --hard 66e496489bdae81bfda8b0088172871d8fda0032 && \
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr . && \
make -j$THREADS && \
2021-06-18 22:06:57 +00:00
make -j$THREADS install && \
rm -rf $(pwd)
# libgpg-error: Required for libgcrypt
RUN git clone -b libgpg-error-1.38 --depth 1 git://git.gnupg.org/libgpg-error.git && \
cd libgpg-error && \
git reset --hard 71d278824c5fe61865f7927a2ed1aa3115f9e439 && \
./autogen.sh && \
./configure --disable-shared --enable-static --disable-doc --disable-tests && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
# libgcrypt: Required for Feather
# Used in src/openpgp to verify updates downloaded by the built-in updater
RUN git clone -b libgcrypt-1.8.5 --depth 1 git://git.gnupg.org/libgcrypt.git && \
cd libgcrypt && \
git reset --hard 56606331bc2a80536db9fc11ad53695126007298 && \
./autogen.sh && \
./configure --disable-shared --enable-static --disable-doc && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
# zbar: Optional for Feather (-DWITH_SCANNER)
# Used to scan for QR Codes
RUN git clone -b stable-0.21 --recursive https://github.com/mchehab/zbar.git && \
cd zbar && \
git reset --hard 505f1a87b32cb7bb0edbaf37e20ccdd46bbae2a3 && \
autoreconf -vfi && \
./configure --enable-static --disable-shared --without-imagemagick --with-gtk=no --with-python=no --enable-doc=no && \
make -j$THREADS && \
make install && \
2022-05-23 21:43:33 +00:00
rm -rf $(pwd)
# polyseed: Required for Feather
RUN git clone https://github.com/tevador/polyseed.git && \
cd polyseed && \
git reset --hard 4945d8239d6b26dc12723ca2aaa9f8110ceff5af && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install && \
rm /usr/local/lib/libpolyseed.so* && \
2021-06-18 22:06:57 +00:00
rm -rf $(pwd)