1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

feat(build): use Debian Buster for Windows cross-compilation

This commit is contained in:
Maxim Biro 2019-09-17 21:40:10 -04:00 committed by Anthony Bilinski
parent f9488bf966
commit 6bb2c7c629
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
3 changed files with 7 additions and 80 deletions

View File

@ -113,7 +113,7 @@ sudo docker run --rm \
-v "$PWD/workspace":/workspace \
-v "$PWD":/qtox \
-e TRAVIS_CI_STAGE="$STAGE" \
debian:stretch-slim \
debian:buster-slim \
/bin/bash /qtox/windows/cross-compile/build.sh "$ARCH" "$BUILD_TYPE"
# Purely for debugging

View File

@ -45,19 +45,19 @@ To start cross-compiling for 32-bit release version of qTox run:
sudo docker run --rm \
-v /absolute/path/to/your/workspace:/workspace \
-v /absolute/path/to/your/qtox:/qtox \
debian:stretch-slim \
debian:buster-slim \
/bin/bash /qtox/windows/cross-compile/build.sh i686 release
```
If you want to debug some compilation issue, you might want to instead run:
```sh
# Get shell inside Debian Stretch container so that you can poke around if needed
# Get shell inside Debian Buster container so that you can poke around if needed
sudo docker run -it \
--rm \
-v /absolute/path/to/your/workspace:/workspace \
-v /absolute/path/to/your/qtox:/qtox \
debian:stretch-slim \
debian:buster-slim \
/bin/bash
# Run the script
bash /qtox/windows/cross-compile/build.sh i686 release
@ -106,7 +106,6 @@ workspace
│   │   ├── libtoxcore
│   │   ├── libvpx
│   │   ├── mingw-w64-debug-scripts
│   │   ├── nsis
│   │   └── nsis_shellexecuteasuser
│   └── qtox
│   ├── debug
@ -126,7 +125,6 @@ workspace
│   ├── libtoxcore
│   ├── libvpx
│   ├── mingw-w64-debug-scripts
│   ├── nsis
│   └── nsis_shellexecuteasuser
└── qtox
├── debug

View File

@ -38,9 +38,9 @@ readonly QTOX_SRC_DIR="/qtox"
# Make sure we run in an expected environment
if [ ! -f /etc/os-release ] || ! cat /etc/os-release | grep -qi 'stretch'
if [ ! -f /etc/os-release ] || ! cat /etc/os-release | grep -qi 'buster'
then
echo "Error: This script should be run on Debian Stretch."
echo "Error: This script should be run on Debian Buster."
exit 1
fi
@ -136,6 +136,7 @@ apt-get install -y --no-install-recommends \
cmake \
git \
libtool \
nsis \
pkg-config \
tclsh \
unzip \
@ -987,78 +988,6 @@ else
fi
# NSIS
NSIS_PREFIX_DIR="$DEP_DIR/nsis"
NSIS_VERSION="Debian Unstable"
#NSIS_HASH=
if [ ! -f "$NSIS_PREFIX_DIR/done" ]
then
rm -rf "$NSIS_PREFIX_DIR"
mkdir -p "$NSIS_PREFIX_DIR"
# We want to use NSIS 3, instead of NSIS 2, because it added Windows 8 and 10
# support, as well as unicode support. NSIS 3 is not packaged in Debian Stretch
# and building it manually appears to be quite a challenge. Luckily it's
# packaged in Debian Unstable, so we can backport it to our Debian version
# with little effort, utilizing maintainer's build script.
# Keep the indentation of the next echo command as it is, as apt seems to
# ignore preferences starting with whitespace.
echo "
Package: *
Pin: Release a=unstable
Pin-Priority: -1
" >> /etc/apt/preferences
echo "
# Needed for NSIS 3
deb http://httpredir.debian.org/debian unstable main
deb-src http://httpredir.debian.org/debian unstable main
" >> /etc/apt/sources.list
apt-get update
# Get dependencies required for building NSIS
apt-get install -y --no-install-recommends \
build-essential \
devscripts \
docbook-xsl-ns \
docbook5-xml \
dpkg-dev \
fakeroot \
html2text \
libcppunit-dev \
mingw-w64 \
scons \
xsltproc \
zlib1g-dev
apt-get -t unstable install -y --no-install-recommends debhelper
mkdir nsis-build
cd nsis-build
apt-get -t unstable source nsis
cd nsis-*
# The build script is not parallel enough, this speeds things up greatly
sed -i "s/scons / scons -j `nproc` /" debian/rules
DEB_BUILD_OPTIONS="parallel=`nproc` nocheck" debuild -b -uc -us
cd ..
mv nsis-common_*.deb "$NSIS_PREFIX_DIR"
mv nsis-doc_*.deb "$NSIS_PREFIX_DIR"
mv nsis_*.deb "$NSIS_PREFIX_DIR"
mv nsis-pluginapi_*.deb "$NSIS_PREFIX_DIR"
cd ..
rm -rf ./nsis-build
echo -n $NSIS_VERSION > $NSIS_PREFIX_DIR/done
else
echo "Using cached build of NSIS `cat $NSIS_PREFIX_DIR/done`"
fi
# Install NSIS
dpkg -i "$NSIS_PREFIX_DIR"/nsis-common_*.deb
dpkg -i "$NSIS_PREFIX_DIR"/nsis-doc_*.deb
dpkg -i "$NSIS_PREFIX_DIR"/nsis_*.deb
dpkg -i "$NSIS_PREFIX_DIR"/nsis-pluginapi_*.deb
# NSIS ShellExecAsUser plugin
NSISSHELLEXECASUSER_PREFIX_DIR="$DEP_DIR/nsis_shellexecuteasuser"