more fixes

This commit is contained in:
2025-09-13 21:41:21 -05:00
parent 814664adee
commit 0aa77d9f84
2 changed files with 21 additions and 16 deletions

View File

@@ -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
}

View File

@@ -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"'