2021-11-08 13:27:45 +08:00
|
|
|
# Copyright © 2021 by The qTox Project Contributors
|
|
|
|
#
|
|
|
|
# This program is libre software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
FROM debian:bullseye-slim
|
|
|
|
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
ARG ARCH
|
|
|
|
ARG WINEARCH
|
|
|
|
ENV WINEARCH=${WINEARCH}
|
2022-03-07 17:29:03 +08:00
|
|
|
ARG SCRIPT_ARCH=${WINEARCH}
|
2021-11-08 13:27:45 +08:00
|
|
|
|
|
|
|
RUN dpkg --add-architecture i386 && \
|
|
|
|
apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
build-essential \
|
|
|
|
ca-certificates \
|
|
|
|
cmake \
|
|
|
|
extra-cmake-modules \
|
|
|
|
git \
|
|
|
|
libarchive-tools \
|
|
|
|
libtool \
|
|
|
|
nsis \
|
|
|
|
pkg-config \
|
|
|
|
python3-pefile \
|
|
|
|
tclsh \
|
|
|
|
texinfo \
|
|
|
|
unzip \
|
|
|
|
curl \
|
2022-02-15 20:44:16 +08:00
|
|
|
gnupg \
|
2021-11-08 13:27:45 +08:00
|
|
|
yasm \
|
|
|
|
zip \
|
|
|
|
g++-mingw-w64-${ARCH//_/-} \
|
|
|
|
gcc-mingw-w64-${ARCH//_/-} \
|
2022-02-15 20:44:16 +08:00
|
|
|
gdb-mingw-w64
|
|
|
|
RUN curl -L --connect-timeout 10 https://dl.winehq.org/wine-builds/winehq.key | apt-key add -
|
|
|
|
RUN echo "deb https://dl.winehq.org/wine-builds/debian/ bullseye main" >> /etc/apt/sources.list.d/wine.list
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends wine-stable
|
|
|
|
RUN apt-get clean && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
RUN update-alternatives --set ${ARCH}-w64-mingw32-gcc /usr/bin/${ARCH}-w64-mingw32-gcc-posix && \
|
|
|
|
update-alternatives --set ${ARCH}-w64-mingw32-g++ /usr/bin/${ARCH}-w64-mingw32-g++-posix
|
|
|
|
|
|
|
|
COPY download/common.sh /build/download/common.sh
|
2022-03-03 16:14:14 +08:00
|
|
|
COPY build_utils.sh /build/build_utils.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
COPY download/download_openssl.sh /build/download/download_openssl.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_openssl.sh /build/build_openssl.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
|
|
|
|
RUN mkdir -p /src/openssl && \
|
|
|
|
cd /src/openssl && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_openssl.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/openssl
|
|
|
|
|
|
|
|
env PKG_CONFIG_PATH=/windows/lib/pkgconfig
|
|
|
|
|
|
|
|
COPY download/download_qt.sh /build/download/download_qt.sh
|
|
|
|
COPY build_qt_windows.sh /build/build_qt_windows.sh
|
|
|
|
|
|
|
|
RUN mkdir -p /src/qt && \
|
|
|
|
cd /src/qt && \
|
2022-03-07 17:29:03 +08:00
|
|
|
/build/build_qt_windows.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/qt
|
|
|
|
|
|
|
|
COPY download/download_sqlcipher.sh /build/download/download_sqlcipher.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_sqlcipher.sh /build/build_sqlcipher.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
|
|
|
|
RUN mkdir -p /src/sqlcipher && \
|
|
|
|
cd /src/sqlcipher && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_sqlcipher.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/sqlcipher
|
|
|
|
|
|
|
|
COPY download/download_ffmpeg.sh /build/download/download_ffmpeg.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_ffmpeg.sh /build/build_ffmpeg.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
RUN mkdir -p /src/ffmpeg && \
|
|
|
|
cd /src/ffmpeg && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_ffmpeg.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/ffmpeg
|
|
|
|
|
|
|
|
COPY toolchain/windows-${ARCH}-toolchain.cmake /build/windows-toolchain.cmake
|
|
|
|
|
|
|
|
COPY download/download_openal.sh /build/download/download_openal.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_openal.sh /build/build_openal.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
COPY patches/openal-cmake-3-11.patch /build/patches/openal-cmake-3-11.patch
|
|
|
|
|
|
|
|
RUN mkdir -p /src/openal && \
|
|
|
|
cd /src/openal && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_openal.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/openal
|
|
|
|
|
|
|
|
COPY download/download_qrencode.sh /build/download/download_qrencode.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_qrencode.sh /build/build_qrencode.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
RUN mkdir -p /src/qrencode && \
|
|
|
|
cd /src/qrencode && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_qrencode.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/qrencode
|
|
|
|
|
|
|
|
COPY download/download_libexif.sh /build/download/download_libexif.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_libexif.sh /build/build_libexif.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
RUN mkdir -p /src/exif && \
|
|
|
|
cd /src/exif && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_libexif.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/exif
|
|
|
|
|
|
|
|
COPY download/download_snore.sh /build/download/download_snore.sh
|
|
|
|
COPY build_snore_windows.sh /build/build_snore_windows.sh
|
|
|
|
RUN mkdir -p /src/snore && \
|
|
|
|
cd /src/snore && \
|
|
|
|
/build/build_snore_windows.sh && \
|
|
|
|
rm -fr /src/snore
|
|
|
|
|
|
|
|
COPY download/download_opus.sh /build/download/download_opus.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_opus.sh /build/build_opus.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
RUN mkdir -p /src/opus && \
|
|
|
|
cd /src/opus && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_opus.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/opus
|
|
|
|
|
|
|
|
COPY download/download_sodium.sh /build/download/download_sodium.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_sodium.sh /build/build_sodium.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
RUN mkdir -p /src/sodium && \
|
|
|
|
cd /src/sodium && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_sodium.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/sodium
|
|
|
|
|
|
|
|
COPY download/download_vpx.sh /build/download/download_vpx.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_vpx.sh /build/build_vpx.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
COPY patches/vpx.patch /build/patches/vpx.patch
|
|
|
|
RUN mkdir -p /src/vpx && \
|
|
|
|
cd /src/vpx && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_vpx.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/vpx
|
|
|
|
|
|
|
|
COPY download/download_mingw_ldd.sh /build/download/download_mingw_ldd.sh
|
|
|
|
COPY build_mingw_ldd_windows.sh /build/build_mingw_ldd_windows.sh
|
|
|
|
RUN mkdir -p /src/mingw_ldd && \
|
|
|
|
cd /src/mingw_ldd && \
|
|
|
|
/build/build_mingw_ldd_windows.sh && \
|
|
|
|
rm -fr /src/mingw_ldd
|
|
|
|
|
|
|
|
COPY download/download_nsisshellexecasuser.sh /build/download/download_nsisshellexecasuser.sh
|
|
|
|
COPY build_nsisshellexecasuser_windows.sh /build/build_nsisshellexecasuser_windows.sh
|
|
|
|
RUN mkdir -p /src/nsisshellexecasuser && \
|
|
|
|
cd /src/nsisshellexecasuser && \
|
|
|
|
/build/build_nsisshellexecasuser_windows.sh && \
|
|
|
|
rm -fr /src/nsisshellexecasuser
|
|
|
|
|
2022-02-19 10:18:56 +08:00
|
|
|
COPY download/download_msgpack_c.sh /build/download/download_msgpack_c.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_msgpack_c.sh /build/build_msgpack_c.sh
|
2022-02-19 10:18:56 +08:00
|
|
|
RUN mkdir -p /src/msgpack_c && \
|
|
|
|
cd /src/msgpack_c && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_msgpack_c.sh && \
|
2022-02-19 10:18:56 +08:00
|
|
|
rm -fr /src/msgpack_c
|
|
|
|
|
2021-11-08 13:27:45 +08:00
|
|
|
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
|
|
|
|
COPY download/download_toxext.sh /build/download/download_toxext.sh
|
|
|
|
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
|
2022-03-03 16:25:26 +08:00
|
|
|
COPY build_toxcore.sh /build/build_toxcore.sh
|
2021-11-08 13:27:45 +08:00
|
|
|
RUN mkdir -p /src/tox && \
|
|
|
|
cd /src/tox && \
|
2022-03-03 16:25:26 +08:00
|
|
|
/build/build_toxcore.sh && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/tox
|
|
|
|
|
|
|
|
RUN mkdir /export && \
|
|
|
|
cp /usr/${ARCH}-w64-mingw32/lib/libwinpthread-1.dll /export/ && \
|
|
|
|
cp /usr/lib/gcc/${ARCH}-w64-mingw32/10-posix/libgcc_s_*-1.dll /export && \
|
|
|
|
cp /usr/lib/gcc/${ARCH}-w64-mingw32/10-posix/libstdc++-6.dll /export && \
|
|
|
|
cp /usr/lib/gcc/${ARCH}-w64-mingw32/10-posix/libssp-0.dll /export && \
|
|
|
|
cp /windows/bin/Qt5Core.dll /export && \
|
|
|
|
cp /windows/bin/Qt5Gui.dll /export && \
|
|
|
|
cp /windows/bin/Qt5Network.dll /export && \
|
|
|
|
cp /windows/bin/Qt5Svg.dll /export && \
|
|
|
|
cp /windows/bin/Qt5Xml.dll /export && \
|
|
|
|
cp /windows/bin/Qt5Widgets.dll /export && \
|
|
|
|
cp /windows/bin/avcodec-*.dll /export && \
|
|
|
|
cp /windows/bin/avdevice-*.dll /export && \
|
|
|
|
cp /windows/bin/avformat-*.dll /export && \
|
|
|
|
cp /windows/bin/avutil-*.dll /export && \
|
|
|
|
cp /windows/bin/libexif-*.dll /export && \
|
|
|
|
cp /windows/bin/libqrencode.dll /export && \
|
|
|
|
cp /windows/bin/libsodium-*.dll /export && \
|
|
|
|
cp /windows/bin/libsqlcipher-*.dll /export && \
|
2022-02-19 10:18:56 +08:00
|
|
|
cp /windows/bin/libmsgpackc.dll /export && \
|
2021-11-08 13:27:45 +08:00
|
|
|
cp /windows/bin/swscale-*.dll /export && \
|
|
|
|
cp /windows/bin/libcrypto-*.dll /export && \
|
|
|
|
cp /windows/bin/libtoxcore.dll /export && \
|
|
|
|
cp /windows/bin/libopus-*.dll /export && \
|
|
|
|
cp /windows/lib/libvpx.dll /export && \
|
2022-02-09 17:31:40 +08:00
|
|
|
cp /windows/bin/OpenAL32.dll /export && \
|
2021-11-08 13:27:45 +08:00
|
|
|
cp /windows/bin/libssl-*.dll /export && \
|
|
|
|
cp /windows/bin/libsnore-qt5.dll /export && \
|
|
|
|
mkdir -p /export/libsnore-qt5/ && \
|
|
|
|
cp /windows/plugins/libsnore-qt5/libsnore_backend_windowstoast.dll /export/libsnore-qt5/ && \
|
|
|
|
cp /windows/bin/SnoreToast.exe /export && \
|
|
|
|
cp -r /windows/plugins/iconengines /export && \
|
|
|
|
cp -r /windows/plugins/imageformats /export && \
|
|
|
|
cp -r /windows/plugins/platforms /export
|
|
|
|
|
|
|
|
RUN mkdir -p /debug_export
|
|
|
|
|
|
|
|
COPY download/download_mingw_debug_scripts.sh /build/download/download_mingw_debug_scripts.sh
|
|
|
|
RUN mkdir -p /src/mingw-debug-scripts && \
|
|
|
|
cd /src/mingw-debug-scripts && \
|
|
|
|
/build/download/download_mingw_debug_scripts.sh && \
|
|
|
|
sed -i "s|your-app-name.exe|qtox.exe|g" debug-*.bat && \
|
|
|
|
cp -a debug-*.bat /debug_export && \
|
|
|
|
rm -fr /src/mingw-debug-scripts
|
|
|
|
|
|
|
|
COPY download/download_gmp.sh /build/download/download_gmp.sh
|
|
|
|
COPY build_gmp_windows.sh /build/build_gmp_windows.sh
|
|
|
|
RUN mkdir -p /src/gmp && \
|
|
|
|
cd /src/gmp && \
|
2022-03-07 17:35:20 +08:00
|
|
|
/build/build_gmp_windows.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/gmp
|
|
|
|
|
|
|
|
COPY download/download_libexpat.sh /build/download/download_libexpat.sh
|
|
|
|
COPY build_libexpat_windows.sh /build/build_libexpat_windows.sh
|
|
|
|
RUN mkdir -p /src/libexpat && \
|
|
|
|
cd /src/libexpat && \
|
2022-03-07 17:35:20 +08:00
|
|
|
/build/build_libexpat_windows.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/libexpat
|
|
|
|
|
|
|
|
COPY download/download_gdb.sh /build/download/download_gdb.sh
|
|
|
|
COPY build_gdb_windows.sh /build/build_gdb_windows.sh
|
|
|
|
RUN mkdir -p /src/gdb && \
|
|
|
|
cd /src/gdb && \
|
2022-03-07 17:35:20 +08:00
|
|
|
/build/build_gdb_windows.sh --arch ${SCRIPT_ARCH} && \
|
2021-11-08 13:27:45 +08:00
|
|
|
rm -fr /src/gdb && \
|
|
|
|
cp /windows/bin/gdb.exe /debug_export/gdb.exe
|
|
|
|
|
|
|
|
RUN mkdir -p /qtox
|
|
|
|
WORKDIR /qtox
|