Browse Source

chore(CI): Use platform detection script in Windows dep build scripts

Allows future macOS configuration in each individual build script to not all be
duplicated. Also deduplicates current Windows arg checking and config setting.
reviewable/pr6542/r2
Anthony Bilinski 4 years ago
parent
commit
47fdb1a2e9
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 35
      buildscripts/build_ffmpeg.sh
  2. 43
      buildscripts/build_gdb_windows.sh
  3. 35
      buildscripts/build_gmp_windows.sh
  4. 45
      buildscripts/build_libexif.sh
  5. 43
      buildscripts/build_libexpat_windows.sh
  6. 16
      buildscripts/build_msgpack_c.sh
  7. 38
      buildscripts/build_openal.sh
  8. 43
      buildscripts/build_openssl.sh
  9. 41
      buildscripts/build_opus.sh
  10. 43
      buildscripts/build_qrencode.sh
  11. 35
      buildscripts/build_qt_windows.sh
  12. 41
      buildscripts/build_sodium.sh
  13. 45
      buildscripts/build_sqlcipher.sh
  14. 22
      buildscripts/build_toxcore.sh
  15. 36
      buildscripts/build_vpx.sh
  16. 2
      buildscripts/docker/Dockerfile.windows_builder

35
buildscripts/build_ffmpeg.sh

@ -6,45 +6,28 @@ @@ -6,45 +6,28 @@
set -euo pipefail
usage()
{
echo "Download and build ffmpeg for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
ARCH=""
source "${SCRIPT_DIR}/platform_detection.sh"
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "win32" ] && [ "$ARCH" != "win64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$(realpath "$0")")/download/download_ffmpeg.sh"
DEP_NAME="ffmpeg"
parse_arch "$@"
if [ "${ARCH}" == "win64" ]; then
FFMPEG_ARCH="x86_64"
CROSS_PREFIX="x86_64-w64-mingw32-"
else
FFMPEG_ARCH="x86"
CROSS_PREFIX="i686-w64-mingw32-"
fi
"${SCRIPT_DIR}/download/download_ffmpeg.sh"
./configure --arch=${FFMPEG_ARCH} \
--enable-gpl \
--enable-shared \
--disable-static \
--prefix=/windows/ \
"--prefix=${DEP_PREFIX}" \
--target-os="mingw32" \
--cross-prefix="${CROSS_PREFIX}" \
"--cross-prefix=${CROSS_PREFIX}" \
--pkg-config="pkg-config" \
--extra-cflags="-O2 -g0" \
--disable-debug \
@ -88,5 +71,5 @@ fi @@ -88,5 +71,5 @@ fi
--enable-decoder=mjpeg \
--enable-decoder=rawvideo
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

43
buildscripts/build_gdb_windows.sh

