mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #6390
Maxim Biro (8): chore(windows): use Debian Bullseye for Windows cross-compilation chore(windows): update OpenSSL to 1.1.1l chore(windows): update Qt to 5.12.11 chore(windows): update Exif to 0.6.23 chore(windows): update Expat to 2.4.1 chore(windows): update GDB to 11.1, add GMP chore(windows): fix Wine prefix issue chore(windows): update copyright year
This commit is contained in:
commit
db5081d3dc
|
@ -118,7 +118,7 @@ sudo docker run --rm \
|
||||||
-v "$PWD/workspace":/workspace \
|
-v "$PWD/workspace":/workspace \
|
||||||
-v "$PWD":/qtox \
|
-v "$PWD":/qtox \
|
||||||
-e TRAVIS_CI_STAGE="$STAGE" \
|
-e TRAVIS_CI_STAGE="$STAGE" \
|
||||||
debian:buster-slim \
|
debian:bullseye-slim \
|
||||||
/bin/bash /qtox/windows/cross-compile/build.sh "$ARCH" "$BUILD_TYPE"
|
/bin/bash /qtox/windows/cross-compile/build.sh "$ARCH" "$BUILD_TYPE"
|
||||||
|
|
||||||
# Purely for debugging
|
# Purely for debugging
|
||||||
|
|
|
@ -45,19 +45,19 @@ To start cross-compiling for 32-bit release version of qTox run:
|
||||||
sudo docker run --rm \
|
sudo docker run --rm \
|
||||||
-v /absolute/path/to/your/workspace:/workspace \
|
-v /absolute/path/to/your/workspace:/workspace \
|
||||||
-v /absolute/path/to/your/qtox:/qtox \
|
-v /absolute/path/to/your/qtox:/qtox \
|
||||||
debian:buster-slim \
|
debian:bullseye-slim \
|
||||||
/bin/bash /qtox/windows/cross-compile/build.sh i686 release
|
/bin/bash /qtox/windows/cross-compile/build.sh i686 release
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to debug some compilation issue, you might want to instead run:
|
If you want to debug some compilation issue, you might want to instead run:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Get shell inside Debian Buster container so that you can poke around if needed
|
# Get shell inside Debian Bullseye container so that you can poke around if needed
|
||||||
sudo docker run -it \
|
sudo docker run -it \
|
||||||
--rm \
|
--rm \
|
||||||
-v /absolute/path/to/your/workspace:/workspace \
|
-v /absolute/path/to/your/workspace:/workspace \
|
||||||
-v /absolute/path/to/your/qtox:/qtox \
|
-v /absolute/path/to/your/qtox:/qtox \
|
||||||
debian:buster-slim \
|
debian:bullseye-slim \
|
||||||
/bin/bash
|
/bin/bash
|
||||||
# Run the script
|
# Run the script
|
||||||
bash /qtox/windows/cross-compile/build.sh i686 release
|
bash /qtox/windows/cross-compile/build.sh i686 release
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# MIT License
|
# MIT License
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017-2020 Maxim Biro <nurupo.contributions@gmail.com>
|
# Copyright (c) 2017-2021 Maxim Biro <nurupo.contributions@gmail.com>
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
# of this software and associated documentation files (the "Software"), to deal
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -38,9 +38,9 @@ readonly QTOX_SRC_DIR="/qtox"
|
||||||
|
|
||||||
|
|
||||||
# Make sure we run in an expected environment
|
# Make sure we run in an expected environment
|
||||||
if [ ! -f /etc/os-release ] || ! cat /etc/os-release | grep -qi 'buster'
|
if [ ! -f /etc/os-release ] || ! cat /etc/os-release | grep -qi 'bullseye'
|
||||||
then
|
then
|
||||||
echo "Error: This script should be run on Debian Buster."
|
echo "Error: This script should be run on Debian Bullseye."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -130,12 +130,12 @@ apt-get update
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
bsdtar \
|
|
||||||
build-essential \
|
build-essential \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
cmake \
|
cmake \
|
||||||
extra-cmake-modules \
|
extra-cmake-modules \
|
||||||
git \
|
git \
|
||||||
|
libarchive-tools \
|
||||||
libtool \
|
libtool \
|
||||||
nsis \
|
nsis \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
|
@ -232,9 +232,9 @@ store_apt_cache()
|
||||||
# OpenSSL
|
# OpenSSL
|
||||||
|
|
||||||
OPENSSL_PREFIX_DIR="$DEP_DIR/libopenssl"
|
OPENSSL_PREFIX_DIR="$DEP_DIR/libopenssl"
|
||||||
OPENSSL_VERSION=1.1.1k
|
OPENSSL_VERSION="1.1.1l"
|
||||||
# hash from https://www.openssl.org/source/
|
# hash from https://www.openssl.org/source/
|
||||||
OPENSSL_HASH="892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5"
|
OPENSSL_HASH="0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1"
|
||||||
OPENSSL_FILENAME="openssl-$OPENSSL_VERSION.tar.gz"
|
OPENSSL_FILENAME="openssl-$OPENSSL_VERSION.tar.gz"
|
||||||
if [ ! -f "$OPENSSL_PREFIX_DIR/done" ]
|
if [ ! -f "$OPENSSL_PREFIX_DIR/done" ]
|
||||||
then
|
then
|
||||||
|
@ -275,10 +275,10 @@ fi
|
||||||
QT_PREFIX_DIR="$DEP_DIR/libqt5"
|
QT_PREFIX_DIR="$DEP_DIR/libqt5"
|
||||||
QT_MAJOR=5
|
QT_MAJOR=5
|
||||||
QT_MINOR=12
|
QT_MINOR=12
|
||||||
QT_PATCH=10
|
QT_PATCH=11
|
||||||
QT_VERSION=$QT_MAJOR.$QT_MINOR.$QT_PATCH
|
QT_VERSION=$QT_MAJOR.$QT_MINOR.$QT_PATCH
|
||||||
# hash from https://download.qt.io/archive/qt/5.12/5.12.10/single/qt-everywhere-src-5.12.10.tar.xz.mirrorlist
|
# hash from https://download.qt.io/archive/qt/5.12/5.12.11/single/qt-everywhere-src-5.12.11.tar.xz.mirrorlist
|
||||||
QT_HASH="3e0ee1e57f5cf3eeb038d0b4b22c7eb442285c62639290756b39dc93a1d0e14f"
|
QT_HASH="0c4cdef158c61827d70d6111423166e2c62b539eaf303f36ad1d0aa8af900b95"
|
||||||
QT_FILENAME="qt-everywhere-src-$QT_VERSION.tar.xz"
|
QT_FILENAME="qt-everywhere-src-$QT_VERSION.tar.xz"
|
||||||
if [ ! -f "$QT_PREFIX_DIR/done" ]
|
if [ ! -f "$QT_PREFIX_DIR/done" ]
|
||||||
then
|
then
|
||||||
|
@ -634,15 +634,15 @@ fi
|
||||||
# Exif
|
# Exif
|
||||||
|
|
||||||
EXIF_PREFIX_DIR="$DEP_DIR/libexif"
|
EXIF_PREFIX_DIR="$DEP_DIR/libexif"
|
||||||
EXIF_VERSION=0.6.22
|
EXIF_VERSION="0.6.23"
|
||||||
EXIF_HASH="5048f1c8fc509cc636c2f97f4b40c293338b6041a5652082d5ee2cf54b530c56"
|
EXIF_HASH="a740a99920eb81ae0aa802bb46e683ce6e0cde061c210f5d5bde5b8572380431"
|
||||||
EXIF_FILENAME="libexif-$EXIF_VERSION.tar.xz"
|
EXIF_FILENAME="libexif-$EXIF_VERSION.tar.xz"
|
||||||
if [ ! -f "$EXIF_PREFIX_DIR/done" ]
|
if [ ! -f "$EXIF_PREFIX_DIR/done" ]
|
||||||
then
|
then
|
||||||
rm -rf "$EXIF_PREFIX_DIR"
|
rm -rf "$EXIF_PREFIX_DIR"
|
||||||
mkdir -p "$EXIF_PREFIX_DIR"
|
mkdir -p "$EXIF_PREFIX_DIR"
|
||||||
|
|
||||||
curl $CURL_OPTIONS -O "https://github.com/libexif/libexif/releases/download/libexif-${EXIF_VERSION//./_}-release/${EXIF_FILENAME}"
|
curl $CURL_OPTIONS -O "https://github.com/libexif/libexif/releases/download/v${EXIF_VERSION}/libexif-${EXIF_VERSION}.tar.xz"
|
||||||
check_sha256 "$EXIF_HASH" "$EXIF_FILENAME"
|
check_sha256 "$EXIF_HASH" "$EXIF_FILENAME"
|
||||||
bsdtar --no-same-owner --no-same-permissions -xf $EXIF_FILENAME
|
bsdtar --no-same-owner --no-same-permissions -xf $EXIF_FILENAME
|
||||||
rm $EXIF_FILENAME
|
rm $EXIF_FILENAME
|
||||||
|
@ -739,6 +739,7 @@ then
|
||||||
rm $OPUS_FILENAME
|
rm $OPUS_FILENAME
|
||||||
cd opus*
|
cd opus*
|
||||||
|
|
||||||
|
LDFLAGS="-fstack-protector" \
|
||||||
CFLAGS="-O2 -g0" ./configure --host="$ARCH-w64-mingw32" \
|
CFLAGS="-O2 -g0" ./configure --host="$ARCH-w64-mingw32" \
|
||||||
--prefix="$OPUS_PREFIX_DIR" \
|
--prefix="$OPUS_PREFIX_DIR" \
|
||||||
--enable-shared \
|
--enable-shared \
|
||||||
|
@ -773,6 +774,7 @@ then
|
||||||
rm "$SODIUM_FILENAME"
|
rm "$SODIUM_FILENAME"
|
||||||
cd libsodium*
|
cd libsodium*
|
||||||
|
|
||||||
|
LDFLAGS="-fstack-protector" \
|
||||||
./configure --host="$ARCH-w64-mingw32" \
|
./configure --host="$ARCH-w64-mingw32" \
|
||||||
--prefix="$SODIUM_PREFIX_DIR" \
|
--prefix="$SODIUM_PREFIX_DIR" \
|
||||||
--enable-shared \
|
--enable-shared \
|
||||||
|
@ -1174,8 +1176,8 @@ set -u
|
||||||
# Expat
|
# Expat
|
||||||
|
|
||||||
EXPAT_PREFIX_DIR="$DEP_DIR/libexpat"
|
EXPAT_PREFIX_DIR="$DEP_DIR/libexpat"
|
||||||
EXPAT_VERSION="2.3.0"
|
EXPAT_VERSION="2.4.1"
|
||||||
EXPAT_HASH="caa34f99b6e3bcea8502507eb6549a0a84510b244a748dfb287271b2d47467a9"
|
EXPAT_HASH="cf032d0dba9b928636548e32b327a2d66b1aab63c4f4a13dd132c2d1d2f2fb6a"
|
||||||
EXPAT_FILENAME="expat-$EXPAT_VERSION.tar.xz"
|
EXPAT_FILENAME="expat-$EXPAT_VERSION.tar.xz"
|
||||||
if [ ! -f "$EXPAT_PREFIX_DIR/done" ]
|
if [ ! -f "$EXPAT_PREFIX_DIR/done" ]
|
||||||
then
|
then
|
||||||
|
@ -1203,11 +1205,46 @@ set -u
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# GMP
|
||||||
|
|
||||||
|
GMP_PREFIX_DIR="$DEP_DIR/libgmp"
|
||||||
|
GMP_VERSION="6.2.1"
|
||||||
|
GMP_HASH="fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2"
|
||||||
|
GMP_FILENAME="gmp-$GMP_VERSION.tar.xz"
|
||||||
|
if [ ! -f "$GMP_PREFIX_DIR/done" ]
|
||||||
|
then
|
||||||
|
rm -rf "$GMP_PREFIX_DIR"
|
||||||
|
mkdir -p "$GMP_PREFIX_DIR"
|
||||||
|
|
||||||
|
curl $CURL_OPTIONS -O "http://ftp.gnu.org/gnu/gmp/$GMP_FILENAME"
|
||||||
|
check_sha256 "$GMP_HASH" "$GMP_FILENAME"
|
||||||
|
bsdtar --no-same-owner --no-same-permissions -xf $GMP_FILENAME
|
||||||
|
rm $GMP_FILENAME
|
||||||
|
cd gmp*
|
||||||
|
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
CFLAGS="-O2 -g0" ../configure --host="$ARCH-w64-mingw32" \
|
||||||
|
--prefix="$GMP_PREFIX_DIR" \
|
||||||
|
--enable-static \
|
||||||
|
--disable-shared
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
cd ..
|
||||||
|
echo -n $GMP_VERSION > $GMP_PREFIX_DIR/done
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
rm -rf ./gmp*
|
||||||
|
else
|
||||||
|
echo "Using cached build of GMP `cat $GMP_PREFIX_DIR/done`"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# GDB
|
# GDB
|
||||||
|
|
||||||
GDB_PREFIX_DIR="$DEP_DIR/gdb"
|
GDB_PREFIX_DIR="$DEP_DIR/gdb"
|
||||||
GDB_VERSION="10.1"
|
GDB_VERSION="11.1"
|
||||||
GDB_HASH="f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0"
|
GDB_HASH="cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94"
|
||||||
GDB_FILENAME="gdb-$GDB_VERSION.tar.xz"
|
GDB_FILENAME="gdb-$GDB_VERSION.tar.xz"
|
||||||
if [ ! -f "$GDB_PREFIX_DIR/done" ]
|
if [ ! -f "$GDB_PREFIX_DIR/done" ]
|
||||||
then
|
then
|
||||||
|
@ -1226,7 +1263,8 @@ set -u
|
||||||
--prefix="$GDB_PREFIX_DIR" \
|
--prefix="$GDB_PREFIX_DIR" \
|
||||||
--enable-static \
|
--enable-static \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
--with-libexpat-prefix="$EXPAT_PREFIX_DIR"
|
--with-libexpat-prefix="$EXPAT_PREFIX_DIR" \
|
||||||
|
--with-libgmp-prefix="$GMP_PREFIX_DIR"
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -1401,11 +1439,14 @@ mkdir -p "$QTOX_PREFIX_DIR/libsnore-qt5"
|
||||||
cp "$SNORE_PREFIX_DIR/lib/plugins/libsnore-qt5/libsnore_backend_windowstoast.dll" "$QTOX_PREFIX_DIR/libsnore-qt5"
|
cp "$SNORE_PREFIX_DIR/lib/plugins/libsnore-qt5/libsnore_backend_windowstoast.dll" "$QTOX_PREFIX_DIR/libsnore-qt5"
|
||||||
cp "$SNORE_PREFIX_DIR/bin/SnoreToast.exe" $QTOX_PREFIX_DIR
|
cp "$SNORE_PREFIX_DIR/bin/SnoreToast.exe" $QTOX_PREFIX_DIR
|
||||||
|
|
||||||
cp /usr/lib/gcc/$ARCH-w64-mingw32/*-posix/libgcc_s_*.dll $QTOX_PREFIX_DIR
|
cp /usr/lib/gcc/$ARCH-w64-mingw32/*-posix/{libgcc_s_*.dll,libstdc++*.dll,libssp*.dll} $QTOX_PREFIX_DIR
|
||||||
cp /usr/lib/gcc/$ARCH-w64-mingw32/*-posix/libstdc++-6.dll $QTOX_PREFIX_DIR
|
cp /usr/$ARCH-w64-mingw32/lib/libwinpthread*.dll $QTOX_PREFIX_DIR
|
||||||
cp /usr/$ARCH-w64-mingw32/lib/libwinpthread-1.dll $QTOX_PREFIX_DIR
|
|
||||||
|
|
||||||
# Setup wine
|
# Setup wine
|
||||||
|
# Note that SQLCipher and FFmpeg (maybe more?) seem to setup ~/.wine on their
|
||||||
|
# own, but to the wrong bitness (always 64-bit?), when we want a matching
|
||||||
|
# bitness here for mingw-ldd, so remove it before proceeding.
|
||||||
|
rm -rf ~/.wine
|
||||||
if [[ "$ARCH" == "i686" ]]
|
if [[ "$ARCH" == "i686" ]]
|
||||||
then
|
then
|
||||||
export WINEARCH=win32
|
export WINEARCH=win32
|
||||||
|
@ -1415,7 +1456,9 @@ then
|
||||||
fi
|
fi
|
||||||
winecfg
|
winecfg
|
||||||
|
|
||||||
# qtox.exe dll checks (32-bit on i686, 64-bit on x86_64)
|
# qtox.exe dll checks
|
||||||
|
# (system32 contains 32-bit libraries on win32 prefix, but 64-bit on win64
|
||||||
|
# prefix)
|
||||||
python3 $MINGW_LDD_PREFIX_DIR/bin/mingw-ldd.py $QTOX_PREFIX_DIR/qtox.exe --dll-lookup-dirs $QTOX_PREFIX_DIR ~/.wine/drive_c/windows/system32 > /tmp/$ARCH-qtox-ldd
|
python3 $MINGW_LDD_PREFIX_DIR/bin/mingw-ldd.py $QTOX_PREFIX_DIR/qtox.exe --dll-lookup-dirs $QTOX_PREFIX_DIR ~/.wine/drive_c/windows/system32 > /tmp/$ARCH-qtox-ldd
|
||||||
find "$QTOX_PREFIX_DIR" -name '*.dll' > /tmp/$ARCH-qtox-dll-find
|
find "$QTOX_PREFIX_DIR" -name '*.dll' > /tmp/$ARCH-qtox-dll-find
|
||||||
# dlls loded at run time that don't showup as a link time dependency
|
# dlls loded at run time that don't showup as a link time dependency
|
||||||
|
@ -1457,7 +1500,9 @@ do
|
||||||
done < /tmp/$ARCH-qtox-dll-find
|
done < /tmp/$ARCH-qtox-dll-find
|
||||||
|
|
||||||
|
|
||||||
# SnoreToast.exe dll checks (always 32-bit)
|
# SnoreToast.exe dll checks
|
||||||
|
# (always 32-bit as SnoreToast.exe is 32-bit itself, so check system32 on win32
|
||||||
|
# prefix but syswow64 on win64 prefix)
|
||||||
if [[ "$ARCH" == "i686" ]]
|
if [[ "$ARCH" == "i686" ]]
|
||||||
then
|
then
|
||||||
SNORETOAST_WINE_DLLS=/root/.wine/drive_c/windows/system32
|
SNORETOAST_WINE_DLLS=/root/.wine/drive_c/windows/system32
|
||||||
|
|
Loading…
Reference in New Issue
Block a user