mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Update deps used in Windows build scripts
This commit is contained in:
parent
98c148179f
commit
0d5f85485b
|
@ -213,9 +213,9 @@ Build the container image based on the Dockerfile. The following options are ava
|
|||
| `SUPPORT_ARCH_x86_64` | Support building 64-bit toxcore. | "true" or "false" (case sensitive). | true |
|
||||
| `SUPPORT_TEST` | Support running toxcore automated tests. | "true" or "false" (case sensitive). | false |
|
||||
| `CROSS_COMPILE` | Cross-compiling. True for Docker, false for Cygwin. | "true" or "false" (case sensitive). | true |
|
||||
| `VERSION_OPUS` | Version of libopus to build toxcore with. | Git branch name. | v1.2.1 |
|
||||
| `VERSION_SODIUM` | Version of libsodium to build toxcore with. | Git branch name. | 1.0.18 |
|
||||
| `VERSION_VPX` | Version of libvpx to build toxcore with. | Git branch name. | v1.6.1 |
|
||||
| `VERSION_OPUS` | Version of libopus to build toxcore with. | Numeric version number. | 1.3.1 |
|
||||
| `VERSION_SODIUM` | Version of libsodium to build toxcore with. | Numeric version number. | 1.0.18 |
|
||||
| `VERSION_VPX` | Version of libvpx to build toxcore with. | Numeric version number. | 1.9.0 |
|
||||
|
||||
Example of building a container image with options
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
FROM debian:stretch-slim
|
||||
FROM debian:buster-slim
|
||||
|
||||
# Build-time environment variables
|
||||
ARG VERSION_SODIUM=1.0.18
|
||||
ARG VERSION_OPUS=v1.2.1
|
||||
ARG VERSION_VPX=v1.6.1
|
||||
ARG VERSION_OPUS=1.3.1
|
||||
ARG VERSION_VPX=1.9.0
|
||||
|
||||
ARG SUPPORT_TEST=false
|
||||
ARG SUPPORT_ARCH_i686=true
|
||||
|
|
|
@ -23,14 +23,16 @@ build() {
|
|||
export MAKEFLAGS=j"$(nproc)"
|
||||
export CFLAGS=-O3
|
||||
|
||||
CURL_OPTIONS="-L --connect-timeout 10"
|
||||
|
||||
cd /tmp
|
||||
rm -rf /tmp/*
|
||||
|
||||
echo
|
||||
echo "=== Building Sodium $VERSION_SODIUM $ARCH ==="
|
||||
git clone --depth=1 --branch="$VERSION_SODIUM" https://github.com/jedisct1/libsodium
|
||||
cd libsodium
|
||||
./autogen.sh
|
||||
curl $CURL_OPTIONS -O "https://download.libsodium.org/libsodium/releases/libsodium-$VERSION_SODIUM.tar.gz"
|
||||
tar -xf "libsodium-$VERSION_SODIUM.tar.gz"
|
||||
cd "libsodium-$VERSION_SODIUM"
|
||||
./configure --host="$WINDOWS_TOOLCHAIN" --prefix="$PREFIX_DIR" --disable-shared --enable-static
|
||||
make
|
||||
make install
|
||||
|
@ -38,17 +40,9 @@ build() {
|
|||
|
||||
echo
|
||||
echo "=== Building Opus $VERSION_OPUS $ARCH ==="
|
||||
if [ "$CROSS_COMPILE" = "true" ]; then
|
||||
git clone --depth=1 --branch="$VERSION_OPUS" https://github.com/xiph/opus
|
||||
cd opus
|
||||
./autogen.sh
|
||||
else
|
||||
# autogen.sh failed on Cygwin due to ltmain.sh symlink
|
||||
VERSION_OPUS="${VERSION_OPUS#?}" # remove first 'v'
|
||||
curl "https://archive.mozilla.org/pub/opus/opus-$VERSION_OPUS.tar.gz" -o opus.tar.gz
|
||||
tar xzf opus.tar.gz
|
||||
cd "opus-$VERSION_OPUS"
|
||||
fi
|
||||
curl $CURL_OPTIONS -O "https://archive.mozilla.org/pub/opus/opus-$VERSION_OPUS.tar.gz"
|
||||
tar -xf "opus-$VERSION_OPUS.tar.gz"
|
||||
cd "opus-$VERSION_OPUS"
|
||||
./configure --host="$WINDOWS_TOOLCHAIN" --prefix="$PREFIX_DIR" --disable-extra-programs --disable-doc --disable-shared --enable-static
|
||||
make
|
||||
make install
|
||||
|
@ -59,12 +53,18 @@ build() {
|
|||
LIB_VPX_TARGET=""
|
||||
if [ "$ARCH" = "i686" ]; then
|
||||
LIB_VPX_TARGET=x86-win32-gcc
|
||||
LIB_VPX_CFLAGS=""
|
||||
else
|
||||
LIB_VPX_TARGET=x86_64-win64-gcc
|
||||
# There is a bug in gcc that breaks avx512 on 64-bit Windows https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
|
||||
# VPX fails to build due to it.
|
||||
# This is a workaround as suggested in https://stackoverflow.com/questions/43152633
|
||||
LIB_VPX_CFLAGS="-fno-asynchronous-unwind-tables"
|
||||
fi
|
||||
git clone --depth=1 --branch="$VERSION_VPX" https://github.com/webmproject/libvpx
|
||||
cd libvpx
|
||||
CROSS="$WINDOWS_TOOLCHAIN"- ./configure --target="$LIB_VPX_TARGET" --prefix="$PREFIX_DIR" --disable-examples --disable-unit-tests --disable-shared --enable-static
|
||||
curl $CURL_OPTIONS "https://github.com/webmproject/libvpx/archive/v$VERSION_VPX.tar.gz" -o "libvpx-$VERSION_VPX.tar.gz"
|
||||
tar -xf "libvpx-$VERSION_VPX.tar.gz"
|
||||
cd "libvpx-$VERSION_VPX"
|
||||
CFLAGS="$LIB_VPX_CFLAGS" CROSS="$WINDOWS_TOOLCHAIN"- ./configure --target="$LIB_VPX_TARGET" --prefix="$PREFIX_DIR" --disable-examples --disable-unit-tests --disable-shared --enable-static
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
|
|
@ -55,10 +55,10 @@ build() {
|
|||
SET(CMAKE_RC_COMPILER $WINDOWS_TOOLCHAIN-windres)
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH /usr/$WINDOWS_TOOLCHAIN $DEP_PREFIX_DIR)
|
||||
" > windows_toolchain.cmake
|
||||
" >windows_toolchain.cmake
|
||||
|
||||
if [ "$ENABLE_TEST" = "true" ]; then
|
||||
echo "SET(CROSSCOMPILING_EMULATOR /usr/bin/wine)" >> windows_toolchain.cmake
|
||||
echo "SET(CROSSCOMPILING_EMULATOR /usr/bin/wine)" >>windows_toolchain.cmake
|
||||
fi
|
||||
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=windows_toolchain.cmake \
|
||||
|
|
|
@ -8,62 +8,47 @@ apt-get update
|
|||
|
||||
# Arch-independent packages required for building toxcore's dependencies and toxcore itself
|
||||
apt-get install -y \
|
||||
autoconf \
|
||||
automake \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
curl \
|
||||
git \
|
||||
libtool \
|
||||
libc-dev \
|
||||
make \
|
||||
pkg-config \
|
||||
tree \
|
||||
yasm
|
||||
autoconf \
|
||||
automake \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
curl \
|
||||
libtool \
|
||||
libc-dev \
|
||||
make \
|
||||
pkg-config \
|
||||
tree \
|
||||
yasm
|
||||
|
||||
# Arch-dependent packages required for building toxcore's dependencies and toxcore itself
|
||||
if [ "$SUPPORT_ARCH_i686" = "true" ]; then
|
||||
apt-get install -y \
|
||||
g++-mingw-w64-i686 \
|
||||
gcc-mingw-w64-i686
|
||||
apt-get install -y \
|
||||
g++-mingw-w64-i686 \
|
||||
gcc-mingw-w64-i686
|
||||
fi
|
||||
|
||||
if [ "$SUPPORT_ARCH_x86_64" = "true" ]; then
|
||||
apt-get install -y \
|
||||
g++-mingw-w64-x86-64 \
|
||||
gcc-mingw-w64-x86-64
|
||||
apt-get install -y \
|
||||
g++-mingw-w64-x86-64 \
|
||||
gcc-mingw-w64-x86-64
|
||||
fi
|
||||
|
||||
# Packages needed for running toxcore tests
|
||||
if [ "$SUPPORT_TEST" = "true" ]; then
|
||||
apt-get install -y \
|
||||
apt-transport-https \
|
||||
curl \
|
||||
gnupg \
|
||||
texinfo
|
||||
apt-get install -y \
|
||||
texinfo
|
||||
|
||||
# Add Wine package repository to use the latest Wine
|
||||
echo "deb https://dl.winehq.org/wine-builds/debian/ stretch main" >> /etc/apt/sources.list
|
||||
curl -o Release.key https://dl.winehq.org/wine-builds/winehq.key
|
||||
# Verify against a known good key fingerprint. --dry-run makes it so we don't actually import the key.
|
||||
if ! gpg --batch --dry-run --import --import-options import-show --fingerprint Release.key | grep 'D43F 6401 4536 9C51 D786 DDEA 76F1 A20F F987 672F'; then
|
||||
echo "Error: WineHQ's Debian package repository key fingerprint didn't match the expected one. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
apt-key add Release.key
|
||||
|
||||
dpkg --add-architecture i386
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
wine-devel \
|
||||
wine-devel-amd64 \
|
||||
wine-devel-dbg \
|
||||
winehq-devel
|
||||
dpkg --add-architecture i386
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
wine \
|
||||
wine32 \
|
||||
wine64
|
||||
fi
|
||||
|
||||
# Clean up to reduce image size
|
||||
apt-get clean
|
||||
rm -rf \
|
||||
/var/lib/apt/lists/* \
|
||||
/tmp/* \
|
||||
/var/tmp/*
|
||||
/var/lib/apt/lists/* \
|
||||
/tmp/* \
|
||||
/var/tmp/*
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
export VERSION_SODIUM="1.0.18"
|
||||
export VERSION_OPUS="v1.2.1"
|
||||
export VERSION_VPX="v1.6.1"
|
||||
export VERSION_OPUS="1.3.1"
|
||||
export VERSION_VPX="1.9.0"
|
||||
|
||||
export SUPPORT_TEST=false
|
||||
export SUPPORT_ARCH_i686=true
|
||||
|
|
Loading…
Reference in New Issue
Block a user