From 3de2e332eed772f41a1dbedba219510a18137bb6 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 00:17:24 +0100 Subject: [PATCH 01/63] external_deps: fix CFLAGS typo --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 9d519eb6db..d3d449213f 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -1030,7 +1030,7 @@ common_setup() { common_setup_arch() { case "${PLATFORM}" in *-amd64-*) - CLFLAGS+=' -march=x86-64 -mcx16' + CFLAGS+=' -march=x86-64 -mcx16' CXXFLAGS+=' -march=x86-64 -mcx16' ;; *-i686-*) From 29c7876c21efe6055648fe18c1b93f43a933c2ad Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 17:13:45 +0100 Subject: [PATCH 02/63] cmake: make mingw toolchains also look for CMAKE_PREFIX_PATH --- cmake/cross-toolchain-mingw32.cmake | 2 +- cmake/cross-toolchain-mingw64.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/cross-toolchain-mingw32.cmake b/cmake/cross-toolchain-mingw32.cmake index 3c97d7a0e6..46483be4be 100644 --- a/cmake/cross-toolchain-mingw32.cmake +++ b/cmake/cross-toolchain-mingw32.cmake @@ -8,7 +8,7 @@ set( CMAKE_CXX_COMPILER i686-w64-mingw32-g++ ) set( CMAKE_RC_COMPILER i686-w64-mingw32-windres ) # Target prefix -set( CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 ) +set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32;${CMAKE_PREFIX_PATH} ) # Find programs using host paths and headers/libraries using target paths set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) diff --git a/cmake/cross-toolchain-mingw64.cmake b/cmake/cross-toolchain-mingw64.cmake index fb308a4556..c0ffe2a84b 100644 --- a/cmake/cross-toolchain-mingw64.cmake +++ b/cmake/cross-toolchain-mingw64.cmake @@ -8,7 +8,7 @@ set( CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++ ) set( CMAKE_RC_COMPILER x86_64-w64-mingw32-windres ) # Target prefix -set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 ) +set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32;${CMAKE_PREFIX_PATH} ) # Find programs using host paths and headers/libraries using target paths set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) From 8af5fd5a9959c17ad56df5bf9f14c9d8cf5e7acc Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 15:54:34 +0100 Subject: [PATCH 03/63] cmake-sdl --- external_deps/build.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index d3d449213f..923893657c 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -49,6 +49,7 @@ LD='ld' AR='ar' RANLIB='ranlib' CONFIGURE_SHARED=(--disable-shared --enable-static) +CMAKE_SHARED=(-DBUILD_SHARED_LIBS=OFF) # Always reset flags, we heavily cross-compile and must not inherit any stray flag # from environment. CFLAGS='' @@ -341,10 +342,11 @@ build_sdl2() { ;; *) cd "${dir_name}" - # The default -O3 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O3" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" - make - make install + + "${CMAKE_CONFIGURE[@]}" + cmake --build build + cmake --install build + # Workaround for an SDL2 CMake bug, we need to provide # a bin/ directory even when nothing is used from it. mkdir -p "${PREFIX}/bin" @@ -1024,6 +1026,9 @@ common_setup() { mkdir -p "${PREFIX}/bin" mkdir -p "${PREFIX}/include" mkdir -p "${PREFIX}/lib" + CMAKE_CONFIGURE=(cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ + -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ + "${CMAKE_SHARED[@]}" ) export CC CXX LD AR RANLIB PKG_CONFIG PKG_CONFIG_PATH PATH CFLAGS CXXFLAGS CPPFLAGS LDFLAGS } @@ -1061,6 +1066,7 @@ common_setup_arch() { # supports %lld since Visual Studio 2013. common_setup_msvc() { CONFIGURE_SHARED=(--enable-shared --disable-static) + CMAKE_SHARED=(-DBUILD_SHARED_LIBS=ON) # Libtool bug prevents -static-libgcc from being set in LDFLAGS CC="${HOST}-gcc -static-libgcc" CXX="${HOST}-g++ -static-libgcc" From 784fbc9a34181a3b77c2ad0b2f55d87c1e89e917 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:01:58 +0100 Subject: [PATCH 04/63] jpeg-cmake --- external_deps/build.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 923893657c..60523e84e1 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -458,25 +458,28 @@ build_jpeg() { ;; esac - local jpeg_cmake_call=(cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ - -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ - -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ + local jpeg_cmake_args=(-DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ + -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ -DWITH_JPEG8=1) cd "${dir_name}" case "${PLATFORM}" in windows-*-mingw) - "${jpeg_cmake_call[@]}" -DCMAKE_TOOLCHAIN_FILE="${SCRIPT_DIR}/../cmake/cross-toolchain-mingw${BITNESS}.cmake" -DENABLE_SHARED=0 + jpeg_cmake_args+=(-DCMAKE_TOOLCHAIN_FILE="${SCRIPT_DIR}/../cmake/cross-toolchain-mingw${BITNESS}.cmake" \ + -DENABLE_SHARED=0) ;; windows-*-msvc) - "${jpeg_cmake_call[@]}" -DCMAKE_TOOLCHAIN_FILE="${SCRIPT_DIR}/../cmake/cross-toolchain-mingw${BITNESS}.cmake" -DENABLE_SHARED=1 + jpeg_cmake_args+=(-DCMAKE_TOOLCHAIN_FILE="${SCRIPT_DIR}/../cmake/cross-toolchain-mingw${BITNESS}.cmake" \ + -DENABLE_SHARED=1) ;; *) - "${jpeg_cmake_call[@]}" -DENABLE_SHARED=0 + jpeg_cmake_args+=(-DENABLE_SHARED=0) ;; esac - make -C build - make -C build install + + "${CMAKE_CONFIGURE[@]}" "${jpeg_cmake_args[@]}" + cmake --build build + cmake --install build } # Build WebP From 9e67d77ecc6550ea4bb778a47f5a6ea7598eb62d Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:07:49 +0100 Subject: [PATCH 05/63] cmake-toolchain --- external_deps/build.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 60523e84e1..96e76e83f1 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -50,6 +50,7 @@ AR='ar' RANLIB='ranlib' CONFIGURE_SHARED=(--disable-shared --enable-static) CMAKE_SHARED=(-DBUILD_SHARED_LIBS=OFF) +CMAKE_TOOLCHAIN='' # Always reset flags, we heavily cross-compile and must not inherit any stray flag # from environment. CFLAGS='' @@ -465,12 +466,10 @@ build_jpeg() { cd "${dir_name}" case "${PLATFORM}" in windows-*-mingw) - jpeg_cmake_args+=(-DCMAKE_TOOLCHAIN_FILE="${SCRIPT_DIR}/../cmake/cross-toolchain-mingw${BITNESS}.cmake" \ - -DENABLE_SHARED=0) + jpeg_cmake_args+=(-DENABLE_SHARED=0) ;; windows-*-msvc) - jpeg_cmake_args+=(-DCMAKE_TOOLCHAIN_FILE="${SCRIPT_DIR}/../cmake/cross-toolchain-mingw${BITNESS}.cmake" \ - -DENABLE_SHARED=1) + jpeg_cmake_args+=(-DENABLE_SHARED=1) ;; *) jpeg_cmake_args+=(-DENABLE_SHARED=0) @@ -1013,8 +1012,10 @@ build_wipe() { # Common setup code common_setup() { HOST="${2}" + "common_setup_${1}" common_setup_arch + DOWNLOAD_DIR="${WORK_DIR}/download_cache" PKG_BASEDIR="${PLATFORM}_${DEPS_VERSION}" BUILD_BASEDIR="build-${PKG_BASEDIR}" @@ -1025,13 +1026,21 @@ common_setup() { PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig" CPPFLAGS+=" -I${PREFIX}/include" LDFLAGS+=" -L${PREFIX}/lib" + mkdir -p "${DOWNLOAD_DIR}" mkdir -p "${PREFIX}/bin" mkdir -p "${PREFIX}/include" mkdir -p "${PREFIX}/lib" + CMAKE_CONFIGURE=(cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ "${CMAKE_SHARED[@]}" ) + + if [ -n "${CMAKE_TOOLCHAIN}" ] + then + CMAKE_CONFIGURE+=("${CMAKE_TOOLCHAIN}") + fi + export CC CXX LD AR RANLIB PKG_CONFIG PKG_CONFIG_PATH PATH CFLAGS CXXFLAGS CPPFLAGS LDFLAGS } @@ -1086,6 +1095,7 @@ common_setup_mingw() { AR="${HOST}-ar" RANLIB="${HOST}-ranlib" CFLAGS+=' -D__USE_MINGW_ANSI_STDIO=0' + CMAKE_TOOLCHAIN="${SCRIPT_DIR}/../cmake/cross-toolchain-mingw${BITNESS}.cmake" } common_setup_macos() { From 4bffd814393ffaa5a828f0181502fdc43a4d1427 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:08:14 +0100 Subject: [PATCH 06/63] jpeg-simplify --- external_deps/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 96e76e83f1..317c07c161 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -465,9 +465,6 @@ build_jpeg() { cd "${dir_name}" case "${PLATFORM}" in - windows-*-mingw) - jpeg_cmake_args+=(-DENABLE_SHARED=0) - ;; windows-*-msvc) jpeg_cmake_args+=(-DENABLE_SHARED=1) ;; From 1001939e3e9c688dca1275294e1f3e46af20520c Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:13:26 +0100 Subject: [PATCH 07/63] openal-cmake --- external_deps/build.sh | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 317c07c161..aae1aa7e43 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -521,15 +521,10 @@ build_openal() { local dir_name="openal-soft-${OPENAL_VERSION}-bin" local archive_name="${dir_name}.zip" ;; - macos-*-*|linux-*-*) + *) local dir_name="openal-soft-${OPENAL_VERSION}" local archive_name="${dir_name}.tar.bz2" - local openal_cmake_call=(cmake -S . -B . -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ - -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ - -DCMAKE_BUILD_TYPE=Release -DALSOFT_EXAMPLES=OFF) - ;; - *) - log error 'Unsupported platform for OpenAL' + local openal_cmake_args=(-DCMAKE_BUILD_TYPE=Release -DALSOFT_EXAMPLES=OFF) ;; esac @@ -556,16 +551,19 @@ build_openal() { ;; macos-*-*) cd "${dir_name}" - "${openal_cmake_call[@]}" - make - make install + + "${CMAKE_CONFIGURE[@]}" + cmake --build build + cmake --install build + install_name_tool -id "@rpath/libopenal.${OPENAL_VERSION}.dylib" "${PREFIX}/lib/libopenal.${OPENAL_VERSION}.dylib" ;; - linux-*-*) + *) cd "${dir_name}" - "${openal_cmake_call[@]}" -DLIBTYPE=STATIC - make - make install + + "${CMAKE_CONFIGURE[@]}" -DLIBTYPE=STATIC + cmake --build build + cmake --install build ;; esac } From 7d227c6e492ca81f5f04f40106e0ed39530f975e Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:15:52 +0100 Subject: [PATCH 08/63] ogg-cmake --- external_deps/build.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index aae1aa7e43..11a6793ebb 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -579,13 +579,14 @@ build_ogg() { "${download_only}" && return cd "${dir_name}" + # This header breaks the vorbis and opusfile Mac builds cat <(echo '#include ') include/ogg/os_types.h > os_types.tmp mv os_types.tmp include/ogg/os_types.h - # The user-provided CFLAGS doesn't drop the default -O2 - ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" - make - make install + + "${CMAKE_CONFIGURE[@]}" + cmake --build build + cmake --install build } # Build Vorbis From e12fc8b666b4a61c12d02f1b62078e816e9ad23f Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:20:10 +0100 Subject: [PATCH 09/63] vorbis-cmake --- external_deps/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 11a6793ebb..c627600f2d 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -600,10 +600,10 @@ build_vorbis() { "${download_only}" && return cd "${dir_name}" - # The user-provided CFLAGS doesn't drop the default -O3 - ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" --disable-examples - make - make install + + "${CMAKE_CONFIGURE[@]}" -DOPUS_BUILD_PROGRAMS=OFF -DOPUS_BUILD_TESTING=OFF + cmake --build build + cmake --install build } # Build Opus From 1aa68f26d1fcbebc505fbd59ee649ca3941b6a53 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:24:33 +0100 Subject: [PATCH 10/63] cmake-shared --- external_deps/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index c627600f2d..c3049371b4 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -49,7 +49,7 @@ LD='ld' AR='ar' RANLIB='ranlib' CONFIGURE_SHARED=(--disable-shared --enable-static) -CMAKE_SHARED=(-DBUILD_SHARED_LIBS=OFF) +CMAKE_SHARED='OFF' CMAKE_TOOLCHAIN='' # Always reset flags, we heavily cross-compile and must not inherit any stray flag # from environment. @@ -1030,7 +1030,7 @@ common_setup() { CMAKE_CONFIGURE=(cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ - "${CMAKE_SHARED[@]}" ) + -DBUILD_SHARED_LIBS="${CMAKE_SHARED}" ) if [ -n "${CMAKE_TOOLCHAIN}" ] then @@ -1074,7 +1074,7 @@ common_setup_arch() { # supports %lld since Visual Studio 2013. common_setup_msvc() { CONFIGURE_SHARED=(--enable-shared --disable-static) - CMAKE_SHARED=(-DBUILD_SHARED_LIBS=ON) + CMAKE_SHARED='ON' # Libtool bug prevents -static-libgcc from being set in LDFLAGS CC="${HOST}-gcc -static-libgcc" CXX="${HOST}-g++ -static-libgcc" From 68066321be85f32f3e48ab3b7faacb59e19f75eb Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:26:12 +0100 Subject: [PATCH 11/63] jpeg-simplify --- external_deps/build.sh | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index c3049371b4..99157c69eb 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -459,21 +459,14 @@ build_jpeg() { ;; esac - local jpeg_cmake_args=(-DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ + cd "${dir_name}" + + "${CMAKE_CONFIGURE[@]}" \ + -DENABLE_SHARED="${CMAKE_SHARED}" \ + -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ -DWITH_JPEG8=1) - cd "${dir_name}" - case "${PLATFORM}" in - windows-*-msvc) - jpeg_cmake_args+=(-DENABLE_SHARED=1) - ;; - *) - jpeg_cmake_args+=(-DENABLE_SHARED=0) - ;; - esac - - "${CMAKE_CONFIGURE[@]}" "${jpeg_cmake_args[@]}" cmake --build build cmake --install build } From a36c4f99f8751d5be009cfad7991cd889553373a Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:28:53 +0100 Subject: [PATCH 12/63] openal-cmake --- external_deps/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 99157c69eb..7c33ab9dae 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -545,7 +545,7 @@ build_openal() { macos-*-*) cd "${dir_name}" - "${CMAKE_CONFIGURE[@]}" + "${CMAKE_CONFIGURE[@]}" -DBUILD_SHARED_LIBRS=ON cmake --build build cmake --install build @@ -554,7 +554,7 @@ build_openal() { *) cd "${dir_name}" - "${CMAKE_CONFIGURE[@]}" -DLIBTYPE=STATIC + "${CMAKE_CONFIGURE[@]}" cmake --build build cmake --install build ;; From d594398b50e8e67decec304bd2ee7b2f894d6868 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:29:21 +0100 Subject: [PATCH 13/63] jpeg-simplify --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 7c33ab9dae..850a334b46 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -465,7 +465,7 @@ build_jpeg() { -DENABLE_SHARED="${CMAKE_SHARED}" \ -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ - -DWITH_JPEG8=1) + -DWITH_JPEG8=1 cmake --build build cmake --install build From 831c7c9f966929f221312eeba33c207a1ddfa50b Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:35:40 +0100 Subject: [PATCH 14/63] webp-cmake --- external_deps/build.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 850a334b46..e53d9725d3 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -482,10 +482,23 @@ build_webp() { "${download_only}" && return cd "${dir_name}" - # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" --disable-libwebpdemux "${CONFIGURE_SHARED[@]}" - make - make install + + # WEBP_LINK_STATIC is ON by default + + "${CMAKE_CONFIGURE[@]}" \ + -DWEBP_BUILD_ANIM_UTILS=OFF \ + -DWEBP_BUILD_CWEBP=OFF \ + -DWEBP_BUILD_DWEBP=OFF \ + -DWEBP_BUILD_EXTRAS=OFF \ + -DWEBP_BUILD_GIF2WEBP=OFF \ + -DWEBP_BUILD_IMG2WEBP=OFF \ + -DWEBP_BUILD_LIBWEBPMUX=OFF \ + -DWEBP_BUILD_VWEBP=OFF \ + -DWEBP_BUILD_WEBPINFO=OFF \ + -DWEBP_BUILD_WEBPMUX=OFF + + cmake --build build + cmake --install build } # Build FreeType From 3b47ffcdc7b5e7ad6cd0010418ac5d908474c0a4 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:36:20 +0100 Subject: [PATCH 15/63] openal-cmake --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index e53d9725d3..c005f164e7 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -558,7 +558,7 @@ build_openal() { macos-*-*) cd "${dir_name}" - "${CMAKE_CONFIGURE[@]}" -DBUILD_SHARED_LIBRS=ON + "${CMAKE_CONFIGURE[@]}" -DBUILD_SHARED_LIBS=ON cmake --build build cmake --install build From 34cec7517dfadbb4ecab688ff92e18512094c186 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:38:23 +0100 Subject: [PATCH 16/63] vorbis-cmake --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index c005f164e7..5c29ce9f96 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -607,7 +607,7 @@ build_vorbis() { cd "${dir_name}" - "${CMAKE_CONFIGURE[@]}" -DOPUS_BUILD_PROGRAMS=OFF -DOPUS_BUILD_TESTING=OFF + "${CMAKE_CONFIGURE[@]}" cmake --build build cmake --install build } From c022b44367bc0aab31fa8d44472d849423926b23 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:42:38 +0100 Subject: [PATCH 17/63] opus-cmake --- external_deps/build.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 5c29ce9f96..13265d67d6 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -623,18 +623,19 @@ build_opus() { "${download_only}" && return cd "${dir_name}" - # The default -O2 is dropped when there's user-provided CFLAGS. + + local opus_cmake_args=(-DOPUS_BUILD_PROGRAMS=OFF -DOPUS_BUILD_TESTING=OFF) + case "${PLATFORM}" in windows-*-*) # With MinGW _FORTIFY_SOURCE (added by configure) can only by used with -fstack-protector enabled. - CFLAGS="${CFLAGS} -O2 -D_FORTIFY_SOURCE=0" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" - ;; - *) - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" + opus_cmake_args+=(-DCMAKE_C_FLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0") ;; esac - make - make install + + "${CMAKE_CONFIGURE[@]}" "${opus_cmake_args[@]}" + cmake --build build + cmake --install build } # Build OpusFile From 85417e0e303ecbe55002b8ef4eb3dfbc1da9e244 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:51:16 +0100 Subject: [PATCH 18/63] zlib-cmake --- external_deps/build.sh | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 13265d67d6..16f9ca07cf 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -189,18 +189,11 @@ build_zlib() { "${download_only}" && return cd "${dir_name}" - case "${PLATFORM}" in - windows-*-*) - LOC="${CFLAGS}" make -f win32/Makefile.gcc PREFIX="${HOST}-" - make -f win32/Makefile.gcc install BINARY_PATH="${PREFIX}/bin" LIBRARY_PATH="${PREFIX}/lib" INCLUDE_PATH="${PREFIX}/include" SHARED_MODE=1 - ;; - *) - # The default -O3 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O3" ./configure --prefix="${PREFIX}" --libdir="${PREFIX}/lib" --static --const - make - make install - ;; - esac + + # The default -O3 is dropped when there's user-provided CFLAGS. + "${CMAKE_CONFIGURE[@]}" -DCMAKE_CFLAGS="${CFLAGS} -DZLIB_CONST" + cmake --build build + cmake --install build } # Build GMP From 79258939a45fa49bbb9ef824858b881bee0926f0 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:52:33 +0100 Subject: [PATCH 19/63] cmake-toolchain --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 16f9ca07cf..9ea5b95a30 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -1034,7 +1034,7 @@ common_setup() { if [ -n "${CMAKE_TOOLCHAIN}" ] then - CMAKE_CONFIGURE+=("${CMAKE_TOOLCHAIN}") + CMAKE_CONFIGURE+=(-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN}") fi export CC CXX LD AR RANLIB PKG_CONFIG PKG_CONFIG_PATH PATH CFLAGS CXXFLAGS CPPFLAGS LDFLAGS From 805e5dee0fe0c2d807284334fda44f1ee66b7708 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 16:56:52 +0100 Subject: [PATCH 20/63] zlib-cmake --- external_deps/build.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 9ea5b95a30..68c5f2ecbc 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -190,8 +190,15 @@ build_zlib() { cd "${dir_name}" - # The default -O3 is dropped when there's user-provided CFLAGS. - "${CMAKE_CONFIGURE[@]}" -DCMAKE_CFLAGS="${CFLAGS} -DZLIB_CONST" + local zlib_cmake_args=(-DCMAKE_C_FLAGS="${CFLAGS} -DZLIB_CONST") + + case "${PLATFORM}" in + windows-*-*) + zlib_cmake_args+=(-DBUILD_SHARED_LIBS=ON) + ;; + esac + + "${CMAKE_CONFIGURE[@]}" "${zlib_cmake_args[@]}" cmake --build build cmake --install build } @@ -1279,7 +1286,8 @@ if [ "${#}" -lt "2" ]; then fi # Enable parallel build -export MAKEFLAGS="-j`nproc 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null || echo 1`" +export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null || echo 1)" +export MAKEFLAGS="-j${CMAKE_BUILD_PARALLEL_LEVEL}" # Setup platform platform="${1}"; shift From af189d48ea91abe2001c29e12a4517db95a412eb Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 22:52:39 +0100 Subject: [PATCH 21/63] cmake-implicit-cflags --- external_deps/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 68c5f2ecbc..adc17ec4f7 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -1036,7 +1036,6 @@ common_setup() { mkdir -p "${PREFIX}/lib" CMAKE_CONFIGURE=(cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ - -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ -DBUILD_SHARED_LIBS="${CMAKE_SHARED}" ) if [ -n "${CMAKE_TOOLCHAIN}" ] From e7e7a8a39a53fb8b6df98fa3c4c8238cbd9469d3 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 22:55:50 +0100 Subject: [PATCH 22/63] cmake --- external_deps/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index adc17ec4f7..58751cc79b 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -1035,7 +1035,8 @@ common_setup() { mkdir -p "${PREFIX}/include" mkdir -p "${PREFIX}/lib" - CMAKE_CONFIGURE=(cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ + CMAKE_CONFIGURE=(cmake -S . -B build \ + -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_SHARED_LIBS="${CMAKE_SHARED}" ) if [ -n "${CMAKE_TOOLCHAIN}" ] From c1e4410fec06c0bcad3ab27a19f3f0648e38dfb0 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:03:43 +0100 Subject: [PATCH 23/63] cmake-build --- external_deps/build.sh | 63 +++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 58751cc79b..2c05f4d237 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -138,6 +138,22 @@ download_extract() { extract "${tarball_file}" "${extract_dir}" } +cmake_build() { + local cmake_args=() + if [ -n "${CMAKE_TOOLCHAIN}" ] + then + cmake_args+=(-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN}") + fi + + cmake -S . -B build \ + -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ + -DBUILD_SHARED_LIBS="${CMAKE_SHARED}" \ + "${cmake_args[@]}" + + cmake --build build + cmake --install build +} + # Build pkg-config build_pkgconfig() { local dir_name="pkg-config-${PKGCONFIG_VERSION}" @@ -198,9 +214,7 @@ build_zlib() { ;; esac - "${CMAKE_CONFIGURE[@]}" "${zlib_cmake_args[@]}" - cmake --build build - cmake --install build + cmake_build "${zlib_cmake_args[@]}" } # Build GMP @@ -344,9 +358,7 @@ build_sdl2() { *) cd "${dir_name}" - "${CMAKE_CONFIGURE[@]}" - cmake --build build - cmake --install build + cmake_build # Workaround for an SDL2 CMake bug, we need to provide # a bin/ directory even when nothing is used from it. @@ -461,14 +473,12 @@ build_jpeg() { cd "${dir_name}" - "${CMAKE_CONFIGURE[@]}" \ + cmake_build \ -DENABLE_SHARED="${CMAKE_SHARED}" \ -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ -DWITH_JPEG8=1 - cmake --build build - cmake --install build } # Build WebP @@ -485,7 +495,7 @@ build_webp() { # WEBP_LINK_STATIC is ON by default - "${CMAKE_CONFIGURE[@]}" \ + cmake_build \ -DWEBP_BUILD_ANIM_UTILS=OFF \ -DWEBP_BUILD_CWEBP=OFF \ -DWEBP_BUILD_DWEBP=OFF \ @@ -496,9 +506,6 @@ build_webp() { -DWEBP_BUILD_VWEBP=OFF \ -DWEBP_BUILD_WEBPINFO=OFF \ -DWEBP_BUILD_WEBPMUX=OFF - - cmake --build build - cmake --install build } # Build FreeType @@ -558,18 +565,15 @@ build_openal() { macos-*-*) cd "${dir_name}" - "${CMAKE_CONFIGURE[@]}" -DBUILD_SHARED_LIBS=ON - cmake --build build - cmake --install build + cmake_build \ + -DBUILD_SHARED_LIBS=ON install_name_tool -id "@rpath/libopenal.${OPENAL_VERSION}.dylib" "${PREFIX}/lib/libopenal.${OPENAL_VERSION}.dylib" ;; *) cd "${dir_name}" - "${CMAKE_CONFIGURE[@]}" - cmake --build build - cmake --install build + cmake_build ;; esac } @@ -590,9 +594,7 @@ build_ogg() { cat <(echo '#include ') include/ogg/os_types.h > os_types.tmp mv os_types.tmp include/ogg/os_types.h - "${CMAKE_CONFIGURE[@]}" - cmake --build build - cmake --install build + cmake_build } # Build Vorbis @@ -607,9 +609,7 @@ build_vorbis() { cd "${dir_name}" - "${CMAKE_CONFIGURE[@]}" - cmake --build build - cmake --install build + cmake_build } # Build Opus @@ -633,9 +633,7 @@ build_opus() { ;; esac - "${CMAKE_CONFIGURE[@]}" "${opus_cmake_args[@]}" - cmake --build build - cmake --install build + cmake_build "${opus_cmake_args[@]}" } # Build OpusFile @@ -1035,15 +1033,6 @@ common_setup() { mkdir -p "${PREFIX}/include" mkdir -p "${PREFIX}/lib" - CMAKE_CONFIGURE=(cmake -S . -B build \ - -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ - -DBUILD_SHARED_LIBS="${CMAKE_SHARED}" ) - - if [ -n "${CMAKE_TOOLCHAIN}" ] - then - CMAKE_CONFIGURE+=(-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN}") - fi - export CC CXX LD AR RANLIB PKG_CONFIG PKG_CONFIG_PATH PATH CFLAGS CXXFLAGS CPPFLAGS LDFLAGS } From fb5298493b04f87473238b3203e74f0bafd69469 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:07:33 +0100 Subject: [PATCH 24/63] configure-build --- external_deps/build.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/external_deps/build.sh b/external_deps/build.sh index 2c05f4d237..24ea1b59a1 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -138,6 +138,18 @@ download_extract() { extract "${tarball_file}" "${extract_dir}" } +configure_build() { + ./configure \ + --host="${HOST}" \ + --prefix="${PREFIX}" \ + --libdir="${PREFIX}/lib" \ + "${CONFIGURE_SHARED[@]}" \ + "${@}" + + make + make install +} + cmake_build() { local cmake_args=() if [ -n "${CMAKE_TOOLCHAIN}" ] From 63e9c8cdcae580c435c3b07780766a4942f22bdd Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:07:48 +0100 Subject: [PATCH 25/63] cmake-build --- external_deps/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 24ea1b59a1..22afb30da7 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -160,7 +160,8 @@ cmake_build() { cmake -S . -B build \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_SHARED_LIBS="${CMAKE_SHARED}" \ - "${cmake_args[@]}" + "${cmake_args[@]}" \ + "${@}" cmake --build build cmake --install build From f502ef14fba5f51a19653e7d2c55d6caf013188a Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:13:08 +0100 Subject: [PATCH 26/63] many-configure --- external_deps/build.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 22afb30da7..bd23d20247 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -243,6 +243,7 @@ build_gmp() { "${download_only}" && return cd "${dir_name}" + case "${PLATFORM}" in windows-*-msvc) # Configure script gets confused if we override the compiler. Shouldn't @@ -254,19 +255,20 @@ build_gmp() { ;; esac - # The default -O2 is dropped when there's user-provided CFLAGS. + local gmp_configure_args=() + case "${PLATFORM}" in macos-*-*) # The assembler objects are incompatible with PIE - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" --disable-assembly + gmp_configure_args+=(--disable-assembly) ;; *) - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" ;; esac - make - make install + # The default -O2 is dropped when there's user-provided CFLAGS. + CFLAGS="${CFLAGS} -O2" configure_build "${gmp_configure_args[@]}" + case "${PLATFORM}" in windows-*-msvc) export CC="${CC_BACKUP}" @@ -287,10 +289,9 @@ build_nettle() { "${download_only}" && return cd "${dir_name}" + # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" - make - make install + CFLAGS="${CFLAGS} -O2" configure_build } # Build cURL @@ -428,10 +429,9 @@ build_png() { "${download_only}" && return cd "${dir_name}" + # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" - make - make install + CFLAGS="${CFLAGS} -O2" configure_build } # Build JPEG From 15d50d038ee5e84b1f574abaab7858dd42d76e77 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:29:58 +0100 Subject: [PATCH 27/63] cmake-curl --- external_deps/build.sh | 57 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index bd23d20247..1d577b31da 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -306,10 +306,59 @@ build_curl() { "${download_only}" && return cd "${dir_name}" - # The user-provided CFLAGS doesn't drop the default -O2 - ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" --without-ssl --without-libssh2 --without-librtmp --without-libidn2 --without-brotli --without-zstd --disable-file --disable-ldap --disable-crypto-auth --disable-gopher --disable-ftp --disable-tftp --disable-dict --disable-imap --disable-mqtt --disable-smtp --disable-pop3 --disable-telnet --disable-rtsp --disable-threaded-resolver --disable-alt-svc "${CONFIGURE_SHARED[@]}" - make - make install + + cmake_build \ + -DBUILD_TESTING=OFF \ + -DCURL_ENABLE_SSL=OFF \ + -DENABLE_THREADED_RESOLVER=OFF \ + -DUSE_LIBIDN2=OFF \ + -DCURL_BROTLI=OFF \ + -DCURL_ZLIB=ON \ + -DCURL_ZSTD=OFF \ + -DENABLE_UNIX_SOCKETS=OFF \ + -DCURL_USE_BEARSSL=OFF \ + -DCURL_USE_GSSAPI=OFF \ + -DCURL_USE_LIBSSH=OFF \ + -DCURL_USE_LIBSSH2=OFF \ + -DCURL_USE_MBEDTLS=OFF \ + -DCURL_USE_NSS=OFF \ + -DCURL_USE_OPENSSL=OFF \ + -DCURL_USE_WOLFSSL=OFF \ + -DCURL_DISABLE_ALTSVC=ON \ + -DCURL_DISABLE_COOKIES=ON \ + -DCURL_DISABLE_CRYPTO_AUTH=ON \ + -DCURL_DISABLE_DICT=ON \ + -DCURL_DISABLE_DOH=ON \ + -DCURL_DISABLE_FILE=ON \ + -DCURL_DISABLE_FTP=ON \ + -DCURL_DISABLE_GETOPTIONS=ON \ + -DCURL_DISABLE_GOPHER=ON \ + -DCURL_DISABLE_HSTS=ON \ + -DCURL_DISABLE_HTTP=ON \ + -DCURL_DISABLE_HTTP_AUTH=ON \ + -DCURL_DISABLE_IMAP=ON \ + -DCURL_DISABLE_LDAP=ON \ + -DCURL_DISABLE_LDAPS=ON \ + -DCURL_DISABLE_LIBCURL_OPTION=ON \ + -DCURL_DISABLE_MIME=ON \ + -DCURL_DISABLE_MQTT=ON \ + -DCURL_DISABLE_NETRC=ON \ + -DCURL_DISABLE_NTLM=ON \ + -DCURL_DISABLE_PARSEDATE=ON \ + -DCURL_DISABLE_POP3=ON \ + -DCURL_DISABLE_PROGRESS_METER=ON \ + -DCURL_DISABLE_PROXY=ON \ + -DCURL_DISABLE_RTSP=ON \ + -DCURL_DISABLE_SHUFFLE_DNS=ON \ + -DCURL_DISABLE_SMB=ON \ + -DCURL_DISABLE_SMTP=ON \ + -DCURL_DISABLE_SOCKETPAIR=ON \ + -DCURL_DISABLE_TELNET=ON \ + -DCURL_DISABLE_TFTP=ON + + # Already disabled by other options. + # -DCURL_USE_OPENLDAP=OFF \ + # -DCURL_DISABLE_OPENSSL_AUTO_LOAD=ON \ } # Build SDL2 From b9cc57d7c68206606192bf1b9e9ef9484cb8646d Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:35:21 +0100 Subject: [PATCH 28/63] opusfile-configure --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 1d577b31da..a23a52d7a7 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -710,7 +710,7 @@ build_opusfile() { cd "${dir_name}" # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" --disable-http + CFLAGS="${CFLAGS} -O2" configure_build --disable-http make make install } From 7bdbb78ac6a32aaed26503c26ba66f5892a060dd Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:33:50 +0100 Subject: [PATCH 29/63] configure-shared --- external_deps/build.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index a23a52d7a7..f25ac91027 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -48,8 +48,7 @@ CXX='false' LD='ld' AR='ar' RANLIB='ranlib' -CONFIGURE_SHARED=(--disable-shared --enable-static) -CMAKE_SHARED='OFF' +SHARED_LIBS='OFF' CMAKE_TOOLCHAIN='' # Always reset flags, we heavily cross-compile and must not inherit any stray flag # from environment. @@ -139,11 +138,18 @@ download_extract() { } configure_build() { + local configure_args=(--disable-shared --enable-static) + + if [ "${USE_SHARED}" = 'ON' ] + then + configure_args=(--enable-shared --disable-static) + fi + ./configure \ --host="${HOST}" \ --prefix="${PREFIX}" \ --libdir="${PREFIX}/lib" \ - "${CONFIGURE_SHARED[@]}" \ + "${configure_args[@]}" \ "${@}" make @@ -159,7 +165,7 @@ cmake_build() { cmake -S . -B build \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ - -DBUILD_SHARED_LIBS="${CMAKE_SHARED}" \ + -DBUILD_SHARED_LIBS="${SHARED_LIBS}" \ "${cmake_args[@]}" \ "${@}" @@ -536,7 +542,7 @@ build_jpeg() { cd "${dir_name}" cmake_build \ - -DENABLE_SHARED="${CMAKE_SHARED}" \ + -DENABLE_SHARED="${SHARED_LIBS}" \ -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ -DWITH_JPEG8=1 @@ -1131,8 +1137,7 @@ common_setup_arch() { # the Windows build of Lua is only used in developer gamelogic builds, and Microsoft # supports %lld since Visual Studio 2013. common_setup_msvc() { - CONFIGURE_SHARED=(--enable-shared --disable-static) - CMAKE_SHARED='ON' + SHARED_LIBS='ON' # Libtool bug prevents -static-libgcc from being set in LDFLAGS CC="${HOST}-gcc -static-libgcc" CXX="${HOST}-g++ -static-libgcc" From 234cec296d6bb6b4ca79e5dce26e41669803b661 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:36:17 +0100 Subject: [PATCH 30/63] png-cmake --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index f25ac91027..ddb9231d72 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -486,7 +486,7 @@ build_png() { cd "${dir_name}" # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" configure_build + cmake_build } # Build JPEG From 4e1e0a1d0eac6cdede7779733ae452afe95a12ca Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:40:33 +0100 Subject: [PATCH 31/63] freetype-cmake --- external_deps/build.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index ddb9231d72..5c7a704f0d 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -587,10 +587,20 @@ build_freetype() { "${download_only}" && return cd "${dir_name}" - # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" "${CONFIGURE_SHARED[@]}" --without-bzip2 --without-png --with-harfbuzz=no --with-brotli=no - make - make install + + cmake_build \ + -DFT_DISABLE_BROTLI=OFF \ + -DFT_DISABLE_BZIP2=OFF \ + -DFT_DISABLE_HARFBUZZ=OFF \ + -DFT_DISABLE_PNG=OFF \ + -DFT_DISABLE_ZLIB=OFF \ + -DFT_ENABLE_ERROR_STRINGS=OFF \ + -DFT_REQUIRE_BROTLI=OFF \ + -DFT_REQUIRE_BZIP2=OFF \ + -DFT_REQUIRE_HARFBUZZ=OFF \ + -DFT_REQUIRE_PNG=OFF \ + -DFT_REQUIRE_ZLIB=OFF + cp -a "${PREFIX}/include/freetype2" "${PREFIX}/include/freetype" mv "${PREFIX}/include/freetype" "${PREFIX}/include/freetype2/freetype" } From b3d32947d8354f27f4287f61e8a1d4cb92037aa9 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:41:17 +0100 Subject: [PATCH 32/63] freetype-overwrite --- external_deps/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 5c7a704f0d..fe75ad8ef2 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -600,9 +600,6 @@ build_freetype() { -DFT_REQUIRE_HARFBUZZ=OFF \ -DFT_REQUIRE_PNG=OFF \ -DFT_REQUIRE_ZLIB=OFF - - cp -a "${PREFIX}/include/freetype2" "${PREFIX}/include/freetype" - mv "${PREFIX}/include/freetype" "${PREFIX}/include/freetype2/freetype" } # Build OpenAL From 35ad1ce762e43a4f4316f88ca6caacfaa6cf0067 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:43:39 +0100 Subject: [PATCH 33/63] curl-cmake --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index fe75ad8ef2..acf0925e8d 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -362,7 +362,7 @@ build_curl() { -DCURL_DISABLE_TELNET=ON \ -DCURL_DISABLE_TFTP=ON - # Already disabled by other options. + # Already disabled by other options: # -DCURL_USE_OPENLDAP=OFF \ # -DCURL_DISABLE_OPENSSL_AUTO_LOAD=ON \ } From 5c53ba37b3899ff566c9f7f4e7999c5d8bc46b84 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:44:35 +0100 Subject: [PATCH 34/63] jpeg-cmake --- external_deps/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index acf0925e8d..486a71a694 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -546,7 +546,6 @@ build_jpeg() { -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ -DWITH_JPEG8=1 - } # Build WebP From df090ae6359d3aea1d9184a8cb021249887e801c Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:47:26 +0100 Subject: [PATCH 35/63] freetype-zlib --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 486a71a694..3840e3d0b9 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -598,7 +598,7 @@ build_freetype() { -DFT_REQUIRE_BZIP2=OFF \ -DFT_REQUIRE_HARFBUZZ=OFF \ -DFT_REQUIRE_PNG=OFF \ - -DFT_REQUIRE_ZLIB=OFF + -DFT_REQUIRE_ZLIB=ON } # Build OpenAL From 07d96fec3ebc93d64e26cb0df62854622ea7adae Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:49:43 +0100 Subject: [PATCH 36/63] curl-no-exe --- external_deps/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/external_deps/build.sh b/external_deps/build.sh index 3840e3d0b9..c7b3e670f3 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -314,6 +314,7 @@ build_curl() { cd "${dir_name}" cmake_build \ + -DBUILD_CURL_EXE=OFF \ -DBUILD_TESTING=OFF \ -DCURL_ENABLE_SSL=OFF \ -DENABLE_THREADED_RESOLVER=OFF \ From c88f9379ff1e6d767cf151db04dc9ec80026d6f0 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:50:25 +0100 Subject: [PATCH 37/63] curl-cmake --- external_deps/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index c7b3e670f3..c39bb6ea34 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -316,13 +316,13 @@ build_curl() { cmake_build \ -DBUILD_CURL_EXE=OFF \ -DBUILD_TESTING=OFF \ - -DCURL_ENABLE_SSL=OFF \ -DENABLE_THREADED_RESOLVER=OFF \ + -DENABLE_UNIX_SOCKETS=OFF \ -DUSE_LIBIDN2=OFF \ -DCURL_BROTLI=OFF \ -DCURL_ZLIB=ON \ -DCURL_ZSTD=OFF \ - -DENABLE_UNIX_SOCKETS=OFF \ + -DCURL_ENABLE_SSL=OFF \ -DCURL_USE_BEARSSL=OFF \ -DCURL_USE_GSSAPI=OFF \ -DCURL_USE_LIBSSH=OFF \ From d6bf1fbbf0d7ad3fc78c757366b725fe5a1aa7a8 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:54:43 +0100 Subject: [PATCH 38/63] curses-configure --- external_deps/build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index c39bb6ea34..5b3701e883 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -780,11 +780,12 @@ build_ncurses() { "${download_only}" && return cd "${dir_name}" + # The default -O2 is dropped when there's user-provided CFLAGS. # Configure terminfo search dirs based on the ones used in Debian. By default it will only look in (only) the install directory. - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" --enable-widec "${CONFIGURE_SHARED[@]}" --with-terminfo-dirs=/etc/terminfo:/lib/terminfo --with-default-terminfo-dir=/usr/share/terminfo - make - make install + CFLAGS="${CFLAGS} -O2" configure_build \ + --with-terminfo-dirs=/etc/terminfo:/lib/terminfo \ + --with-default-terminfo-dir=/usr/share/terminfo } # "Builds" (downloads) the WASI SDK From 0d1d03d48c15b0133c71ae8df7ff9c9a6e2f4c3c Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:56:22 +0100 Subject: [PATCH 39/63] pkgconfig-configure-butshared --- external_deps/build.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 5b3701e883..530c84fa15 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -184,10 +184,9 @@ build_pkgconfig() { "${download_only}" && return cd "${dir_name}" + # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" ./configure --host="${HOST}" --prefix="${PREFIX}" --libdir="${PREFIX}/lib" --with-internal-glib - make - make install + CFLAGS="${CFLAGS} -O2" configure_build --with-internal-glib } # Build NASM From 8f16eb7e8213e3801a27d14c0c3bef0c2f4e65de Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:56:44 +0100 Subject: [PATCH 40/63] cmake-build --- external_deps/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/external_deps/build.sh b/external_deps/build.sh index 530c84fa15..da5db57207 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -158,6 +158,7 @@ configure_build() { cmake_build() { local cmake_args=() + if [ -n "${CMAKE_TOOLCHAIN}" ] then cmake_args+=(-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN}") From 7c425b5d633fb8521dfad5c8acd2d428e0ef7629 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Nov 2024 23:58:56 +0100 Subject: [PATCH 41/63] shared --- external_deps/build.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index da5db57207..c505f953b6 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -48,7 +48,7 @@ CXX='false' LD='ld' AR='ar' RANLIB='ranlib' -SHARED_LIBS='OFF' +LIBS_SHARED='OFF' CMAKE_TOOLCHAIN='' # Always reset flags, we heavily cross-compile and must not inherit any stray flag # from environment. @@ -140,7 +140,7 @@ download_extract() { configure_build() { local configure_args=(--disable-shared --enable-static) - if [ "${USE_SHARED}" = 'ON' ] + if [ "${LIBS_SHARED}" = 'ON' ] then configure_args=(--enable-shared --disable-static) fi @@ -166,7 +166,7 @@ cmake_build() { cmake -S . -B build \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ - -DBUILD_SHARED_LIBS="${SHARED_LIBS}" \ + -DBUILD_SHARED_LIBS="${LIBS_SHARED}" \ "${cmake_args[@]}" \ "${@}" @@ -229,7 +229,7 @@ build_zlib() { case "${PLATFORM}" in windows-*-*) - zlib_cmake_args+=(-DBUILD_SHARED_LIBS=ON) + zlib_cmake_args+=(-DBUILD_LIBS_SHARED=ON) ;; esac @@ -543,7 +543,7 @@ build_jpeg() { cd "${dir_name}" cmake_build \ - -DENABLE_SHARED="${SHARED_LIBS}" \ + -DENABLE_SHARED="${LIBS_SHARED}" \ -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ -DWITH_JPEG8=1 @@ -641,7 +641,7 @@ build_openal() { cd "${dir_name}" cmake_build \ - -DBUILD_SHARED_LIBS=ON + -DBUILD_LIBS_SHARED=ON install_name_tool -id "@rpath/libopenal.${OPENAL_VERSION}.dylib" "${PREFIX}/lib/libopenal.${OPENAL_VERSION}.dylib" ;; @@ -1145,7 +1145,7 @@ common_setup_arch() { # the Windows build of Lua is only used in developer gamelogic builds, and Microsoft # supports %lld since Visual Studio 2013. common_setup_msvc() { - SHARED_LIBS='ON' + LIBS_SHARED='ON' # Libtool bug prevents -static-libgcc from being set in LDFLAGS CC="${HOST}-gcc -static-libgcc" CXX="${HOST}-g++ -static-libgcc" From a4c72fe95a63c8d2a317100772c22462ea685854 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 00:00:51 +0100 Subject: [PATCH 42/63] cmake_release --- external_deps/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/external_deps/build.sh b/external_deps/build.sh index c505f953b6..be72cb37cb 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -165,6 +165,7 @@ cmake_build() { fi cmake -S . -B build \ + -DCMAKE_BUILD_TYPE='Release' \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_SHARED_LIBS="${LIBS_SHARED}" \ "${cmake_args[@]}" \ From cc857a167c0f9e8f02b107d5276a3931b0f979c7 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 00:01:48 +0100 Subject: [PATCH 43/63] opusfile-configure --- external_deps/build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index be72cb37cb..e968c9fb42 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -723,10 +723,9 @@ build_opusfile() { "${download_only}" && return cd "${dir_name}" + # The default -O2 is dropped when there's user-provided CFLAGS. CFLAGS="${CFLAGS} -O2" configure_build --disable-http - make - make install } # Build Lua From 13d65d475872cca16264121d6f3cc269b2067059 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 00:03:28 +0100 Subject: [PATCH 44/63] lua-configure --- external_deps/build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index e968c9fb42..68c8e339e9 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -781,9 +781,8 @@ build_ncurses() { cd "${dir_name}" - # The default -O2 is dropped when there's user-provided CFLAGS. # Configure terminfo search dirs based on the ones used in Debian. By default it will only look in (only) the install directory. - CFLAGS="${CFLAGS} -O2" configure_build \ + configure_build \ --with-terminfo-dirs=/etc/terminfo:/lib/terminfo \ --with-default-terminfo-dir=/usr/share/terminfo } From 40f487e84201690101b3ea4f5ccf03e66d97d693 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 00:01:36 +0100 Subject: [PATCH 45/63] cflags-o3 --- external_deps/build.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 68c8e339e9..4f9a023fe1 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -52,8 +52,8 @@ LIBS_SHARED='OFF' CMAKE_TOOLCHAIN='' # Always reset flags, we heavily cross-compile and must not inherit any stray flag # from environment. -CFLAGS='' -CXXFLAGS='' +CFLAGS='-O3' +CXXFLAGS='-O3' CPPFLAGS='' LDFLAGS='' @@ -187,8 +187,7 @@ build_pkgconfig() { cd "${dir_name}" - # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" configure_build --with-internal-glib + configure_build --with-internal-glib } # Build NASM @@ -273,8 +272,7 @@ build_gmp() { ;; esac - # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" configure_build "${gmp_configure_args[@]}" + configure_build "${gmp_configure_args[@]}" case "${PLATFORM}" in windows-*-msvc) @@ -297,8 +295,7 @@ build_nettle() { cd "${dir_name}" - # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" configure_build + configure_build } # Build cURL @@ -724,8 +721,7 @@ build_opusfile() { cd "${dir_name}" - # The default -O2 is dropped when there's user-provided CFLAGS. - CFLAGS="${CFLAGS} -O2" configure_build --disable-http + configure_build --disable-http } # Build Lua From 12d46c790bd603a9e64e324f48d46db81d70e2ad Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 00:08:16 +0100 Subject: [PATCH 46/63] png-cmake --- external_deps/build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 4f9a023fe1..b91344a767 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -484,8 +484,16 @@ build_png() { cd "${dir_name}" - # The default -O2 is dropped when there's user-provided CFLAGS. - cmake_build + local png_cmake_args=(-DPNG_SHARED=OFF -DPNG_STATIC=ON) + + if [ "${LIBS_SHARED}" = 'ON' ] + then + png_cmake_args=(-DPNG_SHARED=ON -DPNG_STATIC=OFF) + fi + + cmake_build \ + -DPNG_EXECUTABLES=OFF \ + "${png_cmake_args[@]}" } # Build JPEG From 0bee1126e7da63136a3c82169e5a3b03cbe72d37 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 01:01:33 +0100 Subject: [PATCH 47/63] shared-libs --- external_deps/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index b91344a767..b5704a6b28 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -49,6 +49,7 @@ LD='ld' AR='ar' RANLIB='ranlib' LIBS_SHARED='OFF' +LIBS_STATIC='OFF' CMAKE_TOOLCHAIN='' # Always reset flags, we heavily cross-compile and must not inherit any stray flag # from environment. @@ -550,7 +551,7 @@ build_jpeg() { cmake_build \ -DENABLE_SHARED="${LIBS_SHARED}" \ - -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ + -DCMAKE_SYSTEM_NAME="${LIBS_STATIC}" \ -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ -DWITH_JPEG8=1 } @@ -1149,6 +1150,7 @@ common_setup_arch() { # supports %lld since Visual Studio 2013. common_setup_msvc() { LIBS_SHARED='ON' + LIBS_STATIC='OFF' # Libtool bug prevents -static-libgcc from being set in LDFLAGS CC="${HOST}-gcc -static-libgcc" CXX="${HOST}-g++ -static-libgcc" From c325281e795b0f246e8fed88e4026aafdbce59bf Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 01:02:20 +0100 Subject: [PATCH 48/63] jpeg-cmake --- external_deps/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index b5704a6b28..3ec57e6b51 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -551,7 +551,8 @@ build_jpeg() { cmake_build \ -DENABLE_SHARED="${LIBS_SHARED}" \ - -DCMAKE_SYSTEM_NAME="${LIBS_STATIC}" \ + -DENABLE_STATIC="${LIBS_STATIC}" \ + -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ -DWITH_JPEG8=1 } From e61888d32a4b3c9ee908b622f90e516ad9a7b69e Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 01:03:31 +0100 Subject: [PATCH 49/63] png-cmake --- external_deps/build.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 3ec57e6b51..c6e19afa2e 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -485,16 +485,10 @@ build_png() { cd "${dir_name}" - local png_cmake_args=(-DPNG_SHARED=OFF -DPNG_STATIC=ON) - - if [ "${LIBS_SHARED}" = 'ON' ] - then - png_cmake_args=(-DPNG_SHARED=ON -DPNG_STATIC=OFF) - fi - cmake_build \ -DPNG_EXECUTABLES=OFF \ - "${png_cmake_args[@]}" + -DPNG_SHARED="${LIBS_SHARED}" \ + -DPNG_STATIC="${LIBS_STATIC}" } # Build JPEG From eb6311fcddecc84762168be92260b94f07973112 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 01:04:46 +0100 Subject: [PATCH 50/63] configure-shared --- external_deps/build.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index c6e19afa2e..a720fe0845 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -141,9 +141,20 @@ download_extract() { configure_build() { local configure_args=(--disable-shared --enable-static) + configure_args=() + if [ "${LIBS_SHARED}" = 'ON' ] then - configure_args=(--enable-shared --disable-static) + configure_args+=(--enable-shared) + else + configure_args+=(--disable-shared) + fi + + if [ "${LIBS_STATIC}" = 'ON' ] + then + configure_args+=(--enable-static) + else + configure_args+=(--disable-static) fi ./configure \ From 80fb010b6518fd27ccd72c2d951bce5947988169 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 01:20:49 +0100 Subject: [PATCH 51/63] shared --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index a720fe0845..a9ebea653e 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -49,7 +49,7 @@ LD='ld' AR='ar' RANLIB='ranlib' LIBS_SHARED='OFF' -LIBS_STATIC='OFF' +LIBS_STATIC='ON' CMAKE_TOOLCHAIN='' # Always reset flags, we heavily cross-compile and must not inherit any stray flag # from environment. From c49fbb76c02198a66c49b8c066b3eb1da777e8bc Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 02:01:37 +0100 Subject: [PATCH 52/63] jpeg-linux --- external_deps/build.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index a9ebea653e..2154fdcf23 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -552,6 +552,19 @@ build_jpeg() { ;; esac + local jpeg_cmake_args=() + + case "${PLATFORM}" in + windows-*-*) + ;; + *) + # Workaround for: undefined reference to `log10' + # The CMakeLists.txt file only does -lm if UNIX, + # but UNIX may not be true on Linux. + jpeg_cmake_args=(-DUNIX=True) + ;; + esac + cd "${dir_name}" cmake_build \ @@ -559,7 +572,8 @@ build_jpeg() { -DENABLE_STATIC="${LIBS_STATIC}" \ -DCMAKE_SYSTEM_NAME="${SYSTEM_NAME}" \ -DCMAKE_SYSTEM_PROCESSOR="${SYSTEM_PROCESSOR}" \ - -DWITH_JPEG8=1 + -DWITH_JPEG8=1 \ + "${jpeg_cmake_args[@]}" } # Build WebP From f72e15e7086153be0ff6d1db476710cee674c5c7 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 02:06:05 +0100 Subject: [PATCH 53/63] cd-dirname --- external_deps/build.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 2154fdcf23..0f68a3cca8 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -235,8 +235,6 @@ build_zlib() { "${download_only}" && return - cd "${dir_name}" - local zlib_cmake_args=(-DCMAKE_C_FLAGS="${CFLAGS} -DZLIB_CONST") case "${PLATFORM}" in @@ -245,6 +243,8 @@ build_zlib() { ;; esac + cd "${dir_name}" + cmake_build "${zlib_cmake_args[@]}" } @@ -260,8 +260,6 @@ build_gmp() { "${download_only}" && return - cd "${dir_name}" - case "${PLATFORM}" in windows-*-msvc) # Configure script gets confused if we override the compiler. Shouldn't @@ -284,6 +282,8 @@ build_gmp() { ;; esac + cd "${dir_name}" + configure_build "${gmp_configure_args[@]}" case "${PLATFORM}" in @@ -461,6 +461,7 @@ build_glew() { "${download_only}" && return cd "${dir_name}" + case "${PLATFORM}" in windows-*-*) make SYSTEM="linux-mingw${BITNESS}" GLEW_DEST="${PREFIX}" CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" STRIP="${HOST}-strip" LD="${LD}" CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}" @@ -724,8 +725,6 @@ build_opus() { "${download_only}" && return - cd "${dir_name}" - local opus_cmake_args=(-DOPUS_BUILD_PROGRAMS=OFF -DOPUS_BUILD_TESTING=OFF) case "${PLATFORM}" in @@ -735,6 +734,8 @@ build_opus() { ;; esac + cd "${dir_name}" + cmake_build "${opus_cmake_args[@]}" } From f60669f020029c269876c1c88e94fe22b07d3a06 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 02:53:00 +0100 Subject: [PATCH 54/63] shared --- external_deps/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 0f68a3cca8..488d999881 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -239,7 +239,7 @@ build_zlib() { case "${PLATFORM}" in windows-*-*) - zlib_cmake_args+=(-DBUILD_LIBS_SHARED=ON) + zlib_cmake_args+=(-DBUILD_SHARED_LIBS=ON) ;; esac From 80fc8ac00f9c9172f176134dcca3c177f1679db0 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 16:34:59 +0100 Subject: [PATCH 55/63] cmake-prefix-path --- external_deps/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/external_deps/build.sh b/external_deps/build.sh index 488d999881..1a513d5fdf 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -178,6 +178,7 @@ cmake_build() { cmake -S . -B build \ -DCMAKE_BUILD_TYPE='Release' \ + -DCMAKE_PREFIX_PATH="${PREFIX}" \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_SHARED_LIBS="${LIBS_SHARED}" \ "${cmake_args[@]}" \ From 16181fb53bfff2a220ea3141a03b74e6228ea590 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 17:23:08 +0100 Subject: [PATCH 56/63] cmake-toolchain --- external_deps/build.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 1a513d5fdf..b70eb0672a 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -171,12 +171,8 @@ configure_build() { cmake_build() { local cmake_args=() - if [ -n "${CMAKE_TOOLCHAIN}" ] - then - cmake_args+=(-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN}") - fi - cmake -S . -B build \ + -DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN}" \ -DCMAKE_BUILD_TYPE='Release' \ -DCMAKE_PREFIX_PATH="${PREFIX}" \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ From 47b67c3fbab23a899d934fa43c13acfc35ce2ed3 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 17:37:52 +0100 Subject: [PATCH 57/63] curl-cmake --- external_deps/build.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index b70eb0672a..9fa178049a 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -325,23 +325,38 @@ build_curl() { -DBUILD_TESTING=OFF \ -DENABLE_THREADED_RESOLVER=OFF \ -DENABLE_UNIX_SOCKETS=OFF \ + -DUSE_HTTPSRR=OFF \ -DUSE_LIBIDN2=OFF \ + -DUSE_LIBRTMP=OFF \ + -DUSE_MSH3=OFF \ + -DUSE_NGHTTP2=OFF \ + -DUSE_NGTCP2=OFF \ + -DUSE_OPENSSL_QUIC=OFF \ + -DUSE_QUICHE=OFF \ + -DUSE_WIN32_IDN=OFF \ -DCURL_BROTLI=OFF \ -DCURL_ZLIB=ON \ -DCURL_ZSTD=OFF \ -DCURL_ENABLE_SSL=OFF \ -DCURL_USE_BEARSSL=OFF \ -DCURL_USE_GSSAPI=OFF \ + -DCURL_USE_LIBPSL=OFF \ -DCURL_USE_LIBSSH=OFF \ -DCURL_USE_LIBSSH2=OFF \ -DCURL_USE_MBEDTLS=OFF \ -DCURL_USE_NSS=OFF \ -DCURL_USE_OPENSSL=OFF \ - -DCURL_USE_WOLFSSL=OFF \ + -DCURL_USE_WOLFSSL=ON \ -DCURL_DISABLE_ALTSVC=ON \ + -DCURL_DISABLE_AWS=ON \ + -DCURL_DISABLE_BASIC_AUTH=ON \ + -DCURL_DISABLE_BEARER_AUTH=ON \ + -DCURL_DISABLE_BINDLOCAL=ON \ + -DCURL_DISABLE_CA_SEARCH=ON \ -DCURL_DISABLE_COOKIES=ON \ -DCURL_DISABLE_CRYPTO_AUTH=ON \ -DCURL_DISABLE_DICT=ON \ + -DCURL_DISABLE_DIGEST_AUTH=ON \ -DCURL_DISABLE_DOH=ON \ -DCURL_DISABLE_FILE=ON \ -DCURL_DISABLE_FTP=ON \ @@ -351,28 +366,30 @@ build_curl() { -DCURL_DISABLE_HTTP=ON \ -DCURL_DISABLE_HTTP_AUTH=ON \ -DCURL_DISABLE_IMAP=ON \ + -DCURL_DISABLE_IPFS=ON \ + -DCURL_DISABLE_KERBEROS_AUTH=ON \ -DCURL_DISABLE_LDAP=ON \ -DCURL_DISABLE_LDAPS=ON \ -DCURL_DISABLE_LIBCURL_OPTION=ON \ -DCURL_DISABLE_MIME=ON \ -DCURL_DISABLE_MQTT=ON \ -DCURL_DISABLE_NETRC=ON \ + -DCURL_DISABLE_NEGOTIATE_AUTH=ON \ -DCURL_DISABLE_NTLM=ON \ + -DCURL_DISABLE_OPENSSL_AUTO_LOAD=ON \ -DCURL_DISABLE_PARSEDATE=ON \ -DCURL_DISABLE_POP3=ON \ -DCURL_DISABLE_PROGRESS_METER=ON \ -DCURL_DISABLE_PROXY=ON \ -DCURL_DISABLE_RTSP=ON \ + -DCURL_DISABLE_SHA512_256=ON \ -DCURL_DISABLE_SHUFFLE_DNS=ON \ -DCURL_DISABLE_SMB=ON \ -DCURL_DISABLE_SMTP=ON \ -DCURL_DISABLE_SOCKETPAIR=ON \ -DCURL_DISABLE_TELNET=ON \ - -DCURL_DISABLE_TFTP=ON - - # Already disabled by other options: - # -DCURL_USE_OPENLDAP=OFF \ - # -DCURL_DISABLE_OPENSSL_AUTO_LOAD=ON \ + -DCURL_DISABLE_TFTP=ON \ + -DCURL_DISABLE_WEBSOCKETS=ON } # Build SDL2 From 6a6fe0e0677784fe7383443aed30d9f3ccd3220c Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 00:22:01 +0100 Subject: [PATCH 58/63] external_deps: set BASEURL strings, easy to click! --- external_deps/build.sh | 70 +++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 9fa178049a..33144c070e 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -16,6 +16,32 @@ CURL="$(command -v curl)" # are the same as the ones when extracting from the downloaded packages. DEPS_VERSION=10 +# Package download pages +PKGCONFIG_BASEURL='https://pkg-config.freedesktop.org/releases' +NASM_BASEURL='https://www.nasm.us/pub/nasm/releasebuilds/' +ZLIB_BASEURL='https://zlib.net/fossils' +GMP_BASEURL='https://gmplib.org/download/gmp' +NETTLE_BASEURL='https://mirror.cyberbits.eu/gnu/nettle' +CURL_BASEURL='https://curl.se/download' +SDL2_BASEURL='https://www.libsdl.org/release' +GLEW_BASEURL='https://github.com/nigels-com/glew/releases' +PNG_BASEURL='https://download.sourceforge.net/libpng' +JPEG_BASEURL='https://downloads.sourceforge.net/project/libjpeg-turbo' +# Index: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html +WEBP_BASEURL='https://storage.googleapis.com/downloads.webmproject.org/releases/webp' +FREETYPE_BASEURL='https://download.savannah.gnu.org/releases/freetype' +OPENAL_BASEURL='https://openal-soft.org/openal-releases' +OGG_BASEURL='https://downloads.xiph.org/releases/ogg' +VORBIS_BASEURL='https://downloads.xiph.org/releases/vorbis' +OPUS_BASEURL='https://downloads.xiph.org/releases/opus' +OPUSFILE_BASEURL='https://downloads.xiph.org/releases/opus' +LUA_BASEURL='https://www.lua.org/ftp' +# No index. +NACLSDK_BASEURL='https://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk' +NCURSES_BASEURL='https://ftpmirror.gnu.org/gnu/ncurses' +WASISDK_BASEURL='https://github.com/WebAssembly/wasi-sdk/releases' +WASMTIME_BASEURL='https://github.com/bytecodealliance/wasmtime/releases' + # Package versions PKGCONFIG_VERSION=0.29.2 NASM_VERSION=2.16.01 @@ -190,7 +216,7 @@ build_pkgconfig() { local archive_name="${dir_name}.tar.gz" download_extract pkgconfig "${archive_name}" \ - "http://pkgconfig.freedesktop.org/releases/${archive_name}" + "${PKGCONFIG_BASEURL}/${archive_name}" "${download_only}" && return @@ -207,7 +233,7 @@ build_nasm() { local archive_name="${dir_name}-macosx.zip" download_extract nasm "${archive_name}" \ - "https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/macosx/${archive_name}" + "${NASM_BASEURL}/${NASM_VERSION}/macosx/${archive_name}" "${download_only}" && return @@ -227,7 +253,7 @@ build_zlib() { local archive_name="${dir_name}.tar.gz" download_extract zlib "${archive_name}" \ - "https://zlib.net/fossils/${archive_name}" \ + "${ZLIB_BASEURL}/${archive_name}" \ "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/${archive_name}" "${download_only}" && return @@ -251,7 +277,7 @@ build_gmp() { local archive_name="${dir_name}.tar.bz2" download_extract gmp "${archive_name}" \ - "https://gmplib.org/download/gmp/${archive_name}" \ + "${GMP_BASEURL}/${archive_name}" \ "https://ftpmirror.gnu.org/gnu/gmp/${archive_name}" \ "https://ftp.gnu.org/gnu/gmp/${archive_name}" @@ -297,7 +323,7 @@ build_nettle() { local archive_name="${dir_name}.tar.gz" download_extract nettle "${archive_name}" \ - "https://ftpmirror.gnu.org/gnu/nettle/${archive_name}" \ + "${NETTLE_BASEURL}/${archive_name}" \ "https://ftp.gnu.org/gnu/nettle/${archive_name}" "${download_only}" && return @@ -313,7 +339,7 @@ build_curl() { local archive_name="${dir_name}.tar.xz" download_extract curl "${archive_name}" \ - "https://curl.se/download/${archive_name}" \ + "${CURL_BASEURL}/${archive_name}" \ "https://github.com/curl/curl/releases/download/curl-${CURL_VERSION//./_}/${archive_name}" "${download_only}" && return @@ -412,7 +438,7 @@ build_sdl2() { esac download_extract sdl2 "${archive_name}" \ - "https://www.libsdl.org/release/${archive_name}" \ + "${SDL2_BASEURL}/${archive_name}" \ "https://github.com/libsdl-org/SDL/releases/download/release-${SDL2_VERSION}/${archive_name}" "${download_only}" && return @@ -469,7 +495,7 @@ build_glew() { local archive_name="${dir_name}.tgz" download_extract glew "${archive_name}" \ - "https://github.com/nigels-com/glew/releases/download/glew-${GLEW_VERSION}/${archive_name}" \ + "${GLEW_BASEURL}/download/glew-${GLEW_VERSION}/${archive_name}" \ "https://downloads.sourceforge.net/project/glew/glew/${GLEW_VERSION}/${archive_name}" "${download_only}" && return @@ -505,7 +531,7 @@ build_png() { local archive_name="${dir_name}.tar.xz" download_extract png "${archive_name}" \ - "https://download.sourceforge.net/libpng/${archive_name}" + "${PNG_BASEURL}/${archive_name}" "${download_only}" && return @@ -523,7 +549,7 @@ build_jpeg() { local archive_name="${dir_name}.tar.gz" download_extract jpeg "${archive_name}" \ - "https://downloads.sourceforge.net/project/libjpeg-turbo/${JPEG_VERSION}/${archive_name}" + "${JPEG_BASEURL}/${JPEG_VERSION}/${archive_name}" "${download_only}" && return @@ -597,7 +623,7 @@ build_webp() { local archive_name="${dir_name}.tar.gz" download_extract webp "${archive_name}" \ - "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/${archive_name}" + "${WEBP_BASEURL}/${archive_name}" "${download_only}" && return @@ -624,7 +650,7 @@ build_freetype() { local archive_name="${dir_name}.tar.xz" download_extract freetype "${archive_name}" \ - "https://download.savannah.gnu.org/releases/freetype/${archive_name}" + "${FREETYPE_BASEURL}/${archive_name}" "${download_only}" && return @@ -659,7 +685,7 @@ build_openal() { esac download_extract openal "${archive_name}" \ - "https://openal-soft.org/openal-releases/${archive_name}" \ + "${OPENAL_BASEURL}/${archive_name}" \ "https://github.com/kcat/openal-soft/releases/download/${OPENAL_VERSION}/${archive_name}" \ "${download_only}" && return @@ -701,7 +727,7 @@ build_ogg() { local archive_name="libogg-${OGG_VERSION}.tar.xz" download_extract ogg "${archive_name}" \ - "https://downloads.xiph.org/releases/ogg/${archive_name}" + "${OGG_BASEURL}/${archive_name}" "${download_only}" && return @@ -720,7 +746,7 @@ build_vorbis() { local archive_name="${dir_name}.tar.xz" download_extract vorbis "${archive_name}" \ - "https://downloads.xiph.org/releases/vorbis/${archive_name}" + "${VORBIS_BASEURL}/${archive_name}" "${download_only}" && return @@ -735,7 +761,7 @@ build_opus() { local archive_name="${dir_name}.tar.gz" download_extract opus "${archive_name}" \ - "https://downloads.xiph.org/releases/opus/${archive_name}" + "${OPUS_BASEURL}/${archive_name}" "${download_only}" && return @@ -759,7 +785,7 @@ build_opusfile() { local archive_name="${dir_name}.tar.gz" download_extract opusfile "${archive_name}" \ - "https://downloads.xiph.org/releases/opus/${archive_name}" + "${OPUSFILE_BASEURL}/${archive_name}" "${download_only}" && return @@ -774,7 +800,7 @@ build_lua() { local archive_name="${dir_name}.tar.gz" download_extract lua "${archive_name}" \ - "https://www.lua.org/ftp/${archive_name}" + "${LUA_BASEURL}/${archive_name}" "${download_only}" && return @@ -814,7 +840,7 @@ build_ncurses() { local archive_name="${dir_name}.tar.gz" download_extract ncurses "${archive_name}" \ - "https://ftpmirror.gnu.org/gnu/ncurses/${archive_name}" \ + "${NCURSES_BASEURL}/${archive_name}" \ "https://ftp.gnu.org/pub/gnu/ncurses/${archive_name}" "${download_only}" && return @@ -853,7 +879,7 @@ build_wasisdk() { local WASISDK_VERSION_MAJOR="$(echo "${WASISDK_VERSION}" | cut -f1 -d'.')" download_extract wasisdk "${archive_name}" \ - "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASISDK_VERSION_MAJOR}/${archive_name}" + "${WASISDK_BASEURL}/download/wasi-sdk-${WASISDK_VERSION_MAJOR}/${archive_name}" "${download_only}" && return @@ -892,7 +918,7 @@ build_wasmtime() { local archive_name="${folder_name}.${ARCHIVE_EXT}" download_extract wasmtime "${archive_name}" \ - "https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/${archive_name}" + "${WASMTIME_BASEURL}/download/v${WASMTIME_VERSION}/${archive_name}" "${download_only}" && return @@ -938,7 +964,7 @@ build_naclsdk() { local archive_name="naclsdk_${NACLSDK_PLATFORM}-${NACLSDK_VERSION}.${TAR_EXT}.bz2" download_extract naclsdk "${archive_name}" \ - "https://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/${NACLSDK_VERSION}/naclsdk_${NACLSDK_PLATFORM}.tar.bz2" + "${NACLSDK_BASEURL}/${NACLSDK_VERSION}/naclsdk_${NACLSDK_PLATFORM}.tar.bz2" "${download_only}" && return From 9f2c3b5968e18a5c96eab8c9c09ef99e75563017 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 01:09:10 +0100 Subject: [PATCH 59/63] external_deps: bump versions --- external_deps/build.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 33144c070e..4d55804481 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -44,25 +44,25 @@ WASMTIME_BASEURL='https://github.com/bytecodealliance/wasmtime/releases' # Package versions PKGCONFIG_VERSION=0.29.2 -NASM_VERSION=2.16.01 +NASM_VERSION=2.16.02 ZLIB_VERSION=1.2.13 -GMP_VERSION=6.2.1 -NETTLE_VERSION=3.8.1 -CURL_VERSION=7.83.1 -SDL2_VERSION=2.26.5 +GMP_VERSION=6.3.0 +NETTLE_VERSION=3.9.1 +CURL_VERSION=8.11.0 +SDL2_VERSION=2.30.9 GLEW_VERSION=2.2.0 -PNG_VERSION=1.6.39 -JPEG_VERSION=2.1.5.1 -WEBP_VERSION=1.3.2 -FREETYPE_VERSION=2.13.0 +PNG_VERSION=1.6.44 +JPEG_VERSION=3.0.1 +WEBP_VERSION=1.4.0 +FREETYPE_VERSION=2.13.3 OPENAL_VERSION=1.23.1 OGG_VERSION=1.3.5 VORBIS_VERSION=1.3.7 -OPUS_VERSION=1.4 +OPUS_VERSION=1.5.2 OPUSFILE_VERSION=0.12 -LUA_VERSION=5.4.4 +LUA_VERSION=5.4.7 NACLSDK_VERSION=44.0.2403.155 -NCURSES_VERSION=6.2 +NCURSES_VERSION=6.5 WASISDK_VERSION=16.0 WASMTIME_VERSION=2.0.2 From 524b9441a778b650697c2aa1e5b4f0542c57bf68 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 18:15:22 +0100 Subject: [PATCH 60/63] mingw-msvc --- external_deps/build.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 4d55804481..15f35043cb 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -1209,26 +1209,27 @@ common_setup_arch() { # Lua does use this one, which results in compiler warnings. But this is OK because # the Windows build of Lua is only used in developer gamelogic builds, and Microsoft # supports %lld since Visual Studio 2013. +common_setup_windows() { + LD="${HOST}-ld" + AR="${HOST}-ar" + RANLIB="${HOST}-ranlib" + CFLAGS+=' -D__USE_MINGW_ANSI_STDIO=0' + CMAKE_TOOLCHAIN="${SCRIPT_DIR}/../cmake/cross-toolchain-mingw${BITNESS}.cmake" +} + common_setup_msvc() { LIBS_SHARED='ON' LIBS_STATIC='OFF' # Libtool bug prevents -static-libgcc from being set in LDFLAGS CC="${HOST}-gcc -static-libgcc" CXX="${HOST}-g++ -static-libgcc" - LD="${HOST}-ld" - AR="${HOST}-ar" - RANLIB="${HOST}-ranlib" - CFLAGS+=' -D__USE_MINGW_ANSI_STDIO=0' + common_setup_windows } common_setup_mingw() { CC="${HOST}-gcc" CXX="${HOST}-g++" - LD="${HOST}-ld" - AR="${HOST}-ar" - RANLIB="${HOST}-ranlib" - CFLAGS+=' -D__USE_MINGW_ANSI_STDIO=0' - CMAKE_TOOLCHAIN="${SCRIPT_DIR}/../cmake/cross-toolchain-mingw${BITNESS}.cmake" + common_setup_windows } common_setup_macos() { From bd1e3180e91680ce7ba6a3dad7513b8de032df7b Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 19:23:55 +0100 Subject: [PATCH 61/63] cmake-vorbis-it-does-not-install --- external_deps/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index 15f35043cb..e09be911c7 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -737,7 +737,8 @@ build_ogg() { cat <(echo '#include ') include/ogg/os_types.h > os_types.tmp mv os_types.tmp include/ogg/os_types.h - cmake_build + # The provided CMakeLists.txt doesn't have an install target. + configure_build } # Build Vorbis From af02cb26c93b8c78b42ea8a04a84a4cbe9ae0781 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 19:40:53 +0100 Subject: [PATCH 62/63] opus-cmake --- external_deps/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/external_deps/build.sh b/external_deps/build.sh index e09be911c7..5e615839b0 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -777,7 +777,13 @@ build_opus() { cd "${dir_name}" - cmake_build "${opus_cmake_args[@]}" + cmake_build "${opus_cmake_args[@]}" \ + -DOPUS_X86_MAY_HAVE_SSE=ON \ + -DOPUS_X86_MAY_HAVE_SSE2=ON \ + -DOPUS_X86_PRESUME_SSE=ON \ + -DOPUS_X86_PRESUME_SSE2=ON \ + -DOPUS_X86_MAY_HAVE_SSE4_1=OFF \ + -DOPUS_X86_MAY_HAVE_AVX2=OFF } # Build OpusFile From c537fe939172ba0c067256b89b4dd6d1730b04cc Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 11 Nov 2024 20:25:11 +0100 Subject: [PATCH 63/63] vorbis-cmake --- external_deps/build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/external_deps/build.sh b/external_deps/build.sh index 5e615839b0..f2426c9e4f 100755 --- a/external_deps/build.sh +++ b/external_deps/build.sh @@ -753,6 +753,16 @@ build_vorbis() { cd "${dir_name}" + case "${PLATFORM}" in + windows-*-msvc) + # Workaround a build issue on MinGW: + # See: https://github.com/microsoft/vcpkg/issues/22990 + # and: https://github.com/microsoft/vcpkg/pull/23761 + ls win32/vorbis.def win32/vorbisenc.def win32/vorbisfile.def \ + | xargs -I{} -P3 sed -e 's/LIBRARY//' -i {} + ;; + esac + cmake_build }