diff --git a/extra/cbindgen/build b/extra/cbindgen/build index c9cd72cf..03453e2e 100755 --- a/extra/cbindgen/build +++ b/extra/cbindgen/build @@ -1,8 +1,56 @@ #!/bin/sh -e +# +# Seeing as this is the only rust package in the +# repositories (other than rust itself), this will +# also serve as a reference to writing network-free +# rust-based packages. -cargo fetch \ - --locked +# Set the CARGO_HOME variable to the current directory +# to prevent cargo from touching '$HOME/.cargo'. This +# keeps the build contained to the package manager's +# domain. +export CARGO_HOME=$PWD +# Extract each crate and generate a checksum file. +# This effectively mimics 'cargo vendor' without the +# network requirement. +# +# This allows the package manager to cache each crate +# and handle them as regular sources. +( + cd vendor + + for crate in *.crate; do + tar xf "$crate" + + # Strip the filename from the sha256sum output. + sha256=$(sha256sum "$crate") + sha256=${sha256%% *} + + printf '{"package":"%s","files":{}}\n' "$sha256" \ + > "${crate%.crate}/.cargo-checksum.json" + done +) + +# Cargo reads a "global" configuration file from $CARGO_HOME, +# as we've set it to $PWD this is where we'll be storing the +# vendor config. +mkdir -p .cargo + +# Create the configuration file to tell cargo to look in the +# 'vendor' directory for the already downloaded sources +# rather than crates.io (over network). +cat < .cargo/config +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" +EOF + +# Use the '--frozen' flag to tell cargo to skip the network +# and use whatever dependencies are in the Cargo.[toml|lock] +# files. cargo build \ --release \ --frozen diff --git a/extra/cbindgen/checksums b/extra/cbindgen/checksums index 6f0e25b9..eb615f76 100644 --- a/extra/cbindgen/checksums +++ b/extra/cbindgen/checksums @@ -1 +1,36 @@ bc8a4fb6117e30ce7b7e1fc62470edbb9191a86a5f7168dc10e122983aba2c5d v0.13.1.tar.gz +ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b ansi_term-0.11.0.crate +1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90 atty-0.2.13.crate +cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693 bitflags-1.2.1.crate +214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb c2-chacha-0.2.3.crate +4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822 cfg-if-0.1.10.crate +5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9 clap-2.33.0.crate +e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407 getrandom-0.1.13.crate +501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f itoa-0.4.4.crate +d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558 libc-0.2.66.crate +14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7 log-0.4.8.crate +74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b ppv-lite86-0.2.6.crate +9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27 proc-macro2-1.0.6.crate +053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe quote-1.0.2.crate +3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412 rand-0.7.2.crate +03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853 rand_chacha-0.2.1.crate +90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19 rand_core-0.5.1.crate +ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c rand_hc-0.2.0.crate +2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84 redox_syscall-0.1.56.crate +4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e remove_dir_all-0.5.2.crate +bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8 ryu-1.0.2.crate +414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449 serde-1.0.104.crate +128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64 serde_derive-1.0.104.crate +48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7 serde_json-1.0.44.crate +8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a strsim-0.8.0.crate +dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238 syn-1.0.11.crate +7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9 tempfile-3.1.0.crate +d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060 textwrap-0.11.0.crate +01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf toml-0.5.5.crate +caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479 unicode-width-0.1.7.crate +826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c unicode-xid-0.2.0.crate +05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a vec_map-0.8.1.crate +b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d wasi-0.7.0.crate +8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6 winapi-0.3.8.crate +ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6 winapi-i686-pc-windows-gnu-0.4.0.crate +712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f winapi-x86_64-pc-windows-gnu-0.4.0.crate diff --git a/extra/cbindgen/sources b/extra/cbindgen/sources index 33465440..6851888d 100644 --- a/extra/cbindgen/sources +++ b/extra/cbindgen/sources @@ -1 +1,41 @@ https://github.com/eqrion/cbindgen/archive/v0.13.1.tar.gz + +# This is a pre-generated list of crate dependencies from the +# "kiss-cargo-urlgen" utility. This allows us to pre-cache +# each of the required dependencies and avoid the network +# requirement during build. +https://static.crates.io/crates/ansi_term/ansi_term-0.11.0.crate vendor +https://static.crates.io/crates/atty/atty-0.2.13.crate vendor +https://static.crates.io/crates/bitflags/bitflags-1.2.1.crate vendor +https://static.crates.io/crates/c2-chacha/c2-chacha-0.2.3.crate vendor +https://static.crates.io/crates/cfg-if/cfg-if-0.1.10.crate vendor +https://static.crates.io/crates/clap/clap-2.33.0.crate vendor +https://static.crates.io/crates/getrandom/getrandom-0.1.13.crate vendor +https://static.crates.io/crates/itoa/itoa-0.4.4.crate vendor +https://static.crates.io/crates/libc/libc-0.2.66.crate vendor +https://static.crates.io/crates/log/log-0.4.8.crate vendor +https://static.crates.io/crates/ppv-lite86/ppv-lite86-0.2.6.crate vendor +https://static.crates.io/crates/proc-macro2/proc-macro2-1.0.6.crate vendor +https://static.crates.io/crates/quote/quote-1.0.2.crate vendor +https://static.crates.io/crates/rand/rand-0.7.2.crate vendor +https://static.crates.io/crates/rand_chacha/rand_chacha-0.2.1.crate vendor +https://static.crates.io/crates/rand_core/rand_core-0.5.1.crate vendor +https://static.crates.io/crates/rand_hc/rand_hc-0.2.0.crate vendor +https://static.crates.io/crates/redox_syscall/redox_syscall-0.1.56.crate vendor +https://static.crates.io/crates/remove_dir_all/remove_dir_all-0.5.2.crate vendor +https://static.crates.io/crates/ryu/ryu-1.0.2.crate vendor +https://static.crates.io/crates/serde/serde-1.0.104.crate vendor +https://static.crates.io/crates/serde_derive/serde_derive-1.0.104.crate vendor +https://static.crates.io/crates/serde_json/serde_json-1.0.44.crate vendor +https://static.crates.io/crates/strsim/strsim-0.8.0.crate vendor +https://static.crates.io/crates/syn/syn-1.0.11.crate vendor +https://static.crates.io/crates/tempfile/tempfile-3.1.0.crate vendor +https://static.crates.io/crates/textwrap/textwrap-0.11.0.crate vendor +https://static.crates.io/crates/toml/toml-0.5.5.crate vendor +https://static.crates.io/crates/unicode-width/unicode-width-0.1.7.crate vendor +https://static.crates.io/crates/unicode-xid/unicode-xid-0.2.0.crate vendor +https://static.crates.io/crates/vec_map/vec_map-0.8.1.crate vendor +https://static.crates.io/crates/wasi/wasi-0.7.0.crate vendor +https://static.crates.io/crates/winapi/winapi-0.3.8.crate vendor +https://static.crates.io/crates/winapi-i686-pc-windows-gnu/winapi-i686-pc-windows-gnu-0.4.0.crate vendor +https://static.crates.io/crates/winapi-x86_64-pc-windows-gnu/winapi-x86_64-pc-windows-gnu-0.4.0.crate vendor