From 0d515af0f02f83d2bc283f95e8c7ff6a41adf5d6 Mon Sep 17 00:00:00 2001 From: Levon Gevorgyan Date: Fri, 29 Aug 2025 14:00:42 -0500 Subject: [PATCH] fix patch --- lib/build.sh | 12 +++++------- lib/install_deps.sh | 2 +- main.sh | 2 +- shfmt-watcher.sh | 5 ++++- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/build.sh b/lib/build.sh index a2113cb..7be6083 100644 --- a/lib/build.sh +++ b/lib/build.sh @@ -34,8 +34,12 @@ set_compile_opts() { "-DCMAKE_PREFIX_PATH=${PREFIX}" "-DCMAKE_INSTALL_PREFIX=${PREFIX}" "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_BUILD_TYPE=Release" ) + CARGO_BUILD_TYPE=release + CARGO_FLAGS+=("--${CARGO_BUILD_TYPE}") CARGO_CINSTALL_FLAGS=( + "--${CARGO_BUILD_TYPE}" "--prefix" "${PREFIX}" "--libdir" "${LIBDIR}" ) @@ -59,17 +63,13 @@ set_compile_opts() { fi MESON_FLAGS+=("-Db_lto=true") RUSTFLAGS+=("-C lto=yes" "-C inline-threshold=1000" "-C codegen-units=1") - CARGO_BUILD_TYPE=release - CARGO_FLAGS+=("--${CARGO_BUILD_TYPE}") else echo_info "building without LTO" LTO_SWITCH='OFF' LTO_FLAG='' MESON_FLAGS+=("-Db_lto=false") RUSTFLAGS+=("-C lto=no") - CARGO_BUILD_TYPE=debug fi - CARGO_CINSTALL_FLAGS+=("--${CARGO_BUILD_TYPE}") # setting optimization level if [[ ${OPT} == '' ]]; then @@ -461,7 +461,6 @@ build_cpuinfo() { build_libsvtav1() { cmake \ "${CMAKE_FLAGS[@]}" \ - -DSVT_AV1_LTO="${LTO_SWITCH}" \ -DENABLE_AVX512=ON \ -DBUILD_TESTING=OFF \ -DCOVERAGE=OFF || return 1 @@ -474,7 +473,6 @@ build_libsvtav1_psy() { local dovilib="$(find -L "${PREFIX}" -type f -name "libdovi.${USE_LIB_SUFF}")" cmake \ "${CMAKE_FLAGS[@]}" \ - -DSVT_AV1_LTO="${LTO_SWITCH}" \ -DBUILD_TESTING=OFF \ -DENABLE_AVX512=ON \ -DCOVERAGE=OFF \ @@ -611,7 +609,7 @@ build_ffmpeg() { ffmpegFlags+=("${flag}") done for flag in "${FFMPEG_EXTRA_FLAGS[@]}"; do - ffmpegFlags+=("${flag// -flto/}") + ffmpegFlags+=("${flag// ${LTO_FLAG}/}") done else ffmpegFlags=("${CONFIGURE_FLAGS[@]}" "${FFMPEG_EXTRA_FLAGS[@]}") diff --git a/lib/install_deps.sh b/lib/install_deps.sh index 65469c4..a8beff2 100644 --- a/lib/install_deps.sh +++ b/lib/install_deps.sh @@ -77,7 +77,7 @@ print_req_pkgs() { "${common_linux_pkgs[@]}" openssl-devel pipx ninja-build fontconfig-devel wget2 cpuinfo-devel glibc-static glibc-devel - libstdc++-static libstdc++-devel + libstdc++-static libstdc++-devel patch ) local req_pkgs_env_name="${pkg_mgr/-/_}_pkgs" diff --git a/main.sh b/main.sh index b30d4aa..5a867a7 100755 --- a/main.sh +++ b/main.sh @@ -76,7 +76,7 @@ set_completions() { test -f "${HOME}/.bashrc" && source "${HOME}/.bashrc" src_scripts || return 1 determine_pkg_mgr || return 1 -check_compile_opts_override || return +check_compile_opts_override || return 1 if [[ $FB_RUNNING_AS_SCRIPT -eq 0 ]]; then print_cmds || return 1 diff --git a/shfmt-watcher.sh b/shfmt-watcher.sh index 71c08bc..637eb31 100755 --- a/shfmt-watcher.sh +++ b/shfmt-watcher.sh @@ -5,7 +5,10 @@ base="$(dirname "$(readlink -f "$0")")" inotifywait -m -r \ -e close_write \ -e moved_to \ - --format '%w%f' "$base/lib" "$base/scripts" | while read -r file; do + --format '%w%f' \ + "$base/lib" \ + "$base/scripts" \ + "$base/main.sh" | while read -r file; do if [[ -f $file && $file =~ .sh ]]; then shfmt --write --simplify "$file" fi