From 0aa77d9f84869ea6d6e6d90f0da1a8377536e0de Mon Sep 17 00:00:00 2001 From: Levon Gevorgyan Date: Sat, 13 Sep 2025 21:41:21 -0500 Subject: [PATCH] more fixes --- lib/build.sh | 26 ++++++++++++++------------ lib/docker.sh | 11 +++++++---- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/lib/build.sh b/lib/build.sh index c487cc2..9f95a3e 100644 --- a/lib/build.sh +++ b/lib/build.sh @@ -167,9 +167,7 @@ set_compile_opts() { # set fallback values local rustupHome cargoHome if has_cmd rustup; then - rustupHome="$(bash_dirname "$(command -v rustup)")" - # move out of bin/ dir - rustupHome="$(cd "${rustupHome}/../" && echo "$PWD")" + rustupHome="$(rustup show home)" fi if has_cmd cargo; then cargoHome="$(bash_dirname "$(command -v cargo)")" @@ -484,29 +482,33 @@ del_pkgconfig_gcc_s() { } ### RUST ### -build_hdr10plus_tool() { - ${SUDO_CARGO} bash -c "cargo install --path . --root ${PREFIX}" || return 1 +cargo_build() { + ${SUDO_CARGO} bash -c "cargo install --force --path . --root ${PREFIX}" +} +cargo_cbuild() { + ${SUDO_CARGO} bash -c "cargo cinstall ${CARGO_CINSTALL_FLAGS[*]}" +} +build_hdr10plus_tool() { + cargo_build || return 1 # build libhdr10plus cd hdr10plus || return 1 - ${SUDO_CARGO} bash -c "cargo cinstall ${CARGO_CINSTALL_FLAGS[*]}" || return 1 + cargo_cbuild || return 1 sanitize_sysroot_libs libhdr10plus-rs || return 1 } build_dovi_tool() { - ${SUDO_CARGO} bash -c "cargo install --path . --root ${PREFIX}" || return 1 - + cargo_build || return 1 # build libdovi cd dolby_vision || return 1 - ${SUDO_CARGO} bash -c "cargo cinstall ${CARGO_CINSTALL_FLAGS[*]}" || return 1 + cargo_cbuild || return 1 sanitize_sysroot_libs libdovi || return 1 } build_librav1e() { - ${SUDO_CARGO} bash -c "cargo install --path . --root ${PREFIX}" || return 1 - + cargo_build || return 1 # build librav1e - ${SUDO_CARGO} bash -c "cargo cinstall ${CARGO_CINSTALL_FLAGS[*]}" || return 1 + cargo_cbuild || return 1 sanitize_sysroot_libs librav1e || return 1 del_pkgconfig_gcc_s rav1e.pc || return 1 } diff --git a/lib/docker.sh b/lib/docker.sh index 5902e5f..21c620b 100644 --- a/lib/docker.sh +++ b/lib/docker.sh @@ -141,12 +141,15 @@ docker_build_image() { echo 'ENV CARGO_HOME="/root/.cargo"' echo 'ENV RUSTUP_HOME="/root/.rustup"' echo 'ENV PATH="/root/.cargo/bin:$PATH"' + local rustupVersion='1.28.2' + local rustcVersion='1.88.0' local cargoInst='' - cargoInst+='curl https://sh.rustup.rs -sSf | bash -s -- -y' - cargoInst+=' && rustup update stable' - cargoInst+=' && cargo install cargo-c' - cargoInst+=' && rm -rf "${CARGO_HOME}"/registry "${CARGO_HOME}"/git' + cargoInst+="cd tmp && wget https://github.com/rust-lang/rustup/archive/refs/tags/${rustupVersion}.tar.gz -O rustup.tar.gz" + cargoInst+=" && tar -xf rustup.tar.gz && cd rustup-${rustupVersion}" + cargoInst+=" && bash rustup-init.sh -y --default-toolchain=${rustcVersion}" + cargoInst+=" && rm -rf /tmp/*" echo "RUN ${cargoInst}" + echo "RUN cargo install cargo-c" # since any user may run this image, # open up root tools to everyone echo 'ENV PATH="/root/.local/bin:$PATH"'