Skip to content

Commit

Permalink
build:sh update version for local crates
Browse files Browse the repository at this point in the history
- update for crate openssl-sys-0.9.102
- update for crate zstd-sys-2.0.10+zstd.1.5.6

Signed-off-by: Laurent Cheylus <[email protected]>
  • Loading branch information
lcheylus committed May 30, 2024
1 parent d6d0089 commit d4763d4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,23 @@ rm -f /tmp/cargo-nextest-"${VERSION}".tar.gz
mkdir -p "${WRKDIR}"/crates

# Download crate openssl-sys
echo "[*] Download sources for openssl-sys-0.9.97 crate"
echo "[*] Download sources for openssl-sys-0.9.102 crate"
cd "${WRKDIR}"
curl -sL https://crates.io/api/v1/crates/openssl-sys/0.9.97/download|tar xzf - -C crates
curl -sL https://crates.io/api/v1/crates/openssl-sys/0.9.102/download|tar xzf - -C crates

# Patch crate openssl-sys
echo "[*] Patch sources for openssl-sys-0.9.97 crate"
cd "${WRKDIR}"/crates/openssl-sys-0.9.97
echo "[*] Patch sources for openssl-sys-0.9.102 crate"
cd "${WRKDIR}"/crates/openssl-sys-0.9.102
sed -i.orig -e "/ => ('.', '.'),/h" -e "/ => ('.', '.', '.'),/h" -e "/_ => version_error(),/{g; s/(.*) =>/_ =>/; }" build/main.rs

# Download crate zstd-sys-2.0.9+zstd.1.5.5
echo "[*] Download sources for zstd-sys-2.0.9+zstd.1.5.5 crate"
# Download crate zstd-sys-2.0.10+zstd.1.5.6
echo "[*] Download sources for zstd-sys-2.0.10+zstd.1.5.6 crate"
cd "${WRKDIR}"
curl -sL https://crates.io/api/v1/crates/zstd-sys/2.0.9+zstd.1.5.5/download|tar xzf - -C crates
curl -sL https://crates.io/api/v1/crates/zstd-sys/2.0.10+zstd.1.5.6/download|tar xzf - -C crates

# Patch crate zstd-sys-2.0.9+zstd.1.5.5
echo "[*] Patch sources for zstd-sys-2.0.9+zstd.1.5.5 crate"
cd "${WRKDIR}"/crates/zstd-sys-2.0.9+zstd.1.5.5
# Patch crate zstd-sys-2.0.10+zstd.1.5.6
echo "[*] Patch sources for zstd-sys-2.0.10+zstd.1.5.6 crate"
cd "${WRKDIR}"/crates/zstd-sys-2.0.10+zstd.1.5.6
rm -rf zstd
sed -i.orig -e 's,^fn main() {,fn main() { println!("cargo:rustc-link-lib=zstd"); return;,' build.rs
sed -i '1s/^/#![allow(unreachable_code)]\'$'\n/' build.rs
Expand All @@ -86,8 +86,8 @@ sed -i '1s/^/#![allow(unreachable_code)]\'$'\n/' build.rs
echo "[*] Patch cargo configuration in .cargo/config.toml"

printf "\n[patch.crates-io]\n" > /tmp/cargo_config-patch.toml
printf "openssl-sys = { path = 'crates/openssl-sys-0.9.97'}\n" >> /tmp/cargo_config-patch.toml
printf "zstd-sys = { path = 'crates/zstd-sys-2.0.9+zstd.1.5.5' }\n" >> /tmp/cargo_config-patch.toml
printf "openssl-sys = { path = 'crates/openssl-sys-0.9.102'}\n" >> /tmp/cargo_config-patch.toml
printf "zstd-sys = { path = 'crates/zstd-sys-2.0.10+zstd.1.5.6' }\n" >> /tmp/cargo_config-patch.toml

cat /tmp/cargo_config-patch.toml >> "${WRKDIR}"/.cargo/config.toml
rm -f /tmp/cargo_config-patch.toml
Expand Down

0 comments on commit d4763d4

Please sign in to comment.