@ -6,38 +6,19 @@ @@ -6,38 +6,19 @@
set -euo pipefail
usage()
{
echo "Download and build gmp for windows"
echo "Usage: $0 --arch {win64|win32}"
}
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "win32" ] && [ "$ARCH" != "win64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
if [ "${ARCH}" == "win64" ]; then
HOST="x86_64-w64-mingw32"
else
HOST="i686-w64-mingw32"
fi
"$(dirname "$(realpath "$0")")/download/download_gdb.sh"
CFLAGS="-O2 -g0" ./configure --host="${HOST}" \
--prefix="/windows" \
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="gdb"
parse_arch "$@"
"${SCRIPT_DIR}/download/download_gdb.sh"
CFLAGS="-O2 -g0" ./configure "${HOST_OPTION}" \
--prefix="${DEP_PREFIX}" \
--enable-static \
--disable-shared
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

35
buildscripts/build_gmp_windows.sh

@ -6,38 +6,19 @@ @@ -6,38 +6,19 @@
set -euo pipefail
usage()
{
echo "Download and build gmp for windows"
echo "Usage: $0 --arch {win64|win32}"
}
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
source "${SCRIPT_DIR}/platform_detection.sh"
if [ "$ARCH" != "win32" ] && [ "$ARCH" != "win64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
DEP_NAME="gmp"
parse_arch "$@"
if [ "${ARCH}" == "win64" ]; then
HOST="x86_64-w64-mingw32"
else
HOST="i686-w64-mingw32"
fi
"$(dirname "$(realpath "$0")")/download/download_gmp.sh"
"${SCRIPT_DIR}/download/download_gmp.sh"
# https://gmplib.org/list-archives/gmp-discuss/2020-July/006519.html
CC_FOR_BUILD=gcc CFLAGS="-O2 -g0" ./configure --host="${HOST}" \
--prefix="/windows" \
CC_FOR_BUILD=gcc CFLAGS="-O2 -g0" ./configure "${HOST_OPTION}" \
--prefix="${DEP_PREFIX}" \
--enable-static \
--disable-shared
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

45
buildscripts/build_libexif.sh

@ -6,42 +6,21 @@ @@ -6,42 +6,21 @@
set -euo pipefail
usage()
{
echo "Download and build libexif for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "win32" ] && [ "$ARCH" != "win64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$(realpath "$0")")/download/download_libexif.sh"
if [ "${ARCH}" == "win64" ]; then
HOST="x86_64-w64-mingw32"
else
HOST="i686-w64-mingw32"
fi
CFLAGS="-O2 -g0" ./configure --host="${HOST}" \
--prefix=/windows/ \
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="libexif"
parse_arch "$@"
"${SCRIPT_DIR}/download/download_libexif.sh"
CFLAGS="-O2 -g0" ./configure "${HOST_OPTION}" \
"--prefix=${DEP_PREFIX}" \
--enable-shared \
--disable-static \
--disable-docs \
--disable-nls
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

43
buildscripts/build_libexpat_windows.sh

@ -6,38 +6,19 @@ @@ -6,38 +6,19 @@
set -euo pipefail
usage()
{
echo "Download and build libexpat for windows"
echo "Usage: $0 --arch {win64|win32}"
}
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "win32" ] && [ "$ARCH" != "win64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$(realpath "$0")")/download/download_libexpat.sh"
if [ "${ARCH}" == "win64" ]; then
HOST="x86_64-w64-mingw32"
else
HOST="i686-w64-mingw32"
fi
CFLAGS="-O2 -g0" ./configure --host="${HOST}" \
--prefix="/windows" \
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="libexpat"
parse_arch "$@"
"${SCRIPT_DIR}/download/download_libexpat.sh"
CFLAGS="-O2 -g0" ./configure "${HOST_OPTION}" \
--prefix="${DEP_PREFIX}" \
--enable-static \
--disable-shared
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

16
buildscripts/build_msgpack_c.sh

@ -5,14 +5,22 @@ @@ -5,14 +5,22 @@
set -euo pipefail
"$(dirname "$(realpath "$0")")/download/download_msgpack_c.sh"
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="msgpack-c"
parse_arch "$@"
"${SCRIPT_DIR}/download/download_msgpack_c.sh"
cmake .\
"-DCMAKE_INSTALL_PREFIX=${DEP_PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
"${CMAKE_TOOLCHAIN_FILE}" \
-DMSGPACK_BUILD_EXAMPLES=OFF \
-DMSGPACK_BUILD_TESTS=OFF \
.
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

38
buildscripts/build_openal.sh

@ -8,48 +8,24 @@ set -euo pipefail @@ -8,48 +8,24 @@ set -euo pipefail
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
usage()
{
echo "Download and build openal for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "win32" ] && [ "$ARCH" != "win64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="openal"
parse_arch "$@"
"${SCRIPT_DIR}/download/download_openal.sh"
patch -p1 < "${SCRIPT_DIR}/patches/openal-cmake-3-11.patch"
if [ "${ARCH}" == "win64" ]; then
MINGW_DIR="x86_64-w64-mingw32"
else
MINGW_DIR="x86-w64-mingw32"
fi
export CFLAGS="-fPIC"
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
cmake "-DCMAKE_INSTALL_PREFIX=${DEP_PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DALSOFT_UTILS=OFF \
-DALSOFT_EXAMPLES=OFF \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
"${CMAKE_TOOLCHAIN_FILE}" \
-DDSOUND_INCLUDE_DIR="/usr/${MINGW_DIR}/include" \
-DDSOUND_LIBRARY="/usr/${MINGW_DIR}/lib/libdsound.a" \
.
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

43
buildscripts/build_openssl.sh

@ -6,41 +6,26 @@ @@ -6,41 +6,26 @@
set -euo pipefail
usage()
{
echo "Download and build openssl for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [[ "$ARCH" == "win64" ]]; then
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="openssl"
parse_arch "$@"
if [[ "$SCRIPT_ARCH" == "win64" ]]; then
OPENSSL_ARCH="mingw64"
PREFIX="x86_64-w64-mingw32-"
elif [[ "$ARCH" == "win32" ]]; then
OPENSSL_ARCH="mingw"
PREFIX="i686-w64-mingw32-"
else
echo "Invalid architecture"
usage
exit 1
OPENSSL_ARCH="mingw"
fi
"$(dirname "$(realpath "$0")")/download/download_openssl.sh"
"${SCRIPT_DIR}/download/download_openssl.sh"
./Configure --prefix=/windows/ \
--openssldir=/windows/ssl \
./Configure "--prefix=${DEP_PREFIX}" \
"--openssldir=${DEP_PREFIX}/ssl" \
shared \
$OPENSSL_ARCH \
--cross-compile-prefix=${PREFIX}
--cross-compile-prefix=${CROSS_PREFIX}
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install_sw

41
buildscripts/build_opus.sh

@ -6,41 +6,22 @@ @@ -6,41 +6,22 @@
set -euo pipefail
usage()
{
echo "Download and build opus for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [[ "$ARCH" == "win64" ]]; then
HOST="x86_64-w64-mingw32"
elif [[ "$ARCH" == "win32" ]]; then
HOST="i686-w64-mingw32"
else
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$(realpath "$0")")/download/download_opus.sh"
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="opus"
parse_arch "$@"
"${SCRIPT_DIR}/download/download_opus.sh"
LDFLAGS="-fstack-protector" CFLAGS="-O2 -g0" \
./configure --host="${HOST}" \
--prefix=/windows/ \
./configure "${HOST_OPTION}" \
"--prefix=${DEP_PREFIX}" \
--enable-shared \
--disable-static \
--disable-extra-programs \
--disable-doc
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

43
buildscripts/build_qrencode.sh

@ -6,41 +6,22 @@ @@ -6,41 +6,22 @@
set -euo pipefail
usage()
{
echo "Download and build qrencode for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [[ "$ARCH" == "win64" ]]; then
HOST="x86_64-w64-mingw32"
elif [[ "$ARCH" == "win32" ]]; then
HOST="i686-w64-mingw32"
else
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$(realpath "$0")")/download/download_qrencode.sh"
CFLAGS="-O2 -g0" ./configure --host="${HOST}" \
--prefix=/windows \
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="qrencode"
parse_arch "$@"
"${SCRIPT_DIR}/download/download_qrencode.sh"
CFLAGS="-O2 -g0" ./configure "${HOST_OPTION}" \
--prefix="${DEP_PREFIX}" \
--enable-shared \
--disable-static \
--disable-sdltest \
--without-tools \
--without-debug
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

35
buildscripts/build_qt_windows.sh

@ -6,41 +6,22 @@ @@ -6,41 +6,22 @@
set -euo pipefail
usage()
{
echo "Download and build qt for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
ARCH=""
source "${SCRIPT_DIR}/platform_detection.sh"
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
DEP_NAME="qt"
parse_arch "$@"
if [[ "$ARCH" == "win64" ]]; then
CROSS="x86_64-w64-mingw32-"
elif [[ "$ARCH" == "win32" ]]; then
CROSS="i686-w64-mingw32-"
else
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$(realpath "$0")")/download/download_qt.sh"
"${SCRIPT_DIR}/download/download_qt.sh"
OPENSSL_LIBS=$(pkg-config --libs openssl)
export OPENSSL_LIBS
./configure -prefix /windows/ \
./configure -prefix "${DEP_PREFIX}" \
-release \
-shared \
-device-option CROSS_COMPILE=${CROSS} \
-device-option CROSS_COMPILE=${CROSS_PREFIX} \
-xplatform win32-g++ \
-openssl \
"$(pkg-config --cflags openssl)" \
@ -94,5 +75,5 @@ export OPENSSL_LIBS @@ -94,5 +75,5 @@ export OPENSSL_LIBS
-qt-pcre \
-opengl desktop
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

41
buildscripts/build_sodium.sh

@ -6,39 +6,20 @@ @@ -6,39 +6,20 @@
set -euo pipefail
usage()
{
echo "Download and build sodium for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [[ "$ARCH" == "win64" ]]; then
HOST="x86_64-w64-mingw32"
elif [[ "$ARCH" == "win32" ]]; then
HOST="i686-w64-mingw32"
else
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$(realpath "$0")")/download/download_sodium.sh"
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="sodium"
parse_arch "$@"
"${SCRIPT_DIR}/download/download_sodium.sh"
LDFLAGS="-fstack-protector" \
./configure --host="${HOST}" \
--prefix=/windows \
./configure "${HOST_OPTION}" \
"--prefix=${DEP_PREFIX}" \
--enable-shared \
--disable-static
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

45
buildscripts/build_sqlcipher.sh

@ -6,47 +6,28 @@ @@ -6,47 +6,28 @@
set -euo pipefail
usage()
{
echo "Download and build sqlcipher for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [[ "$ARCH" == "win64" ]]; then
HOST="x86_64-w64-mingw32"
elif [[ "$ARCH" == "win32" ]]; then
HOST="i686-w64-mingw32"
else
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$(realpath "$0")")/download/download_sqlcipher.sh"
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="sqlcipher"
parse_arch "$@"
"${SCRIPT_DIR}/download/download_sqlcipher.sh"
sed -i s/'if test "$TARGET_EXEEXT" = ".exe"'/'if test ".exe" = ".exe"'/g configure
sed -i 's|exec $PWD/mksourceid manifest|exec $PWD/mksourceid.exe manifest|g' tool/mksqlite3h.tcl
./configure --host="${HOST}" \
--prefix=/windows/ \
./configure "${HOST_OPTION}" \
"--prefix=${DEP_PREFIX}" \
--enable-shared \
--disable-static \
--enable-tempstore=yes \
CFLAGS="-O2 -g0 -DSQLITE_HAS_CODEC -I/windows/include/" \
LDFLAGS="-lcrypto -lgdi32 -L/windows/lib/" \
CFLAGS="-O2 -g0 -DSQLITE_HAS_CODEC -I${DEP_PREFIX}/include/" \
LDFLAGS="-lcrypto -lgdi32 -L${DEP_PREFIX}/lib/" \
LIBS="-lgdi32 -lws2_32"
sed -i s/"TEXE = $"/"TEXE = .exe"/ Makefile
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

22
buildscripts/build_toxcore.sh

@ -8,6 +8,11 @@ set -euo pipefail @@ -8,6 +8,11 @@ set -euo pipefail
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "${SCRIPT_DIR}/platform_detection.sh"
DEP_NAME="toxcore and toxext extensions"
parse_arch "$@"
build_toxcore() {
TOXCORE_SRC="$(realpath toxcore)"
@ -16,15 +21,15 @@ build_toxcore() { @@ -16,15 +21,15 @@ build_toxcore() {
"${SCRIPT_DIR}/download/download_toxcore.sh"
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
cmake "-DCMAKE_INSTALL_PREFIX=${DEP_PREFIX}" \
-DBOOTSTRAP_DAEMON=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_STATIC=OFF \
-DENABLE_SHARED=ON \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
"${CMAKE_TOOLCHAIN_FILE}" \
.
cmake --build . -- -j$(nproc)
cmake --build . -- "-j${MAKE_JOBS}"
cmake --build . --target install
popd >/dev/null
@ -38,12 +43,12 @@ build_toxext() { @@ -38,12 +43,12 @@ build_toxext() {
"${SCRIPT_DIR}/download/download_toxext.sh"
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
cmake "-DCMAKE_INSTALL_PREFIX=${DEP_PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
"${CMAKE_TOOLCHAIN_FILE}" \
.
cmake --build . -- -j$(nproc)
cmake --build . -- "-j${MAKE_JOBS}"
cmake --build . --target install
popd >/dev/null
@ -57,10 +62,11 @@ build_toxext_messages() { @@ -57,10 +62,11 @@ build_toxext_messages() {
"${SCRIPT_DIR}/download/download_toxext_messages.sh"
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
cmake "-DCMAKE_INSTALL_PREFIX=${DEP_PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
"${CMAKE_TOOLCHAIN_FILE}" \
.
cmake --build . -- "-j${MAKE_JOBS}"
cmake --build . --target install
popd >/dev/null

36
buildscripts/build_vpx.sh

@ -6,47 +6,33 @@ @@ -6,47 +6,33 @@
set -euo pipefail
usage()
{
echo "Download and build vpx for the windows cross compiling environment"
echo "Usage: $0 --arch {win64|win32}"
}
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
ARCH=""
source "${SCRIPT_DIR}/platform_detection.sh"
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
DEP_NAME="vpx"
parse_arch "$@"
if [[ "$ARCH" == "win64" ]]; then
if [[ "$SCRIPT_ARCH" == "win64" ]]; then
# 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
ARCH_FLAGS="-fno-asynchronous-unwind-tables"
VPX_ARCH="x86_64-win64-gcc"
CROSS="x86_64-w64-mingw32-"
elif [[ "$ARCH" == "win32" ]]; then
elif [[ "$SCRIPT_ARCH" == "win32" ]]; then
ARCH_FLAGS=""
VPX_ARCH="x86-win32-gcc"
CROSS="i686-w64-mingw32-"
else
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$(realpath "$0")")/download/download_vpx.sh"
"${SCRIPT_DIR}/download/download_vpx.sh"
patch -Np1 < "$(dirname "$0")"/patches/vpx.patch
patch -Np1 < "${SCRIPT_DIR}/patches/vpx.patch"
CFLAGS=${ARCH_FLAGS} CROSS="${CROSS}" \
CFLAGS=${ARCH_FLAGS} CROSS="${CROSS_PREFIX}" \
./configure --target="${VPX_ARCH}" \
--prefix=/windows/ \
"--prefix=${DEP_PREFIX}" \
--enable-shared \
--disable-static \
--enable-runtime-cpu-detect \
@ -55,5 +41,5 @@ CFLAGS=${ARCH_FLAGS} CROSS="${CROSS}" \ @@ -55,5 +41,5 @@ CFLAGS=${ARCH_FLAGS} CROSS="${CROSS}" \
--disable-docs \
--disable-unit-tests
make -j $(nproc)
make -j "${MAKE_JOBS}"
make install

2
buildscripts/docker/Dockerfile.windows_builder

@ -67,8 +67,6 @@ RUN mkdir -p /src/openssl && \ @@ -67,8 +67,6 @@ RUN mkdir -p /src/openssl && \
/build/build_openssl.sh --arch ${SCRIPT_ARCH} && \
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

Loading…
Cancel
Save