From 40e4ae839d1a9c7c9ea2bb9372efa1ea0e710208 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 13:22:59 -0600 Subject: [PATCH 01/45] Fix fetching color --- repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo.sh b/repo.sh index 19ebf960f..5084f866b 100755 --- a/repo.sh +++ b/repo.sh @@ -24,7 +24,7 @@ for recipe in $recipes do if [ ! -d "recipes/$recipe/source/" ] then - echo -e "\033[01;38;5;215mrepo - fetching $recipe\033[0m" >&2 + echo -e "\033[01;38;5;155mrepo - fetching $recipe\033[0m" >&2 ./cook.sh "$recipe" fetch fi From 25fa6a502022f8b215d972e2b4115cd0325a0fed Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 13:23:29 -0600 Subject: [PATCH 02/45] Rust-based cook binary. Currently has fetching implemented --- Cargo.lock | 304 ++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 23 ++++ src/bin/cook.rs | 302 +++++++++++++++++++++++++++++++++++++++++++ src/blake3.rs | 46 +++++++ src/lib.rs | 5 + src/progress_bar.rs | 51 ++++++++ src/recipe.rs | 112 ++++++++++++++++ src/sha256.rs | 45 +++++++ 8 files changed, 888 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 src/bin/cook.rs create mode 100644 src/blake3.rs create mode 100644 src/lib.rs create mode 100644 src/progress_bar.rs create mode 100644 src/recipe.rs create mode 100644 src/sha256.rs diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..e0a5f1d06 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,304 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "arrayvec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "blake3" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cc" +version = "1.0.54" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crypto-mac" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", + "subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libc" +version = "0.2.70" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "numtoa" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pbr" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_cookbook" +version = "0.1.0" +dependencies = [ + "blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_syscall" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "redox_termios" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde" +version = "1.0.110" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.110" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "subtle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termion" +version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "toml" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" +"checksum blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "68df31bdf2bbb567e5adf8f21ac125dc0e897b1381e7b841f181521f06fc3134" +"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +"checksum cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)" = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +"checksum crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +"checksum libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)" = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" +"checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" +"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +"checksum pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4403eb718d70c03ee279e51737782902c68cca01e870a33b6a2f9dfb50b9cd83" +"checksum proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "53f5ffe53a6b28e37c9c1ce74893477864d64f74778a93a4beb43c8fa167f639" +"checksum quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" +"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +"checksum serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c" +"checksum serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" +"checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" +"checksum syn 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)" = "1425de3c33b0941002740a420b1a906a350b88d08b82b2c8a01035a3f9447bac" +"checksum termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" +"checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +"checksum toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +"checksum typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..5b297bc9f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "redox_cookbook" +version = "0.1.0" +authors = ["Jeremy Soller "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[[bin]] +name = "cook" +path = "src/bin/cook.rs" + +[lib] +name = "cookbook" +path = "src/lib.rs" + +[dependencies] +blake3 = "0.3.3" +pbr = "1.0.2" +serde = { version = "1.0", features = ["derive"] } +sha2 = "0.8.1" +termion = "1.5.5" +toml = "0.5.6" diff --git a/src/bin/cook.rs b/src/bin/cook.rs new file mode 100644 index 000000000..aebe86841 --- /dev/null +++ b/src/bin/cook.rs @@ -0,0 +1,302 @@ +use cookbook::blake3::blake3_progress; +use cookbook::recipe::{Recipe, SourceRecipe, BuildRecipe}; +use cookbook::sha256::sha256_progress; +use std::{ + env, + fs, + path::Path, + process::{self, Command}, +}; +use termion::{color, style}; + +fn create_dir_clean(dir: &Path) -> Result<(), String> { + if dir.is_dir() { + // Remove previous directory + fs::remove_dir_all(&dir).map_err(|err| format!( + "failed to remove '{}': {}\n{:?}", + dir.display(), + err, + err + ))?; + } + // directory + fs::create_dir(&dir).map_err(|err| format!( + "failed to create '{}': {}\n{:?}", + dir.display(), + err, + err + )) +} + +fn rename(src: &Path, dst: &Path) -> Result<(), String> { + fs::rename(src, dst).map_err(|err| format!( + "failed to rename '{}' to '{}': {}\n{:?}", + src.display(), + dst.display(), + err, + err + )) +} + +fn run_command(mut command: process::Command) -> Result<(), String> { + let status = command.status().map_err(|err| format!( + "failed to run {:?}: {}\n{:#?}", + command, + err, + err + ))?; + + if ! status.success() { + return Err(format!( + "failed to run {:?}: exited with status {}", + command, + status + )); + } + + Ok(()) +} + +fn fetch(source: &SourceRecipe, recipe_dir: &Path) -> Result<(), String> { + let source_dir = recipe_dir.join("source"); + match source { + SourceRecipe::Git { git, upstream, branch, rev } => { + if ! source_dir.is_dir() { + // Create source.tmp + let source_dir_tmp = recipe_dir.join("source.tmp"); + create_dir_clean(&source_dir_tmp)?; + + // Clone the repository to source.tmp + let mut command = Command::new("git"); + command.arg("clone").arg("--recursive").arg(&git); + if let Some(branch) = branch { + command.arg("--branch").arg(&branch); + } + command.arg(&source_dir); + run_command(command)?; + + // Move source.tmp to source atomically + rename(&source_dir_tmp, &source_dir)?; + } else { + // Reset origin + let mut command = Command::new("git"); + command.arg("-C").arg(&source_dir); + command.arg("remote").arg("set-url").arg("origin").arg(&git); + run_command(command)?; + + // Fetch origin + let mut command = Command::new("git"); + command.arg("-C").arg(&source_dir); + command.arg("fetch").arg("origin"); + run_command(command)?; + } + + if let Some(upstream) = upstream { + //TODO: set upstream URL + // git remote set-url upstream "$GIT_UPSTREAM" &> /dev/null || + // git remote add upstream "$GIT_UPSTREAM" + // git fetch upstream + } + + if let Some(rev) = rev { + // Check out specified revision + let mut command = Command::new("git"); + command.arg("-C").arg(&source_dir); + command.arg("checkout").arg(&rev); + run_command(command)?; + } else { + //TODO: complicated stuff to check and reset branch to origin + // ORIGIN_BRANCH="$(git branch --remotes | grep '^ origin/HEAD -> ' | cut -d ' ' -f 5-)" + // if [ -n "$BRANCH" ] + // then + // ORIGIN_BRANCH="origin/$BRANCH" + // fi + // + // if [ "$(git rev-parse HEAD)" != "$(git rev-parse $ORIGIN_BRANCH)" ] + // then + // git checkout -B "$(echo "$ORIGIN_BRANCH" | cut -d / -f 2-)" "$ORIGIN_BRANCH" + // fi + } + + // Sync submodules URL + let mut command = Command::new("git"); + command.arg("-C").arg(&source_dir); + command.arg("submodule").arg("sync").arg("--recursive"); + run_command(command)?; + + // Update submodules + let mut command = Command::new("git"); + command.arg("-C").arg(&source_dir); + command.arg("submodule").arg("update").arg("--init").arg("--recursive"); + run_command(command)?; + }, + SourceRecipe::Tar { tar, blake3, sha256 } => { + if ! source_dir.is_dir() { + // Download tar + //TODO: replace wget + let source_tar = recipe_dir.join("source.tar"); + if ! source_tar.is_file() { + let source_tar_tmp = recipe_dir.join("source.tar.tmp"); + + let mut command = Command::new("wget"); + command.arg(&tar); + command.arg("-O").arg(&source_tar_tmp); + run_command(command)?; + + // Move source.tar.tmp to source.tar atomically + rename(&source_tar_tmp, &source_tar)?; + } + + if let Some(blake3) = blake3 { + //TODO + // Calculate blake3 + let source_tar_blake3 = blake3_progress(&source_tar).map_err(|err| format!( + "failed to calculate blake3 of '{}': {}\n{:?}", + source_tar.display(), + err, + err + ))?; + + // Check if it matches recipe + if &source_tar_blake3 != blake3 { + return Err(format!( + "calculated blake3 '{}' does not match recipe blake3 '{}'", + source_tar_blake3, + blake3 + )); + } + } + + if let Some(sha256) = sha256 { + // Calculate sha256 + let source_tar_sha256 = sha256_progress(&source_tar).map_err(|err| format!( + "failed to calculate sha256 of '{}': {}\n{:?}", + source_tar.display(), + err, + err + ))?; + + // Check if it matches recipe + if &source_tar_sha256 != sha256 { + return Err(format!( + "calculated sha256 '{}' does not match recipe sha256 '{}'", + source_tar_sha256, + sha256 + )); + } + } + + // Create source.tmp + let source_dir_tmp = recipe_dir.join("source.tmp"); + create_dir_clean(&source_dir_tmp)?; + + // Extract tar to source.tmp + //TODO: use tar crate (how to deal with compression?) + let mut command = Command::new("tar"); + command.arg("--extract"); + command.arg("--verbose"); + command.arg("--file").arg(&source_tar); + command.arg("--directory").arg(&source_dir_tmp); + run_command(command)?; + + // Move source.tmp to source atomically + rename(&source_dir_tmp, &source_dir)?; + } + } + } + + Ok(()) +} + +fn cook(recipe_name: &str) -> Result<(), String> { + //TODO: sanitize recipe name? + let recipe_dir = Path::new("recipes").join(recipe_name); + if ! recipe_dir.is_dir() { + return Err(format!( + "failed to find recipe directory '{}'", + recipe_dir.display() + )); + } + + let recipe_file = recipe_dir.join("recipe.toml"); + if ! recipe_file.is_file() { + return Err(format!( + "failed to find recipe file '{}'", + recipe_file.display() + )); + } + + let recipe_toml = fs::read_to_string(&recipe_file).map_err(|err| format!( + "failed to read recipe file '{}': {}\n{:#?}", + recipe_file.display(), + err, + err + ))?; + + let recipe: Recipe = toml::from_str(&recipe_toml).map_err(|err| format!( + "failed to parse recipe file '{}': {}\n{:#?}", + recipe_file.display(), + err, + err + ))?; + + fetch(&recipe.source, &recipe_dir).map_err(|err| format!( + "failed to fetch: {}", + err + ))?; + + Ok(()) +} + +fn main() { + let mut matching = true; + let mut quiet = false; + let mut recipe_names = Vec::new(); + for arg in env::args().skip(1) { + match arg.as_str() { + "--" if matching => matching = false, + "-q" | "--quiet" if matching => quiet = true, + _ => recipe_names.push(arg), + } + } + + for recipe_name in recipe_names.iter() { + if ! quiet { + eprintln!( + "{}{}cook - {}{}{}", + style::Bold, + color::Fg(color::AnsiValue(215)), + recipe_name, + color::Fg(color::Reset), + style::Reset, + ); + } + + match cook(recipe_name) { + Ok(()) => { + if ! quiet { + eprintln!( + "{}{}cook - {} - successful{}{}", + style::Bold, + color::Fg(color::AnsiValue(46)), + recipe_name, + color::Fg(color::Reset), + style::Reset, + ); + } + }, + Err(err) => { + eprintln!( + "{}{}cook - {} - error:{}{} {}", + style::Bold, + color::Fg(color::AnsiValue(196)), + recipe_name, + color::Fg(color::Reset), + style::Reset, + err, + ); + process::exit(1); + } + } + } +} diff --git a/src/blake3.rs b/src/blake3.rs new file mode 100644 index 000000000..acc037d35 --- /dev/null +++ b/src/blake3.rs @@ -0,0 +1,46 @@ +use blake3::Hasher; +use std::{ + fs, + io::{Read, Result}, + path::Path, + time::Duration, +}; + +use crate::progress_bar::{ProgressBar, ProgressBarRead}; + +pub fn blake3(r: &mut R) -> Result { + let mut hasher = Hasher::new(); + + let mut data = vec![0; 4 * 1024 * 1024]; + loop { + let count = r.read(&mut data)?; + if count == 0 { + break; + } + + hasher.update(&data[..count]); + } + + let hash = hasher.finalize(); + Ok(format!("{}", hash.to_hex())) +} + +pub fn blake3_progress>(path: P) -> Result { + let len = fs::metadata(&path)?.len(); + + let mut f = fs::File::open(&path)?; + + let mut pb = ProgressBar::new(len); + pb.message("blake3: "); + pb.set_max_refresh_rate(Some(Duration::new(1, 0))); + pb.set_units(pbr::Units::Bytes); + + let res = { + let mut pbr = ProgressBarRead::new(&mut pb, &mut f); + blake3(&mut pbr) + }; + + pb.finish_println(""); + + res +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 000000000..2fbe53530 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,5 @@ +pub mod blake3; +pub mod recipe; +pub mod sha256; + +mod progress_bar; diff --git a/src/progress_bar.rs b/src/progress_bar.rs new file mode 100644 index 000000000..c02b939d3 --- /dev/null +++ b/src/progress_bar.rs @@ -0,0 +1,51 @@ +pub use pbr::ProgressBar; + +use std::io::{Read, Write, Result}; + +pub struct ProgressBarRead<'p, 'r, P: Write + 'p, R: Read + 'r> { + pb: &'p mut ProgressBar

, + r: &'r mut R, +} + +impl<'p, 'r, P: Write, R: Read> ProgressBarRead<'p, 'r, P, R> { + pub fn new(pb: &'p mut ProgressBar

, r: &'r mut R) -> ProgressBarRead<'p, 'r, P, R> { + ProgressBarRead { + pb: pb, + r: r + } + } +} + +impl<'p, 'r, P: Write, R: Read> Read for ProgressBarRead<'p, 'r, P, R> { + fn read(&mut self, buf: &mut [u8]) -> Result { + let count = self.r.read(buf)?; + self.pb.add(count as u64); + Ok(count) + } +} + +pub struct ProgressBarWrite<'p, 'w, P: Write + 'p, W: Write + 'w> { + pb: &'p mut ProgressBar

, + w: &'w mut W, +} + +impl<'p, 'w, P: Write, W: Write> ProgressBarWrite<'p, 'w, P, W> { + pub fn new(pb: &'p mut ProgressBar

, w: &'w mut W) -> ProgressBarWrite<'p, 'w, P, W> { + ProgressBarWrite { + pb: pb, + w: w + } + } +} + +impl<'p, 'w, P: Write, W: Write> Write for ProgressBarWrite<'p, 'w, P, W> { + fn write(&mut self, buf: &[u8]) -> Result { + let count = self.w.write(buf)?; + self.pb.add(count as u64); + Ok(count) + } + + fn flush(&mut self) -> Result<()> { + self.w.flush() + } +} diff --git a/src/recipe.rs b/src/recipe.rs new file mode 100644 index 000000000..6ec4a918e --- /dev/null +++ b/src/recipe.rs @@ -0,0 +1,112 @@ +use serde::{Deserialize, Serialize}; + +/// Specifies how to download the source for a recipe +#[derive(Debug, Deserialize, PartialEq, Serialize)] +#[serde(untagged)] +pub enum SourceRecipe { + /// A git repository source + Git { + /// The URL for the git repository, such as https://gitlab.redox-os.org/redox-os/ion.git + git: String, + /// The URL for an upstream repository + upstream: Option, + /// The optional branch of the git repository to track, such as master. Please specify to + /// make updates to the rev easier + branch: Option, + /// The optional revision of the git repository to use for builds. Please specify for + /// reproducible builds + rev: Option, + }, + /// A tar file source + Tar { + /// The URL of a tar source + tar: String, + /// The optional blake3 sum of the tar file. Please specify this to make reproducible + /// builds more reliable + blake3: Option, + /// The optional sha256 sum of the tar file. This is a slower alternative to a blake3 sum + sha256: Option, + }, +} + +/// Specifies how to build a recipe +#[derive(Debug, Deserialize, PartialEq, Serialize)] +#[serde(tag = "template")] +pub enum BuildRecipe { + /// Will build and install using cargo + #[serde(rename = "cargo")] + Cargo, + /// Will build and install using custom commands + #[serde(rename = "custom")] + Custom { + script: String, + }, +} + +/// Everything required to build a Redox package +#[derive(Debug, Deserialize, PartialEq, Serialize)] +pub struct Recipe { + /// Specifies how to donload the source for this recipe + pub source: SourceRecipe, + /// A list of patch files to apply to the source + #[serde(default)] + pub patches: Vec, + /// Specifies how to build this recipe + pub build: BuildRecipe, +} + + +#[cfg(test)] +mod tests { + #[test] + fn git_cargo_recipe() { + use crate::recipe::{Recipe, SourceRecipe, BuildRecipe}; + + let recipe: Recipe = toml::from_str(r#" + [source] + git = "https://gitlab.redox-os.org/redox-os/acid.git" + branch = "master" + rev = "06344744d3d55a5ac9a62a6059cb363d40699bbc" + + [build] + template = "cargo" + "#).unwrap(); + + assert_eq!(recipe, Recipe { + source: SourceRecipe::Git { + git: "https://gitlab.redox-os.org/redox-os/acid.git".to_string(), + upstream: None, + branch: Some("master".to_string()), + rev: Some("06344744d3d55a5ac9a62a6059cb363d40699bbc".to_string()), + }, + patches: Vec::new(), + build: BuildRecipe::Cargo, + }); + } + + #[test] + fn tar_custom_recipe() { + use crate::recipe::{Recipe, SourceRecipe, BuildRecipe}; + + let recipe: Recipe = toml::from_str(r#" + [source] + tar = "http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.xz" + sha256 = "4f3fc6178a533d392064f14776b23c397ed4b9f48f5de297aba73b643f955c08" + + [build] + template = "custom" + script = "make" + "#).unwrap(); + + assert_eq!(recipe, Recipe { + source: SourceRecipe::Tar { + tar: "http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.xz".to_string(), + sha256: Some("4f3fc6178a533d392064f14776b23c397ed4b9f48f5de297aba73b643f955c08".to_string()), + }, + patches: Vec::new(), + build: BuildRecipe::Custom { + script: "make".to_string() + }, + }); + } +} diff --git a/src/sha256.rs b/src/sha256.rs new file mode 100644 index 000000000..c424e0013 --- /dev/null +++ b/src/sha256.rs @@ -0,0 +1,45 @@ +use std::{ + fs, + io::{Read, Result}, + path::Path, + time::Duration, +}; +use sha2::{Digest, Sha256}; + +use crate::progress_bar::{ProgressBar, ProgressBarRead}; + +pub fn sha256(r: &mut R) -> Result { + let mut hasher = Sha256::default(); + + let mut data = vec![0; 4 * 1024 * 1024]; + loop { + let count = r.read(&mut data)?; + if count == 0 { + break; + } + + hasher.input(&data[..count]); + } + + Ok(format!("{:x}", hasher.result())) +} + +pub fn sha256_progress>(path: P) -> Result { + let len = fs::metadata(&path)?.len(); + + let mut f = fs::File::open(&path)?; + + let mut pb = ProgressBar::new(len); + pb.message("sha256: "); + pb.set_max_refresh_rate(Some(Duration::new(1, 0))); + pb.set_units(pbr::Units::Bytes); + + let res = { + let mut pbr = ProgressBarRead::new(&mut pb, &mut f); + sha256(&mut pbr) + }; + + pb.finish_println(""); + + res +} From 11a244bef324f55b02325b1dcaf7dac88676b36a Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 14:02:01 -0600 Subject: [PATCH 03/45] Implement patching --- src/bin/cook.rs | 75 +++++++++++++++++++++++++++++++++++++++++++++---- src/recipe.rs | 6 ++-- 2 files changed, 72 insertions(+), 9 deletions(-) diff --git a/src/bin/cook.rs b/src/bin/cook.rs index aebe86841..03e5c0892 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -4,8 +4,9 @@ use cookbook::sha256::sha256_progress; use std::{ env, fs, - path::Path, - process::{self, Command}, + io::Write, + path::{Path, PathBuf}, + process::{self, Command, Stdio}, }; use termion::{color, style}; @@ -57,7 +58,7 @@ fn run_command(mut command: process::Command) -> Result<(), String> { Ok(()) } -fn fetch(source: &SourceRecipe, recipe_dir: &Path) -> Result<(), String> { +fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { let source_dir = recipe_dir.join("source"); match source { SourceRecipe::Git { git, upstream, branch, rev } => { @@ -130,7 +131,7 @@ fn fetch(source: &SourceRecipe, recipe_dir: &Path) -> Result<(), String> { command.arg("submodule").arg("update").arg("--init").arg("--recursive"); run_command(command)?; }, - SourceRecipe::Tar { tar, blake3, sha256 } => { + SourceRecipe::Tar { tar, blake3, sha256, patches } => { if ! source_dir.is_dir() { // Download tar //TODO: replace wget @@ -197,15 +198,77 @@ fn fetch(source: &SourceRecipe, recipe_dir: &Path) -> Result<(), String> { command.arg("--verbose"); command.arg("--file").arg(&source_tar); command.arg("--directory").arg(&source_dir_tmp); + command.arg("--strip-components").arg("1"); run_command(command)?; + // Apply patches + for patch_name in patches { + let patch_file = recipe_dir.join(&patch_name); + if ! patch_file.is_file() { + return Err(format!( + "failed to find patch file '{}'", + patch_file.display() + )); + } + + let patch = fs::read_to_string(&patch_file).map_err(|err| format!( + "failed to read patch file '{}': {}\n{:#?}", + patch_file.display(), + err, + err + ))?; + + let mut command = Command::new("patch"); + command.arg("--directory").arg(&source_dir_tmp); + command.arg("--strip=1"); + command.stdin(Stdio::piped()); + + let mut child = command.spawn().map_err(|err| format!( + "failed to spawn {:?}: {}\n{:#?}", + command, + err, + err + ))?; + + if let Some(ref mut stdin) = child.stdin { + stdin.write_all(patch.as_bytes()).map_err(|err| format!( + "failed to write stdin of {:?}: {}\n{:#?}", + command, + err, + err + ))?; + } else { + return Err(format!( + "failed to find stdin of {:?}", + command + )); + } + + let status = child.wait().map_err(|err| format!( + "failed to run {:?}: {}\n{:#?}", + command, + err, + err + ))?; + + if ! status.success() { + return Err(format!( + "failed to run {:?}: exited with status {}", + command, + status + )); + } + + run_command(command)?; + } + // Move source.tmp to source atomically rename(&source_dir_tmp, &source_dir)?; } } } - Ok(()) + Ok(source_dir) } fn cook(recipe_name: &str) -> Result<(), String> { @@ -240,7 +303,7 @@ fn cook(recipe_name: &str) -> Result<(), String> { err ))?; - fetch(&recipe.source, &recipe_dir).map_err(|err| format!( + let source_dir = fetch(&recipe_dir, &recipe.source).map_err(|err| format!( "failed to fetch: {}", err ))?; diff --git a/src/recipe.rs b/src/recipe.rs index 6ec4a918e..da6db88aa 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -26,6 +26,9 @@ pub enum SourceRecipe { blake3: Option, /// The optional sha256 sum of the tar file. This is a slower alternative to a blake3 sum sha256: Option, + /// A list of patch files to apply to the source + #[serde(default)] + patches: Vec, }, } @@ -48,9 +51,6 @@ pub enum BuildRecipe { pub struct Recipe { /// Specifies how to donload the source for this recipe pub source: SourceRecipe, - /// A list of patch files to apply to the source - #[serde(default)] - pub patches: Vec, /// Specifies how to build this recipe pub build: BuildRecipe, } From fa00a61b9563f6b154a2073307e81fd4ff312cce Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 14:04:16 -0600 Subject: [PATCH 04/45] Remove duplicate execution of patch command --- src/bin/cook.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 03e5c0892..06edae0c4 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -258,8 +258,6 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { status )); } - - run_command(command)?; } // Move source.tmp to source atomically From 204e968016f3a8a98d3076d89699f36910e0fb3f Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 15:44:37 -0600 Subject: [PATCH 05/45] Implement builds, add some recipes --- .gitignore | 6 + recipes/acid/recipe.toml | 6 + recipes/libffi/recipe.toml | 8 + recipes/libffi/redox.patch | 2820 +++++++++++++++++++++++++++++++++++ recipes/libogg/recipe.toml | 9 + recipes/libogg/redox.patch | 2833 ++++++++++++++++++++++++++++++++++++ recipes/pcre/recipe.toml | 8 + src/bin/cook.rs | 164 ++- src/recipe.rs | 3 + 9 files changed, 5819 insertions(+), 38 deletions(-) create mode 100644 recipes/acid/recipe.toml create mode 100644 recipes/libffi/recipe.toml create mode 100644 recipes/libffi/redox.patch create mode 100644 recipes/libogg/recipe.toml create mode 100644 recipes/libogg/redox.patch create mode 100644 recipes/pcre/recipe.toml diff --git a/.gitignore b/.gitignore index eab8ed427..7fd983980 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,9 @@ stage.tar.gz stage.toml sysroot xargo + + +#Added by cargo + +/target +**/*.rs.bk diff --git a/recipes/acid/recipe.toml b/recipes/acid/recipe.toml new file mode 100644 index 000000000..2c63247f6 --- /dev/null +++ b/recipes/acid/recipe.toml @@ -0,0 +1,6 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/acid.git" +branch = "master" + +[build] +template = "cargo" diff --git a/recipes/libffi/recipe.toml b/recipes/libffi/recipe.toml new file mode 100644 index 000000000..cebe71c4a --- /dev/null +++ b/recipes/libffi/recipe.toml @@ -0,0 +1,8 @@ +[source] +tar = "https://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz" +patches = [ + "redox.patch" +] + +[build] +template = "configure" diff --git a/recipes/libffi/redox.patch b/recipes/libffi/redox.patch new file mode 100644 index 000000000..c96d3cf9d --- /dev/null +++ b/recipes/libffi/redox.patch @@ -0,0 +1,2820 @@ +--- source/config.sub 2014-11-12 04:59:58.000000000 -0700 ++++ source-newconfig.sub 2020-05-20 15:41:56.000000000 -0600 +@@ -1,8 +1,8 @@ + #! /bin/sh + # Configuration validation subroutine script. +-# Copyright 1992-2013 Free Software Foundation, Inc. ++# Copyright 1992-2020 Free Software Foundation, Inc. + +-timestamp='2013-04-24' ++timestamp='2020-05-04' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +@@ -15,7 +15,7 @@ + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, see . ++# along with this program; if not, see . + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a +@@ -25,7 +25,7 @@ + # of the GNU General Public License, version 3 ("GPLv3"). + + +-# Please send patches with a ChangeLog entry to config-patches@gnu.org. ++# Please send patches to . + # + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. +@@ -33,7 +33,7 @@ + # Otherwise, we print the canonical config type on stdout and succeed. + + # You can get the latest version of this script from: +-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD ++# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases +@@ -53,12 +53,11 @@ + me=`echo "$0" | sed -e 's,.*/,,'` + + usage="\ +-Usage: $0 [OPTION] CPU-MFR-OPSYS +- $0 [OPTION] ALIAS ++Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + + Canonicalize a configuration name. + +-Operation modes: ++Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit +@@ -68,7 +67,7 @@ + version="\ + GNU config.sub ($timestamp) + +-Copyright 1992-2013 Free Software Foundation, Inc. ++Copyright 1992-2020 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -90,12 +89,12 @@ + - ) # Use stdin as input. + break ;; + -* ) +- echo "$me: invalid option $1$help" ++ echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. +- echo $1 ++ echo "$1" + exit ;; + + * ) +@@ -111,1209 +110,1164 @@ + exit 1;; + esac + +-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +-# Here we must recognize all the valid KERNEL-OS combinations. +-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` ++# Split fields of configuration type ++# shellcheck disable=SC2162 ++IFS="-" read field1 field2 field3 field4 <&2 ++ exit 1 ++ ;; ++ *-*-*-*) ++ basic_machine=$field1-$field2 ++ os=$field3-$field4 ++ ;; ++ *-*-*) ++ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two ++ # parts ++ maybe_os=$field2-$field3 + case $maybe_os in +- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ +- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ +- knetbsd*-gnu* | netbsd*-gnu* | \ +- kopensolaris*-gnu* | \ +- storm-chaos* | os2-emx* | rtmk-nova*) +- os=-$maybe_os +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ ++ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ ++ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ ++ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ ++ | storm-chaos* | os2-emx* | rtmk-nova*) ++ basic_machine=$field1 ++ os=$maybe_os + ;; + android-linux) +- os=-linux-android +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ++ basic_machine=$field1-unknown ++ os=linux-android + ;; + *) +- basic_machine=`echo $1 | sed 's/-[^-]*$//'` +- if [ $basic_machine != $1 ] +- then os=`echo $1 | sed 's/.*-/-/'` +- else os=; fi ++ basic_machine=$field1-$field2 ++ os=$field3 + ;; + esac +- +-### Let's recognize common machines as not being operating systems so +-### that things like config.sub decstation-3100 work. We also +-### recognize some manufacturers as not being operating systems, so we +-### can provide default operating systems below. +-case $os in +- -sun*os*) +- # Prevent following clause from handling this invalid input. + ;; +- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ +- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ +- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ +- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ +- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ +- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ +- -apple | -axis | -knuth | -cray | -microblaze*) ++ *-*) ++ # A lone config we happen to match not fitting any pattern ++ case $field1-$field2 in ++ decstation-3100) ++ basic_machine=mips-dec + os= +- basic_machine=$1 +- ;; +- -bluegene*) +- os=-cnk + ;; +- -sim | -cisco | -oki | -wec | -winbond) ++ *-*) ++ # Second component is usually, but not always the OS ++ case $field2 in ++ # Prevent following clause from handling this valid os ++ sun*os*) ++ basic_machine=$field1 ++ os=$field2 ++ ;; ++ # Manufacturers ++ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ ++ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ ++ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ ++ | convergent* | ncr* | news | 32* | 3600* | 3100* \ ++ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ ++ | ultra | tti* | harris | dolphin | highlevel | gould \ ++ | cbm | ns | masscomp | apple | axis | knuth | cray \ ++ | microblaze* | sim | cisco \ ++ | oki | wec | wrs | winbond) ++ basic_machine=$field1-$field2 + os= +- basic_machine=$1 +- ;; +- -scout) +- ;; +- -wrs) +- os=-vxworks +- basic_machine=$1 +- ;; +- -chorusos*) +- os=-chorusos +- basic_machine=$1 +- ;; +- -chorusrdb) +- os=-chorusrdb +- basic_machine=$1 +- ;; +- -hiux*) +- os=-hiuxwe2 +- ;; +- -sco6) +- os=-sco5v6 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5) +- os=-sco3.2v5 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco4) +- os=-sco3.2v4 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; +- -sco3.2.[4-9]*) +- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco3.2v[4-9]*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5v6*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco*) +- os=-sco3.2v2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -udk*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -isc) +- os=-isc2.2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -clix*) +- basic_machine=clipper-intergraph +- ;; +- -isc*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -lynx*178) +- os=-lynxos178 +- ;; +- -lynx*5) +- os=-lynxos5 +- ;; +- -lynx*) +- os=-lynxos +- ;; +- -ptx*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` +- ;; +- -windowsnt*) +- os=`echo $os | sed -e 's/windowsnt/winnt/'` +- ;; +- -psos*) +- os=-psos +- ;; +- -mint | -mint[0-9]*) +- basic_machine=m68k-atari +- os=-mint ++ *) ++ basic_machine=$field1 ++ os=$field2 + ;; + esac +- +-# Decode aliases for certain CPU-COMPANY combinations. +-case $basic_machine in +- # Recognize the basic CPU types without company name. +- # Some are omitted here because they have special meanings below. +- 1750a | 580 \ +- | a29k \ +- | aarch64 | aarch64_be \ +- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ +- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ +- | am33_2.0 \ +- | arc | arceb \ +- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ +- | avr | avr32 \ +- | be32 | be64 \ +- | bfin \ +- | c4x | clipper \ +- | d10v | d30v | dlx | dsp16xx \ +- | epiphany \ +- | fido | fr30 | frv \ +- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ +- | hexagon \ +- | i370 | i860 | i960 | ia64 \ +- | ip2k | iq2000 \ +- | le32 | le64 \ +- | lm32 \ +- | m32c | m32r | m32rle | m68000 | m68k | m88k \ +- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ +- | mips | mipsbe | mipseb | mipsel | mipsle \ +- | mips16 \ +- | mips64 | mips64el \ +- | mips64octeon | mips64octeonel \ +- | mips64orion | mips64orionel \ +- | mips64r5900 | mips64r5900el \ +- | mips64vr | mips64vrel \ +- | mips64vr4100 | mips64vr4100el \ +- | mips64vr4300 | mips64vr4300el \ +- | mips64vr5000 | mips64vr5000el \ +- | mips64vr5900 | mips64vr5900el \ +- | mipsisa32 | mipsisa32el \ +- | mipsisa32r2 | mipsisa32r2el \ +- | mipsisa64 | mipsisa64el \ +- | mipsisa64r2 | mipsisa64r2el \ +- | mipsisa64sb1 | mipsisa64sb1el \ +- | mipsisa64sr71k | mipsisa64sr71kel \ +- | mipsr5900 | mipsr5900el \ +- | mipstx39 | mipstx39el \ +- | mn10200 | mn10300 \ +- | moxie \ +- | mt \ +- | msp430 \ +- | nds32 | nds32le | nds32be \ +- | nios | nios2 | nios2eb | nios2el \ +- | ns16k | ns32k \ +- | open8 \ +- | or1k | or32 \ +- | pdp10 | pdp11 | pj | pjl \ +- | powerpc | powerpc64 | powerpc64le | powerpcle \ +- | pyramid \ +- | rl78 | rx \ +- | score \ +- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ +- | sh64 | sh64le \ +- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ +- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ +- | spu \ +- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ +- | ubicom32 \ +- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ +- | we32k \ +- | x86 | xc16x | xstormy16 | xtensa \ +- | z8k | z80) +- basic_machine=$basic_machine-unknown +- ;; +- c54x) +- basic_machine=tic54x-unknown +- ;; +- c55x) +- basic_machine=tic55x-unknown +- ;; +- c6x) +- basic_machine=tic6x-unknown +- ;; +- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) +- basic_machine=$basic_machine-unknown +- os=-none +- ;; +- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) +- ;; +- ms1) +- basic_machine=mt-unknown +- ;; +- +- strongarm | thumb | xscale) +- basic_machine=arm-unknown +- ;; +- xgate) +- basic_machine=$basic_machine-unknown +- os=-none +- ;; +- xscaleeb) +- basic_machine=armeb-unknown +- ;; +- +- xscaleel) +- basic_machine=armel-unknown +- ;; +- +- # We use `pc' rather than `unknown' +- # because (1) that's what they normally are, and +- # (2) the word "unknown" tends to confuse beginning users. +- i*86 | x86_64) +- basic_machine=$basic_machine-pc + ;; +- # Object if more than one company name word. +- *-*-*) +- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 +- exit 1 +- ;; +- # Recognize the basic CPU types with company name. +- 580-* \ +- | a29k-* \ +- | aarch64-* | aarch64_be-* \ +- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ +- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ +- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ +- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* | avr32-* \ +- | be32-* | be64-* \ +- | bfin-* | bs2000-* \ +- | c[123]* | c30-* | [cjt]90-* | c4x-* \ +- | clipper-* | craynv-* | cydra-* \ +- | d10v-* | d30v-* | dlx-* \ +- | elxsi-* \ +- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ +- | h8300-* | h8500-* \ +- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ +- | hexagon-* \ +- | i*86-* | i860-* | i960-* | ia64-* \ +- | ip2k-* | iq2000-* \ +- | le32-* | le64-* \ +- | lm32-* \ +- | m32c-* | m32r-* | m32rle-* \ +- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ +- | microblaze-* | microblazeel-* \ +- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ +- | mips16-* \ +- | mips64-* | mips64el-* \ +- | mips64octeon-* | mips64octeonel-* \ +- | mips64orion-* | mips64orionel-* \ +- | mips64r5900-* | mips64r5900el-* \ +- | mips64vr-* | mips64vrel-* \ +- | mips64vr4100-* | mips64vr4100el-* \ +- | mips64vr4300-* | mips64vr4300el-* \ +- | mips64vr5000-* | mips64vr5000el-* \ +- | mips64vr5900-* | mips64vr5900el-* \ +- | mipsisa32-* | mipsisa32el-* \ +- | mipsisa32r2-* | mipsisa32r2el-* \ +- | mipsisa64-* | mipsisa64el-* \ +- | mipsisa64r2-* | mipsisa64r2el-* \ +- | mipsisa64sb1-* | mipsisa64sb1el-* \ +- | mipsisa64sr71k-* | mipsisa64sr71kel-* \ +- | mipsr5900-* | mipsr5900el-* \ +- | mipstx39-* | mipstx39el-* \ +- | mmix-* \ +- | mt-* \ +- | msp430-* \ +- | nds32-* | nds32le-* | nds32be-* \ +- | nios-* | nios2-* | nios2eb-* | nios2el-* \ +- | none-* | np1-* | ns16k-* | ns32k-* \ +- | open8-* \ +- | orion-* \ +- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ +- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ +- | pyramid-* \ +- | rl78-* | romp-* | rs6000-* | rx-* \ +- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ +- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ +- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ +- | sparclite-* \ +- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ +- | tahoe-* \ +- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ +- | tile*-* \ +- | tron-* \ +- | ubicom32-* \ +- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ +- | vax-* \ +- | we32k-* \ +- | x86-* | x86_64-* | xc16x-* | xps100-* \ +- | xstormy16-* | xtensa*-* \ +- | ymp-* \ +- | z8k-* | z80-*) +- ;; +- # Recognize the basic CPU types without company name, with glob match. +- xtensa*) +- basic_machine=$basic_machine-unknown ++ esac + ;; +- # Recognize the various machine names and aliases which stand +- # for a CPU type and a company and sometimes even an OS. ++ *) ++ # Convert single-component short-hands not valid as part of ++ # multi-component configurations. ++ case $field1 in + 386bsd) +- basic_machine=i386-unknown +- os=-bsd +- ;; +- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) +- basic_machine=m68000-att +- ;; +- 3b*) +- basic_machine=we32k-att ++ basic_machine=i386-pc ++ os=bsd + ;; + a29khif) + basic_machine=a29k-amd +- os=-udi +- ;; +- abacus) +- basic_machine=abacus-unknown ++ os=udi + ;; + adobe68k) + basic_machine=m68010-adobe +- os=-scout ++ os=scout + ;; +- alliant | fx80) ++ alliant) + basic_machine=fx80-alliant ++ os= + ;; + altos | altos3068) + basic_machine=m68k-altos ++ os= + ;; + am29k) + basic_machine=a29k-none +- os=-bsd +- ;; +- amd64) +- basic_machine=x86_64-pc +- ;; +- amd64-*) +- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=bsd + ;; + amdahl) + basic_machine=580-amdahl +- os=-sysv ++ os=sysv + ;; +- amiga | amiga-*) ++ amiga) + basic_machine=m68k-unknown ++ os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown +- os=-amigaos ++ os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown +- os=-sysv4 ++ os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo +- os=-sysv ++ os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo +- os=-bsd ++ os=bsd + ;; + aros) + basic_machine=i386-pc +- os=-aros ++ os=aros + ;; + aux) + basic_machine=m68k-apple +- os=-aux ++ os=aux + ;; + balance) + basic_machine=ns32k-sequent +- os=-dynix ++ os=dynix + ;; + blackfin) + basic_machine=bfin-unknown +- os=-linux +- ;; +- blackfin-*) +- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- bluegene*) +- basic_machine=powerpc-ibm +- os=-cnk +- ;; +- c54x-*) +- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c55x-*) +- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c6x-*) +- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c90) +- basic_machine=c90-cray +- os=-unicos ++ os=linux + ;; + cegcc) + basic_machine=arm-unknown +- os=-cegcc ++ os=cegcc + ;; + convex-c1) + basic_machine=c1-convex +- os=-bsd ++ os=bsd + ;; + convex-c2) + basic_machine=c2-convex +- os=-bsd ++ os=bsd + ;; + convex-c32) + basic_machine=c32-convex +- os=-bsd ++ os=bsd + ;; + convex-c34) + basic_machine=c34-convex +- os=-bsd ++ os=bsd + ;; + convex-c38) + basic_machine=c38-convex +- os=-bsd ++ os=bsd + ;; +- cray | j90) ++ cray) + basic_machine=j90-cray +- os=-unicos +- ;; +- craynv) +- basic_machine=craynv-cray +- os=-unicosmp +- ;; +- cr16 | cr16-*) +- basic_machine=cr16-unknown +- os=-elf ++ os=unicos + ;; + crds | unos) + basic_machine=m68k-crds ++ os= + ;; +- crisv32 | crisv32-* | etraxfs*) +- basic_machine=crisv32-axis +- ;; +- cris | cris-* | etrax*) +- basic_machine=cris-axis +- ;; +- crx) +- basic_machine=crx-unknown +- os=-elf +- ;; +- da30 | da30-*) ++ da30) + basic_machine=m68k-da30 ++ os= + ;; +- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) ++ decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec +- ;; +- decsystem10* | dec10*) +- basic_machine=pdp10-dec +- os=-tops10 +- ;; +- decsystem20* | dec20*) +- basic_machine=pdp10-dec +- os=-tops20 +- ;; +- delta | 3300 | motorola-3300 | motorola-delta \ +- | 3300-motorola | delta-motorola) +- basic_machine=m68k-motorola ++ os= + ;; + delta88) + basic_machine=m88k-motorola +- os=-sysv3 ++ os=sysv3 + ;; + dicos) + basic_machine=i686-pc +- os=-dicos ++ os=dicos + ;; + djgpp) + basic_machine=i586-pc +- os=-msdosdjgpp +- ;; +- dpx20 | dpx20-*) +- basic_machine=rs6000-bull +- os=-bosx +- ;; +- dpx2* | dpx2*-bull) +- basic_machine=m68k-bull +- os=-sysv3 ++ os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd +- os=-ebmon +- ;; +- elxsi) +- basic_machine=elxsi-elxsi +- os=-bsd +- ;; +- encore | umax | mmax) +- basic_machine=ns32k-encore ++ os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson +- os=-ose +- ;; +- fx2800) +- basic_machine=i860-alliant +- ;; +- genix) +- basic_machine=ns32k-ns ++ os=ose + ;; + gmicro) + basic_machine=tron-gmicro +- os=-sysv ++ os=sysv + ;; + go32) + basic_machine=i386-pc +- os=-go32 +- ;; +- h3050r* | hiux*) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 ++ os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi +- os=-hms ++ os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi +- os=-xray ++ os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi +- os=-hms ++ os=hms + ;; + harris) + basic_machine=m88k-harris +- os=-sysv3 ++ os=sysv3 + ;; +- hp300-*) ++ hp300 | hp300hpux) + basic_machine=m68k-hp ++ os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp +- os=-bsd +- ;; +- hp300hpux) +- basic_machine=m68k-hp +- os=-hpux +- ;; +- hp3k9[0-9][0-9] | hp9[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hp9k2[0-9][0-9] | hp9k31[0-9]) +- basic_machine=m68000-hp +- ;; +- hp9k3[2-9][0-9]) +- basic_machine=m68k-hp +- ;; +- hp9k6[0-9][0-9] | hp6[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hp9k7[0-79][0-9] | hp7[0-79][0-9]) +- basic_machine=hppa1.1-hp +- ;; +- hp9k78[0-9] | hp78[0-9]) +- # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp +- ;; +- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) +- # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp +- ;; +- hp9k8[0-9][13679] | hp8[0-9][13679]) +- basic_machine=hppa1.1-hp +- ;; +- hp9k8[0-9][0-9] | hp8[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hppa-next) +- os=-nextstep3 ++ os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp +- os=-osf ++ os=osf + ;; + hppro) + basic_machine=hppa1.1-hp +- os=-proelf +- ;; +- i370-ibm* | ibm*) +- basic_machine=i370-ibm +- ;; +- i*86v32) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv32 +- ;; +- i*86v4*) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv4 +- ;; +- i*86v) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv +- ;; +- i*86sol2) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-solaris2 ++ os=proelf + ;; + i386mach) + basic_machine=i386-mach +- os=-mach +- ;; +- i386-vsta | vsta) +- basic_machine=i386-unknown +- os=-vsta +- ;; +- iris | iris4d) +- basic_machine=mips-sgi +- case $os in +- -irix*) +- ;; +- *) +- os=-irix4 +- ;; +- esac ++ os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi +- os=-sysv ++ os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown +- os=-linux +- ;; +- m68knommu-*) +- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- m88k-omron*) +- basic_machine=m88k-omron ++ os=linux + ;; + magnum | m3230) + basic_machine=mips-mips +- os=-sysv ++ os=sysv + ;; + merlin) + basic_machine=ns32k-utek +- os=-sysv +- ;; +- microblaze*) +- basic_machine=microblaze-xilinx ++ os=sysv + ;; + mingw64) + basic_machine=x86_64-pc +- os=-mingw64 ++ os=mingw64 + ;; + mingw32) +- basic_machine=i386-pc +- os=-mingw32 ++ basic_machine=i686-pc ++ os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown +- os=-mingw32ce +- ;; +- miniframe) +- basic_machine=m68000-convergent +- ;; +- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) +- basic_machine=m68k-atari +- os=-mint +- ;; +- mips3*-*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` +- ;; +- mips3*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ++ os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k +- os=-coff ++ os=coff + ;; + morphos) + basic_machine=powerpc-unknown +- os=-morphos ++ os=morphos ++ ;; ++ moxiebox) ++ basic_machine=moxie-unknown ++ os=moxiebox + ;; + msdos) + basic_machine=i386-pc +- os=-msdos +- ;; +- ms1-*) +- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ++ os=msdos + ;; + msys) +- basic_machine=i386-pc +- os=-msys ++ basic_machine=i686-pc ++ os=msys + ;; + mvs) + basic_machine=i370-ibm +- os=-mvs ++ os=mvs + ;; + nacl) + basic_machine=le32-unknown +- os=-nacl ++ os=nacl + ;; + ncr3000) + basic_machine=i486-ncr +- os=-sysv4 ++ os=sysv4 + ;; + netbsd386) +- basic_machine=i386-unknown +- os=-netbsd ++ basic_machine=i386-pc ++ os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel +- os=-linux ++ os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony +- os=-newsos ++ os=newsos + ;; + news1000) + basic_machine=m68030-sony +- os=-newsos +- ;; +- news-3600 | risc-news) +- basic_machine=mips-sony +- os=-newsos ++ os=newsos + ;; + necv70) + basic_machine=v70-nec +- os=-sysv +- ;; +- next | m*-next ) +- basic_machine=m68k-next +- case $os in +- -nextstep* ) +- ;; +- -ns2*) +- os=-nextstep2 +- ;; +- *) +- os=-nextstep3 +- ;; +- esac ++ os=sysv + ;; + nh3000) + basic_machine=m68k-harris +- os=-cxux ++ os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris +- os=-cxux ++ os=cxux + ;; + nindy960) + basic_machine=i960-intel +- os=-nindy ++ os=nindy + ;; + mon960) + basic_machine=i960-intel +- os=-mon960 ++ os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq +- os=-nonstopux +- ;; +- np1) +- basic_machine=np1-gould +- ;; +- neo-tandem) +- basic_machine=neo-tandem +- ;; +- nse-tandem) +- basic_machine=nse-tandem +- ;; +- nsr-tandem) +- basic_machine=nsr-tandem +- ;; +- op50n-* | op60c-*) +- basic_machine=hppa1.1-oki +- os=-proelf +- ;; +- openrisc | openrisc-*) +- basic_machine=or32-unknown ++ os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm +- os=-os400 ++ os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson +- os=-ose ++ os=ose + ;; + os68k) + basic_machine=m68k-none +- os=-os68k +- ;; +- pa-hitachi) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 ++ os=os68k + ;; + paragon) + basic_machine=i860-intel +- os=-osf ++ os=osf + ;; + parisc) + basic_machine=hppa-unknown +- os=-linux +- ;; +- parisc-*) +- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- pbd) +- basic_machine=sparc-tti +- ;; +- pbb) +- basic_machine=m68k-tti +- ;; +- pc532 | pc532-*) +- basic_machine=ns32k-pc532 +- ;; +- pc98) +- basic_machine=i386-pc +- ;; +- pc98-*) +- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentium | p5 | k5 | k6 | nexgen | viac3) +- basic_machine=i586-pc +- ;; +- pentiumpro | p6 | 6x86 | athlon | athlon_*) +- basic_machine=i686-pc +- ;; +- pentiumii | pentium2 | pentiumiii | pentium3) +- basic_machine=i686-pc +- ;; +- pentium4) +- basic_machine=i786-pc +- ;; +- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) +- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentiumpro-* | p6-* | 6x86-* | athlon-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentium4-*) +- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pn) +- basic_machine=pn-gould +- ;; +- power) basic_machine=power-ibm +- ;; +- ppc | ppcbe) basic_machine=powerpc-unknown +- ;; +- ppc-* | ppcbe-*) +- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppcle | powerpclittle | ppc-le | powerpc-little) +- basic_machine=powerpcle-unknown +- ;; +- ppcle-* | powerpclittle-*) +- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppc64) basic_machine=powerpc64-unknown +- ;; +- ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppc64le | powerpc64little | ppc64-le | powerpc64-little) +- basic_machine=powerpc64le-unknown +- ;; +- ppc64le-* | powerpc64little-*) +- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ps2) +- basic_machine=i386-ibm ++ os=linux + ;; + pw32) + basic_machine=i586-unknown +- os=-pw32 ++ os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc +- os=-rdos ++ os=rdos + ;; + rdos32) + basic_machine=i386-pc +- os=-rdos ++ os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k +- os=-coff +- ;; +- rm[46]00) +- basic_machine=mips-siemens +- ;; +- rtpc | rtpc-*) +- basic_machine=romp-ibm +- ;; +- s390 | s390-*) +- basic_machine=s390-ibm +- ;; +- s390x | s390x-*) +- basic_machine=s390x-ibm ++ os=coff + ;; + sa29200) + basic_machine=a29k-amd +- os=-udi +- ;; +- sb1) +- basic_machine=mipsisa64sb1-unknown +- ;; +- sb1el) +- basic_machine=mipsisa64sb1el-unknown +- ;; +- sde) +- basic_machine=mipsisa32-sde +- os=-elf ++ os=udi + ;; + sei) + basic_machine=mips-sei +- os=-seiux ++ os=seiux + ;; + sequent) + basic_machine=i386-sequent +- ;; +- sh) +- basic_machine=sh-hitachi +- os=-hms +- ;; +- sh5el) +- basic_machine=sh5le-unknown +- ;; +- sh64) +- basic_machine=sh64-unknown +- ;; +- sparclite-wrs | simso-wrs) +- basic_machine=sparclite-wrs +- os=-vxworks ++ os= + ;; + sps7) + basic_machine=m68k-bull +- os=-sysv2 +- ;; +- spur) +- basic_machine=spur-unknown ++ os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem ++ os= + ;; + stratus) + basic_machine=i860-stratus +- os=-sysv4 +- ;; +- strongarm-* | thumb-*) +- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=sysv4 + ;; + sun2) + basic_machine=m68000-sun ++ os= + ;; + sun2os3) + basic_machine=m68000-sun +- os=-sunos3 ++ os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun +- os=-sunos4 ++ os=sunos4 ++ ;; ++ sun3) ++ basic_machine=m68k-sun ++ os= + ;; + sun3os3) + basic_machine=m68k-sun +- os=-sunos3 ++ os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun +- os=-sunos4 ++ os=sunos4 ++ ;; ++ sun4) ++ basic_machine=sparc-sun ++ os= + ;; + sun4os3) + basic_machine=sparc-sun +- os=-sunos3 ++ os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun +- os=-sunos4 ++ os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun +- os=-solaris2 +- ;; +- sun3 | sun3-*) +- basic_machine=m68k-sun +- ;; +- sun4) +- basic_machine=sparc-sun ++ os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun ++ os= + ;; + sv1) + basic_machine=sv1-cray +- os=-unicos ++ os=unicos + ;; + symmetry) + basic_machine=i386-sequent +- os=-dynix ++ os=dynix + ;; + t3e) + basic_machine=alphaev5-cray +- os=-unicos ++ os=unicos + ;; + t90) + basic_machine=t90-cray +- os=-unicos +- ;; +- tile*) +- basic_machine=$basic_machine-unknown +- os=-linux-gnu +- ;; +- tx39) +- basic_machine=mipstx39-unknown +- ;; +- tx39el) +- basic_machine=mipstx39el-unknown ++ os=unicos + ;; + toad1) + basic_machine=pdp10-xkl +- os=-tops20 +- ;; +- tower | tower-32) +- basic_machine=m68k-ncr ++ os=tops20 + ;; + tpf) + basic_machine=s390x-ibm +- os=-tpf ++ os=tpf + ;; + udi29k) + basic_machine=a29k-amd +- os=-udi ++ os=udi + ;; + ultra3) + basic_machine=a29k-nyu +- os=-sym1 ++ os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec +- os=-none ++ os=none + ;; + vaxv) + basic_machine=vax-dec +- os=-sysv ++ os=sysv + ;; + vms) + basic_machine=vax-dec +- os=-vms ++ os=vms + ;; +- vpp*|vx|vx-*) +- basic_machine=f301-fujitsu ++ vsta) ++ basic_machine=i386-pc ++ os=vsta + ;; + vxworks960) + basic_machine=i960-wrs +- os=-vxworks ++ os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs +- os=-vxworks ++ os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs +- os=-vxworks +- ;; +- w65*) +- basic_machine=w65-wdc +- os=-none +- ;; +- w89k-*) +- basic_machine=hppa1.1-winbond +- os=-proelf ++ os=vxworks + ;; + xbox) + basic_machine=i686-pc +- os=-mingw32 +- ;; +- xps | xps100) +- basic_machine=xps100-honeywell +- ;; +- xscale-* | xscalee[bl]-*) +- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ++ os=mingw32 + ;; + ymp) + basic_machine=ymp-cray +- os=-unicos ++ os=unicos + ;; +- z8k-*-coff) +- basic_machine=z8k-unknown +- os=-sim +- ;; +- z80-*-coff) +- basic_machine=z80-unknown +- os=-sim ++ *) ++ basic_machine=$1 ++ os= + ;; +- none) +- basic_machine=none-none +- os=-none ++ esac + ;; ++esac + ++# Decode 1-component or ad-hoc basic machines ++case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) +- basic_machine=hppa1.1-winbond ++ cpu=hppa1.1 ++ vendor=winbond + ;; + op50n) +- basic_machine=hppa1.1-oki ++ cpu=hppa1.1 ++ vendor=oki + ;; + op60c) +- basic_machine=hppa1.1-oki ++ cpu=hppa1.1 ++ vendor=oki + ;; +- romp) +- basic_machine=romp-ibm ++ ibm*) ++ cpu=i370 ++ vendor=ibm + ;; +- mmix) +- basic_machine=mmix-knuth ++ orion105) ++ cpu=clipper ++ vendor=highlevel + ;; +- rs6000) +- basic_machine=rs6000-ibm ++ mac | mpw | mac-mpw) ++ cpu=m68k ++ vendor=apple + ;; +- vax) +- basic_machine=vax-dec ++ pmac | pmac-mpw) ++ cpu=powerpc ++ vendor=apple + ;; +- pdp10) +- # there are many clones, so DEC is not a safe bet +- basic_machine=pdp10-unknown ++ ++ # Recognize the various machine names and aliases which stand ++ # for a CPU type and a company and sometimes even an OS. ++ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) ++ cpu=m68000 ++ vendor=att + ;; +- pdp11) +- basic_machine=pdp11-dec ++ 3b*) ++ cpu=we32k ++ vendor=att + ;; +- we32k) +- basic_machine=we32k-att ++ bluegene*) ++ cpu=powerpc ++ vendor=ibm ++ os=cnk + ;; +- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) +- basic_machine=sh-unknown ++ decsystem10* | dec10*) ++ cpu=pdp10 ++ vendor=dec ++ os=tops10 + ;; +- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) +- basic_machine=sparc-sun ++ decsystem20* | dec20*) ++ cpu=pdp10 ++ vendor=dec ++ os=tops20 + ;; +- cydra) +- basic_machine=cydra-cydrome ++ delta | 3300 | motorola-3300 | motorola-delta \ ++ | 3300-motorola | delta-motorola) ++ cpu=m68k ++ vendor=motorola + ;; +- orion) +- basic_machine=orion-highlevel ++ dpx2*) ++ cpu=m68k ++ vendor=bull ++ os=sysv3 + ;; +- orion105) +- basic_machine=clipper-highlevel ++ encore | umax | mmax) ++ cpu=ns32k ++ vendor=encore + ;; +- mac | mpw | mac-mpw) +- basic_machine=m68k-apple ++ elxsi) ++ cpu=elxsi ++ vendor=elxsi ++ os=${os:-bsd} + ;; +- pmac | pmac-mpw) +- basic_machine=powerpc-apple ++ fx2800) ++ cpu=i860 ++ vendor=alliant ++ ;; ++ genix) ++ cpu=ns32k ++ vendor=ns ++ ;; ++ h3050r* | hiux*) ++ cpu=hppa1.1 ++ vendor=hitachi ++ os=hiuxwe2 ++ ;; ++ hp3k9[0-9][0-9] | hp9[0-9][0-9]) ++ cpu=hppa1.0 ++ vendor=hp ++ ;; ++ hp9k2[0-9][0-9] | hp9k31[0-9]) ++ cpu=m68000 ++ vendor=hp ++ ;; ++ hp9k3[2-9][0-9]) ++ cpu=m68k ++ vendor=hp ++ ;; ++ hp9k6[0-9][0-9] | hp6[0-9][0-9]) ++ cpu=hppa1.0 ++ vendor=hp ++ ;; ++ hp9k7[0-79][0-9] | hp7[0-79][0-9]) ++ cpu=hppa1.1 ++ vendor=hp ++ ;; ++ hp9k78[0-9] | hp78[0-9]) ++ # FIXME: really hppa2.0-hp ++ cpu=hppa1.1 ++ vendor=hp ++ ;; ++ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) ++ # FIXME: really hppa2.0-hp ++ cpu=hppa1.1 ++ vendor=hp ++ ;; ++ hp9k8[0-9][13679] | hp8[0-9][13679]) ++ cpu=hppa1.1 ++ vendor=hp ++ ;; ++ hp9k8[0-9][0-9] | hp8[0-9][0-9]) ++ cpu=hppa1.0 ++ vendor=hp ++ ;; ++ i*86v32) ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ os=sysv32 ++ ;; ++ i*86v4*) ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ os=sysv4 ++ ;; ++ i*86v) ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ os=sysv ++ ;; ++ i*86sol2) ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ os=solaris2 ++ ;; ++ j90 | j90-cray) ++ cpu=j90 ++ vendor=cray ++ os=${os:-unicos} ++ ;; ++ iris | iris4d) ++ cpu=mips ++ vendor=sgi ++ case $os in ++ irix*) ++ ;; ++ *) ++ os=irix4 ++ ;; ++ esac ++ ;; ++ miniframe) ++ cpu=m68000 ++ vendor=convergent ++ ;; ++ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) ++ cpu=m68k ++ vendor=atari ++ os=mint ++ ;; ++ news-3600 | risc-news) ++ cpu=mips ++ vendor=sony ++ os=newsos ++ ;; ++ next | m*-next) ++ cpu=m68k ++ vendor=next ++ case $os in ++ openstep*) ++ ;; ++ nextstep*) ++ ;; ++ ns2*) ++ os=nextstep2 ++ ;; ++ *) ++ os=nextstep3 ++ ;; ++ esac ++ ;; ++ np1) ++ cpu=np1 ++ vendor=gould ++ ;; ++ op50n-* | op60c-*) ++ cpu=hppa1.1 ++ vendor=oki ++ os=proelf ++ ;; ++ pa-hitachi) ++ cpu=hppa1.1 ++ vendor=hitachi ++ os=hiuxwe2 ++ ;; ++ pbd) ++ cpu=sparc ++ vendor=tti ++ ;; ++ pbb) ++ cpu=m68k ++ vendor=tti ++ ;; ++ pc532) ++ cpu=ns32k ++ vendor=pc532 ++ ;; ++ pn) ++ cpu=pn ++ vendor=gould ++ ;; ++ power) ++ cpu=power ++ vendor=ibm ++ ;; ++ ps2) ++ cpu=i386 ++ vendor=ibm ++ ;; ++ rm[46]00) ++ cpu=mips ++ vendor=siemens ++ ;; ++ rtpc | rtpc-*) ++ cpu=romp ++ vendor=ibm ++ ;; ++ sde) ++ cpu=mipsisa32 ++ vendor=sde ++ os=${os:-elf} ++ ;; ++ simso-wrs) ++ cpu=sparclite ++ vendor=wrs ++ os=vxworks ++ ;; ++ tower | tower-32) ++ cpu=m68k ++ vendor=ncr ++ ;; ++ vpp*|vx|vx-*) ++ cpu=f301 ++ vendor=fujitsu ++ ;; ++ w65) ++ cpu=w65 ++ vendor=wdc ++ ;; ++ w89k-*) ++ cpu=hppa1.1 ++ vendor=winbond ++ os=proelf ++ ;; ++ none) ++ cpu=none ++ vendor=none ++ ;; ++ leon|leon[3-9]) ++ cpu=sparc ++ vendor=$basic_machine ++ ;; ++ leon-*|leon[3-9]-*) ++ cpu=sparc ++ vendor=`echo "$basic_machine" | sed 's/-.*//'` ++ ;; ++ ++ *-*) ++ # shellcheck disable=SC2162 ++ IFS="-" read cpu vendor <&2 ++ # Recognize the canonical CPU types that are allowed with any ++ # company name. ++ case $cpu in ++ 1750a | 580 \ ++ | a29k \ ++ | aarch64 | aarch64_be \ ++ | abacus \ ++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ ++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ ++ | alphapca5[67] | alpha64pca5[67] \ ++ | am33_2.0 \ ++ | amdgcn \ ++ | arc | arceb \ ++ | arm | arm[lb]e | arme[lb] | armv* \ ++ | avr | avr32 \ ++ | asmjs \ ++ | ba \ ++ | be32 | be64 \ ++ | bfin | bpf | bs2000 \ ++ | c[123]* | c30 | [cjt]90 | c4x \ ++ | c8051 | clipper | craynv | csky | cydra \ ++ | d10v | d30v | dlx | dsp16xx \ ++ | e2k | elxsi | epiphany \ ++ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ ++ | h8300 | h8500 \ ++ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ ++ | hexagon \ ++ | i370 | i*86 | i860 | i960 | ia16 | ia64 \ ++ | ip2k | iq2000 \ ++ | k1om \ ++ | le32 | le64 \ ++ | lm32 \ ++ | m32c | m32r | m32rle \ ++ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ ++ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ ++ | m88110 | m88k | maxq | mb | mcore | mep | metag \ ++ | microblaze | microblazeel \ ++ | mips | mipsbe | mipseb | mipsel | mipsle \ ++ | mips16 \ ++ | mips64 | mips64eb | mips64el \ ++ | mips64octeon | mips64octeonel \ ++ | mips64orion | mips64orionel \ ++ | mips64r5900 | mips64r5900el \ ++ | mips64vr | mips64vrel \ ++ | mips64vr4100 | mips64vr4100el \ ++ | mips64vr4300 | mips64vr4300el \ ++ | mips64vr5000 | mips64vr5000el \ ++ | mips64vr5900 | mips64vr5900el \ ++ | mipsisa32 | mipsisa32el \ ++ | mipsisa32r2 | mipsisa32r2el \ ++ | mipsisa32r6 | mipsisa32r6el \ ++ | mipsisa64 | mipsisa64el \ ++ | mipsisa64r2 | mipsisa64r2el \ ++ | mipsisa64r6 | mipsisa64r6el \ ++ | mipsisa64sb1 | mipsisa64sb1el \ ++ | mipsisa64sr71k | mipsisa64sr71kel \ ++ | mipsr5900 | mipsr5900el \ ++ | mipstx39 | mipstx39el \ ++ | mmix \ ++ | mn10200 | mn10300 \ ++ | moxie \ ++ | mt \ ++ | msp430 \ ++ | nds32 | nds32le | nds32be \ ++ | nfp \ ++ | nios | nios2 | nios2eb | nios2el \ ++ | none | np1 | ns16k | ns32k | nvptx \ ++ | open8 \ ++ | or1k* \ ++ | or32 \ ++ | orion \ ++ | picochip \ ++ | pdp10 | pdp11 | pj | pjl | pn | power \ ++ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ ++ | pru \ ++ | pyramid \ ++ | riscv | riscv32 | riscv64 \ ++ | rl78 | romp | rs6000 | rx \ ++ | score \ ++ | sh | shl \ ++ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ ++ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ ++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ ++ | sparclite \ ++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ ++ | spu \ ++ | tahoe \ ++ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ ++ | tron \ ++ | ubicom32 \ ++ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ ++ | vax \ ++ | visium \ ++ | w65 \ ++ | wasm32 | wasm64 \ ++ | we32k \ ++ | x86 | x86_64 | xc16x | xgate | xps100 \ ++ | xstormy16 | xtensa* \ ++ | ymp \ ++ | z8k | z80) ++ ;; ++ ++ *) ++ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ++ ;; ++esac + + # Here we canonicalize certain aliases for manufacturers. +-case $basic_machine in +- *-digital*) +- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ++case $vendor in ++ digital*) ++ vendor=dec + ;; +- *-commodore*) +- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ++ commodore*) ++ vendor=cbm + ;; + *) + ;; +@@ -1321,197 +1275,244 @@ + + # Decode manufacturer-specific aliases for certain operating systems. + +-if [ x"$os" != x"" ] ++if [ x$os != x ] + then + case $os in +- # First match some system type aliases +- # that might get confused with valid system types. +- # -solaris* is a basic system type, with this one exception. +- -auroraux) +- os=-auroraux ++ # First match some system type aliases that might get confused ++ # with valid system types. ++ # solaris* is a basic system type, with this one exception. ++ auroraux) ++ os=auroraux + ;; +- -solaris1 | -solaris1.*) +- os=`echo $os | sed -e 's|solaris1|sunos4|'` ++ bluegene*) ++ os=cnk + ;; +- -solaris) +- os=-solaris2 ++ solaris1 | solaris1.*) ++ os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; +- -svr4*) +- os=-sysv4 ++ solaris) ++ os=solaris2 + ;; +- -unixware*) +- os=-sysv4.2uw ++ unixware*) ++ os=sysv4.2uw + ;; +- -gnu/linux*) ++ gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; +- # First accept the basic system types. ++ # es1800 is here to avoid being matched by es* (a different OS) ++ es1800*) ++ os=ose ++ ;; ++ # Some version numbers need modification ++ chorusos*) ++ os=chorusos ++ ;; ++ isc) ++ os=isc2.2 ++ ;; ++ sco6) ++ os=sco5v6 ++ ;; ++ sco5) ++ os=sco3.2v5 ++ ;; ++ sco4) ++ os=sco3.2v4 ++ ;; ++ sco3.2.[4-9]*) ++ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ++ ;; ++ sco3.2v[4-9]* | sco5v6*) ++ # Don't forget version if it is 3.2v4 or newer. ++ ;; ++ scout) ++ # Don't match below ++ ;; ++ sco*) ++ os=sco3.2v2 ++ ;; ++ psos*) ++ os=psos ++ ;; ++ # Now accept the basic system types. + # The portable systems comes first. +- # Each alternative MUST END IN A *, to match a version number. +- # -sysv* is not here because it comes later, after sysvr4. +- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ +- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ +- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ +- | -sym* | -kopensolaris* | -plan9* \ +- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ +- | -aos* | -aros* \ +- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ +- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ +- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ +- | -bitrig* | -openbsd* | -solidbsd* \ +- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ +- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ +- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ +- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ +- | -chorusos* | -chorusrdb* | -cegcc* \ +- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ +- | -linux-newlib* | -linux-musl* | -linux-uclibc* \ +- | -uxpv* | -beos* | -mpeix* | -udk* \ +- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ +- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ +- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ +- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ +- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ +- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ +- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) ++ # Each alternative MUST end in a * to match a version number. ++ # sysv* is not here because it comes later, after sysvr4. ++ gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ ++ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ ++ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ ++ | sym* | kopensolaris* | plan9* \ ++ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ ++ | aos* | aros* | cloudabi* | sortix* | twizzler* \ ++ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ ++ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ ++ | knetbsd* | mirbsd* | netbsd* \ ++ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ ++ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ ++ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ ++ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ ++ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ ++ | chorusrdb* | cegcc* | glidix* \ ++ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ ++ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ ++ | linux-newlib* | linux-musl* | linux-uclibc* \ ++ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ ++ | interix* | uwin* | mks* | rhapsody* | darwin* \ ++ | openstep* | oskit* | conix* | pw32* | nonstopux* \ ++ | storm-chaos* | tops10* | tenex* | tops20* | its* \ ++ | os2* | vos* | palmos* | uclinux* | nucleus* \ ++ | morphos* | superux* | rtmk* | windiss* \ ++ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ ++ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ ++ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ ++ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ ++ | nsk* | powerunix* | genode*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; +- -qnx*) +- case $basic_machine in +- x86-* | i*86-*) ++ qnx*) ++ case $cpu in ++ x86 | i*86) + ;; + *) +- os=-nto$os ++ os=nto-$os + ;; + esac + ;; +- -nto-qnx*) ++ hiux*) ++ os=hiuxwe2 + ;; +- -nto*) +- os=`echo $os | sed -e 's|nto|nto-qnx|'` ++ nto-qnx*) + ;; +- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ +- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ +- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ++ nto*) ++ os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; +- -mac*) +- os=`echo $os | sed -e 's|mac|macos|'` ++ sim | xray | os68k* | v88r* \ ++ | windows* | osx | abug | netware* | os9* \ ++ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) + ;; +- -linux-dietlibc) +- os=-linux-dietlibc ++ linux-dietlibc) ++ os=linux-dietlibc + ;; +- -linux*) ++ linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; +- -sunos5*) +- os=`echo $os | sed -e 's|sunos5|solaris2|'` ++ lynx*178) ++ os=lynxos178 ++ ;; ++ lynx*5) ++ os=lynxos5 + ;; +- -sunos6*) +- os=`echo $os | sed -e 's|sunos6|solaris3|'` ++ lynx*) ++ os=lynxos + ;; +- -opened*) +- os=-openedition ++ mac*) ++ os=`echo "$os" | sed -e 's|mac|macos|'` + ;; +- -os400*) +- os=-os400 ++ opened*) ++ os=openedition + ;; +- -wince*) +- os=-wince ++ os400*) ++ os=os400 + ;; +- -osfrose*) +- os=-osfrose ++ sunos5*) ++ os=`echo "$os" | sed -e 's|sunos5|solaris2|'` + ;; +- -osf*) +- os=-osf ++ sunos6*) ++ os=`echo "$os" | sed -e 's|sunos6|solaris3|'` + ;; +- -utek*) +- os=-bsd ++ wince*) ++ os=wince + ;; +- -dynix*) +- os=-bsd ++ utek*) ++ os=bsd + ;; +- -acis*) +- os=-aos ++ dynix*) ++ os=bsd + ;; +- -atheos*) +- os=-atheos ++ acis*) ++ os=aos + ;; +- -syllable*) +- os=-syllable ++ atheos*) ++ os=atheos + ;; +- -386bsd) +- os=-bsd ++ syllable*) ++ os=syllable + ;; +- -ctix* | -uts*) +- os=-sysv ++ 386bsd) ++ os=bsd + ;; +- -nova*) +- os=-rtmk-nova ++ ctix* | uts*) ++ os=sysv + ;; +- -ns2 ) +- os=-nextstep2 ++ nova*) ++ os=rtmk-nova + ;; +- -nsk*) +- os=-nsk ++ ns2) ++ os=nextstep2 + ;; + # Preserve the version number of sinix5. +- -sinix5.*) ++ sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; +- -sinix*) +- os=-sysv4 ++ sinix*) ++ os=sysv4 ++ ;; ++ tpf*) ++ os=tpf ++ ;; ++ triton*) ++ os=sysv3 + ;; +- -tpf*) +- os=-tpf ++ oss*) ++ os=sysv3 + ;; +- -triton*) +- os=-sysv3 ++ svr4*) ++ os=sysv4 + ;; +- -oss*) +- os=-sysv3 ++ svr3) ++ os=sysv3 + ;; +- -svr4) +- os=-sysv4 ++ sysvr4) ++ os=sysv4 + ;; +- -svr3) +- os=-sysv3 ++ # This must come after sysvr4. ++ sysv*) + ;; +- -sysvr4) +- os=-sysv4 ++ ose*) ++ os=ose + ;; +- # This must come after -sysvr4. +- -sysv*) ++ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) ++ os=mint + ;; +- -ose*) +- os=-ose ++ zvmoe) ++ os=zvmoe + ;; +- -es1800*) +- os=-ose ++ dicos*) ++ os=dicos + ;; +- -xenix) +- os=-xenix ++ pikeos*) ++ # Until real need of OS specific support for ++ # particular features comes up, bare metal ++ # configurations are quite functional. ++ case $cpu in ++ arm*) ++ os=eabi + ;; +- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) +- os=-mint ++ *) ++ os=elf + ;; +- -aros*) +- os=-aros ++ esac + ;; +- -zvmoe) +- os=-zvmoe ++ nacl*) + ;; +- -dicos*) +- os=-dicos ++ ios) + ;; +- -nacl*) ++ none) + ;; +- -none) ++ *-eabi) + ;; + *) +- # Get rid of the `-' at the beginning of $os. +- os=`echo $os | sed 's/[^-]*-//'` +- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 ++ echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 + exit 1 + ;; + esac +@@ -1527,261 +1528,265 @@ + # will signal an error saying that MANUFACTURER isn't an operating + # system, and we'll never get to this point. + +-case $basic_machine in ++case $cpu-$vendor in + score-*) +- os=-elf ++ os=elf + ;; + spu-*) +- os=-elf ++ os=elf + ;; + *-acorn) +- os=-riscix1.2 ++ os=riscix1.2 + ;; + arm*-rebel) +- os=-linux ++ os=linux + ;; + arm*-semi) +- os=-aout ++ os=aout + ;; + c4x-* | tic4x-*) +- os=-coff ++ os=coff ++ ;; ++ c8051-*) ++ os=elf ++ ;; ++ clipper-intergraph) ++ os=clix + ;; + hexagon-*) +- os=-elf ++ os=elf + ;; + tic54x-*) +- os=-coff ++ os=coff + ;; + tic55x-*) +- os=-coff ++ os=coff + ;; + tic6x-*) +- os=-coff ++ os=coff + ;; + # This must come before the *-dec entry. + pdp10-*) +- os=-tops20 ++ os=tops20 + ;; + pdp11-*) +- os=-none ++ os=none + ;; + *-dec | vax-*) +- os=-ultrix4.2 ++ os=ultrix4.2 + ;; + m68*-apollo) +- os=-domain ++ os=domain + ;; + i386-sun) +- os=-sunos4.0.2 ++ os=sunos4.0.2 + ;; + m68000-sun) +- os=-sunos3 ++ os=sunos3 + ;; + m68*-cisco) +- os=-aout ++ os=aout + ;; + mep-*) +- os=-elf ++ os=elf + ;; + mips*-cisco) +- os=-elf ++ os=elf + ;; + mips*-*) +- os=-elf +- ;; +- or1k-*) +- os=-elf ++ os=elf + ;; + or32-*) +- os=-coff ++ os=coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. +- os=-sysv3 ++ os=sysv3 + ;; + sparc-* | *-sun) +- os=-sunos4.1.1 ++ os=sunos4.1.1 + ;; +- *-be) +- os=-beos ++ pru-*) ++ os=elf + ;; +- *-haiku) +- os=-haiku ++ *-be) ++ os=beos + ;; + *-ibm) +- os=-aix ++ os=aix + ;; + *-knuth) +- os=-mmixware ++ os=mmixware + ;; + *-wec) +- os=-proelf ++ os=proelf + ;; + *-winbond) +- os=-proelf ++ os=proelf + ;; + *-oki) +- os=-proelf ++ os=proelf + ;; + *-hp) +- os=-hpux ++ os=hpux + ;; + *-hitachi) +- os=-hiux ++ os=hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) +- os=-sysv ++ os=sysv + ;; + *-cbm) +- os=-amigaos ++ os=amigaos + ;; + *-dg) +- os=-dgux ++ os=dgux + ;; + *-dolphin) +- os=-sysv3 ++ os=sysv3 + ;; + m68k-ccur) +- os=-rtu ++ os=rtu + ;; + m88k-omron*) +- os=-luna ++ os=luna + ;; + *-next ) +- os=-nextstep ++ os=nextstep + ;; + *-sequent) +- os=-ptx ++ os=ptx + ;; + *-crds) +- os=-unos ++ os=unos + ;; + *-ns) +- os=-genix ++ os=genix + ;; + i370-*) +- os=-mvs +- ;; +- *-next) +- os=-nextstep3 ++ os=mvs + ;; + *-gould) +- os=-sysv ++ os=sysv + ;; + *-highlevel) +- os=-bsd ++ os=bsd + ;; + *-encore) +- os=-bsd ++ os=bsd + ;; + *-sgi) +- os=-irix ++ os=irix + ;; + *-siemens) +- os=-sysv4 ++ os=sysv4 + ;; + *-masscomp) +- os=-rtu ++ os=rtu + ;; + f30[01]-fujitsu | f700-fujitsu) +- os=-uxpv ++ os=uxpv + ;; + *-rom68k) +- os=-coff ++ os=coff + ;; + *-*bug) +- os=-coff ++ os=coff + ;; + *-apple) +- os=-macos ++ os=macos + ;; + *-atari*) +- os=-mint ++ os=mint ++ ;; ++ *-wrs) ++ os=vxworks + ;; + *) +- os=-none ++ os=none + ;; + esac + fi + + # Here we handle the case where we know the os, and the CPU type, but not the + # manufacturer. We pick the logical manufacturer. +-vendor=unknown +-case $basic_machine in +- *-unknown) ++case $vendor in ++ unknown) + case $os in +- -riscix*) ++ riscix*) + vendor=acorn + ;; +- -sunos*) ++ sunos*) + vendor=sun + ;; +- -cnk*|-aix*) ++ cnk*|-aix*) + vendor=ibm + ;; +- -beos*) ++ beos*) + vendor=be + ;; +- -hpux*) ++ hpux*) + vendor=hp + ;; +- -mpeix*) ++ mpeix*) + vendor=hp + ;; +- -hiux*) ++ hiux*) + vendor=hitachi + ;; +- -unos*) ++ unos*) + vendor=crds + ;; +- -dgux*) ++ dgux*) + vendor=dg + ;; +- -luna*) ++ luna*) + vendor=omron + ;; +- -genix*) ++ genix*) + vendor=ns + ;; +- -mvs* | -opened*) ++ clix*) ++ vendor=intergraph ++ ;; ++ mvs* | opened*) + vendor=ibm + ;; +- -os400*) ++ os400*) + vendor=ibm + ;; +- -ptx*) ++ ptx*) + vendor=sequent + ;; +- -tpf*) ++ tpf*) + vendor=ibm + ;; +- -vxsim* | -vxworks* | -windiss*) ++ vxsim* | vxworks* | windiss*) + vendor=wrs + ;; +- -aux*) ++ aux*) + vendor=apple + ;; +- -hms*) ++ hms*) + vendor=hitachi + ;; +- -mpw* | -macos*) ++ mpw* | macos*) + vendor=apple + ;; +- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) ++ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + vendor=atari + ;; +- -vos*) ++ vos*) + vendor=stratus + ;; + esac +- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; + esac + +-echo $basic_machine$os ++echo "$cpu-$vendor-$os" + exit + + # Local variables: +-# eval: (add-hook 'write-file-hooks 'time-stamp) ++# eval: (add-hook 'before-save-hook 'time-stamp) + # time-stamp-start: "timestamp='" + # time-stamp-format: "%:y-%02m-%02d" + # time-stamp-end: "'" diff --git a/recipes/libogg/recipe.toml b/recipes/libogg/recipe.toml new file mode 100644 index 000000000..593947f58 --- /dev/null +++ b/recipes/libogg/recipe.toml @@ -0,0 +1,9 @@ +[source] +tar = "http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.xz" +blake3 = "8220c0e4082fa26c07b10bfe31f641d2e33ebe1d1bb0b20221b7016bc8b78a3a" +patches = [ + "redox.patch" +] + +[build] +template = "configure" diff --git a/recipes/libogg/redox.patch b/recipes/libogg/redox.patch new file mode 100644 index 000000000..c07ab514d --- /dev/null +++ b/recipes/libogg/redox.patch @@ -0,0 +1,2833 @@ +--- source/config.sub 2017-11-07 13:38:55.000000000 -0700 ++++ source-new/config.sub 2020-05-20 15:34:35.000000000 -0600 +@@ -1,8 +1,8 @@ + #! /bin/sh + # Configuration validation subroutine script. +-# Copyright 1992-2016 Free Software Foundation, Inc. ++# Copyright 1992-2020 Free Software Foundation, Inc. + +-timestamp='2016-09-05' ++timestamp='2020-05-04' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +@@ -15,7 +15,7 @@ + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, see . ++# along with this program; if not, see . + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a +@@ -33,7 +33,7 @@ + # Otherwise, we print the canonical config type on stdout and succeed. + + # You can get the latest version of this script from: +-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub ++# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases +@@ -57,7 +57,7 @@ + + Canonicalize a configuration name. + +-Operation modes: ++Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit +@@ -67,7 +67,7 @@ + version="\ + GNU config.sub ($timestamp) + +-Copyright 1992-2016 Free Software Foundation, Inc. ++Copyright 1992-2020 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -89,12 +89,12 @@ + - ) # Use stdin as input. + break ;; + -* ) +- echo "$me: invalid option $1$help" ++ echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. +- echo $1 ++ echo "$1" + exit ;; + + * ) +@@ -110,1242 +110,1164 @@ + exit 1;; + esac + +-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +-# Here we must recognize all the valid KERNEL-OS combinations. +-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` ++# Split fields of configuration type ++# shellcheck disable=SC2162 ++IFS="-" read field1 field2 field3 field4 <&2 ++ exit 1 ++ ;; ++ *-*-*-*) ++ basic_machine=$field1-$field2 ++ os=$field3-$field4 ++ ;; ++ *-*-*) ++ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two ++ # parts ++ maybe_os=$field2-$field3 + case $maybe_os in +- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ +- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ +- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ +- kopensolaris*-gnu* | cloudabi*-eabi* | \ +- storm-chaos* | os2-emx* | rtmk-nova*) +- os=-$maybe_os +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ ++ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ ++ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ ++ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ ++ | storm-chaos* | os2-emx* | rtmk-nova*) ++ basic_machine=$field1 ++ os=$maybe_os + ;; + android-linux) +- os=-linux-android +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ++ basic_machine=$field1-unknown ++ os=linux-android + ;; + *) +- basic_machine=`echo $1 | sed 's/-[^-]*$//'` +- if [ $basic_machine != $1 ] +- then os=`echo $1 | sed 's/.*-/-/'` +- else os=; fi ++ basic_machine=$field1-$field2 ++ os=$field3 + ;; + esac +- +-### Let's recognize common machines as not being operating systems so +-### that things like config.sub decstation-3100 work. We also +-### recognize some manufacturers as not being operating systems, so we +-### can provide default operating systems below. +-case $os in +- -sun*os*) +- # Prevent following clause from handling this invalid input. + ;; +- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ +- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ +- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ +- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ +- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ +- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ +- -apple | -axis | -knuth | -cray | -microblaze*) ++ *-*) ++ # A lone config we happen to match not fitting any pattern ++ case $field1-$field2 in ++ decstation-3100) ++ basic_machine=mips-dec + os= +- basic_machine=$1 +- ;; +- -bluegene*) +- os=-cnk + ;; +- -sim | -cisco | -oki | -wec | -winbond) ++ *-*) ++ # Second component is usually, but not always the OS ++ case $field2 in ++ # Prevent following clause from handling this valid os ++ sun*os*) ++ basic_machine=$field1 ++ os=$field2 ++ ;; ++ # Manufacturers ++ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ ++ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ ++ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ ++ | convergent* | ncr* | news | 32* | 3600* | 3100* \ ++ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ ++ | ultra | tti* | harris | dolphin | highlevel | gould \ ++ | cbm | ns | masscomp | apple | axis | knuth | cray \ ++ | microblaze* | sim | cisco \ ++ | oki | wec | wrs | winbond) ++ basic_machine=$field1-$field2 + os= +- basic_machine=$1 +- ;; +- -scout) +- ;; +- -wrs) +- os=-vxworks +- basic_machine=$1 +- ;; +- -chorusos*) +- os=-chorusos +- basic_machine=$1 + ;; +- -chorusrdb) +- os=-chorusrdb +- basic_machine=$1 +- ;; +- -hiux*) +- os=-hiuxwe2 +- ;; +- -sco6) +- os=-sco5v6 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5) +- os=-sco3.2v5 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco4) +- os=-sco3.2v4 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco3.2.[4-9]*) +- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco3.2v[4-9]*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5v6*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco*) +- os=-sco3.2v2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -udk*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -isc) +- os=-isc2.2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -clix*) +- basic_machine=clipper-intergraph +- ;; +- -isc*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -lynx*178) +- os=-lynxos178 +- ;; +- -lynx*5) +- os=-lynxos5 +- ;; +- -lynx*) +- os=-lynxos +- ;; +- -ptx*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` +- ;; +- -windowsnt*) +- os=`echo $os | sed -e 's/windowsnt/winnt/'` +- ;; +- -psos*) +- os=-psos +- ;; +- -mint | -mint[0-9]*) +- basic_machine=m68k-atari +- os=-mint ++ *) ++ basic_machine=$field1 ++ os=$field2 + ;; + esac +- +-# Decode aliases for certain CPU-COMPANY combinations. +-case $basic_machine in +- # Recognize the basic CPU types without company name. +- # Some are omitted here because they have special meanings below. +- 1750a | 580 \ +- | a29k \ +- | aarch64 | aarch64_be \ +- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ +- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ +- | am33_2.0 \ +- | arc | arceb \ +- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ +- | avr | avr32 \ +- | ba \ +- | be32 | be64 \ +- | bfin \ +- | c4x | c8051 | clipper \ +- | d10v | d30v | dlx | dsp16xx \ +- | e2k | epiphany \ +- | fido | fr30 | frv | ft32 \ +- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ +- | hexagon \ +- | i370 | i860 | i960 | ia64 \ +- | ip2k | iq2000 \ +- | k1om \ +- | le32 | le64 \ +- | lm32 \ +- | m32c | m32r | m32rle | m68000 | m68k | m88k \ +- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ +- | mips | mipsbe | mipseb | mipsel | mipsle \ +- | mips16 \ +- | mips64 | mips64el \ +- | mips64octeon | mips64octeonel \ +- | mips64orion | mips64orionel \ +- | mips64r5900 | mips64r5900el \ +- | mips64vr | mips64vrel \ +- | mips64vr4100 | mips64vr4100el \ +- | mips64vr4300 | mips64vr4300el \ +- | mips64vr5000 | mips64vr5000el \ +- | mips64vr5900 | mips64vr5900el \ +- | mipsisa32 | mipsisa32el \ +- | mipsisa32r2 | mipsisa32r2el \ +- | mipsisa32r6 | mipsisa32r6el \ +- | mipsisa64 | mipsisa64el \ +- | mipsisa64r2 | mipsisa64r2el \ +- | mipsisa64r6 | mipsisa64r6el \ +- | mipsisa64sb1 | mipsisa64sb1el \ +- | mipsisa64sr71k | mipsisa64sr71kel \ +- | mipsr5900 | mipsr5900el \ +- | mipstx39 | mipstx39el \ +- | mn10200 | mn10300 \ +- | moxie \ +- | mt \ +- | msp430 \ +- | nds32 | nds32le | nds32be \ +- | nios | nios2 | nios2eb | nios2el \ +- | ns16k | ns32k \ +- | open8 | or1k | or1knd | or32 \ +- | pdp10 | pdp11 | pj | pjl \ +- | powerpc | powerpc64 | powerpc64le | powerpcle \ +- | pyramid \ +- | riscv32 | riscv64 \ +- | rl78 | rx \ +- | score \ +- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ +- | sh64 | sh64le \ +- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ +- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ +- | spu \ +- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ +- | ubicom32 \ +- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ +- | visium \ +- | we32k \ +- | x86 | xc16x | xstormy16 | xtensa \ +- | z8k | z80) +- basic_machine=$basic_machine-unknown +- ;; +- c54x) +- basic_machine=tic54x-unknown +- ;; +- c55x) +- basic_machine=tic55x-unknown +- ;; +- c6x) +- basic_machine=tic6x-unknown +- ;; +- leon|leon[3-9]) +- basic_machine=sparc-$basic_machine +- ;; +- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) +- basic_machine=$basic_machine-unknown +- os=-none +- ;; +- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; +- ms1) +- basic_machine=mt-unknown +- ;; +- +- strongarm | thumb | xscale) +- basic_machine=arm-unknown +- ;; +- xgate) +- basic_machine=$basic_machine-unknown +- os=-none +- ;; +- xscaleeb) +- basic_machine=armeb-unknown +- ;; +- +- xscaleel) +- basic_machine=armel-unknown +- ;; +- +- # We use `pc' rather than `unknown' +- # because (1) that's what they normally are, and +- # (2) the word "unknown" tends to confuse beginning users. +- i*86 | x86_64) +- basic_machine=$basic_machine-pc +- ;; +- # Object if more than one company name word. +- *-*-*) +- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 +- exit 1 +- ;; +- # Recognize the basic CPU types with company name. +- 580-* \ +- | a29k-* \ +- | aarch64-* | aarch64_be-* \ +- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ +- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ +- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ +- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* | avr32-* \ +- | ba-* \ +- | be32-* | be64-* \ +- | bfin-* | bs2000-* \ +- | c[123]* | c30-* | [cjt]90-* | c4x-* \ +- | c8051-* | clipper-* | craynv-* | cydra-* \ +- | d10v-* | d30v-* | dlx-* \ +- | e2k-* | elxsi-* \ +- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ +- | h8300-* | h8500-* \ +- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ +- | hexagon-* \ +- | i*86-* | i860-* | i960-* | ia64-* \ +- | ip2k-* | iq2000-* \ +- | k1om-* \ +- | le32-* | le64-* \ +- | lm32-* \ +- | m32c-* | m32r-* | m32rle-* \ +- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ +- | microblaze-* | microblazeel-* \ +- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ +- | mips16-* \ +- | mips64-* | mips64el-* \ +- | mips64octeon-* | mips64octeonel-* \ +- | mips64orion-* | mips64orionel-* \ +- | mips64r5900-* | mips64r5900el-* \ +- | mips64vr-* | mips64vrel-* \ +- | mips64vr4100-* | mips64vr4100el-* \ +- | mips64vr4300-* | mips64vr4300el-* \ +- | mips64vr5000-* | mips64vr5000el-* \ +- | mips64vr5900-* | mips64vr5900el-* \ +- | mipsisa32-* | mipsisa32el-* \ +- | mipsisa32r2-* | mipsisa32r2el-* \ +- | mipsisa32r6-* | mipsisa32r6el-* \ +- | mipsisa64-* | mipsisa64el-* \ +- | mipsisa64r2-* | mipsisa64r2el-* \ +- | mipsisa64r6-* | mipsisa64r6el-* \ +- | mipsisa64sb1-* | mipsisa64sb1el-* \ +- | mipsisa64sr71k-* | mipsisa64sr71kel-* \ +- | mipsr5900-* | mipsr5900el-* \ +- | mipstx39-* | mipstx39el-* \ +- | mmix-* \ +- | mt-* \ +- | msp430-* \ +- | nds32-* | nds32le-* | nds32be-* \ +- | nios-* | nios2-* | nios2eb-* | nios2el-* \ +- | none-* | np1-* | ns16k-* | ns32k-* \ +- | open8-* \ +- | or1k*-* \ +- | orion-* \ +- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ +- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ +- | pyramid-* \ +- | riscv32-* | riscv64-* \ +- | rl78-* | romp-* | rs6000-* | rx-* \ +- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ +- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ +- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ +- | sparclite-* \ +- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ +- | tahoe-* \ +- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ +- | tile*-* \ +- | tron-* \ +- | ubicom32-* \ +- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ +- | vax-* \ +- | visium-* \ +- | we32k-* \ +- | x86-* | x86_64-* | xc16x-* | xps100-* \ +- | xstormy16-* | xtensa*-* \ +- | ymp-* \ +- | z8k-* | z80-*) +- ;; +- # Recognize the basic CPU types without company name, with glob match. +- xtensa*) +- basic_machine=$basic_machine-unknown ++ esac + ;; +- # Recognize the various machine names and aliases which stand +- # for a CPU type and a company and sometimes even an OS. ++ *) ++ # Convert single-component short-hands not valid as part of ++ # multi-component configurations. ++ case $field1 in + 386bsd) +- basic_machine=i386-unknown +- os=-bsd +- ;; +- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) +- basic_machine=m68000-att +- ;; +- 3b*) +- basic_machine=we32k-att ++ basic_machine=i386-pc ++ os=bsd + ;; + a29khif) + basic_machine=a29k-amd +- os=-udi +- ;; +- abacus) +- basic_machine=abacus-unknown ++ os=udi + ;; + adobe68k) + basic_machine=m68010-adobe +- os=-scout ++ os=scout + ;; +- alliant | fx80) ++ alliant) + basic_machine=fx80-alliant ++ os= + ;; + altos | altos3068) + basic_machine=m68k-altos ++ os= + ;; + am29k) + basic_machine=a29k-none +- os=-bsd +- ;; +- amd64) +- basic_machine=x86_64-pc +- ;; +- amd64-*) +- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=bsd + ;; + amdahl) + basic_machine=580-amdahl +- os=-sysv ++ os=sysv + ;; +- amiga | amiga-*) ++ amiga) + basic_machine=m68k-unknown ++ os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown +- os=-amigaos ++ os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown +- os=-sysv4 ++ os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo +- os=-sysv ++ os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo +- os=-bsd ++ os=bsd + ;; + aros) + basic_machine=i386-pc +- os=-aros +- ;; +- asmjs) +- basic_machine=asmjs-unknown ++ os=aros + ;; + aux) + basic_machine=m68k-apple +- os=-aux ++ os=aux + ;; + balance) + basic_machine=ns32k-sequent +- os=-dynix ++ os=dynix + ;; + blackfin) + basic_machine=bfin-unknown +- os=-linux +- ;; +- blackfin-*) +- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- bluegene*) +- basic_machine=powerpc-ibm +- os=-cnk +- ;; +- c54x-*) +- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c55x-*) +- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c6x-*) +- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c90) +- basic_machine=c90-cray +- os=-unicos ++ os=linux + ;; + cegcc) + basic_machine=arm-unknown +- os=-cegcc ++ os=cegcc + ;; + convex-c1) + basic_machine=c1-convex +- os=-bsd ++ os=bsd + ;; + convex-c2) + basic_machine=c2-convex +- os=-bsd ++ os=bsd + ;; + convex-c32) + basic_machine=c32-convex +- os=-bsd ++ os=bsd + ;; + convex-c34) + basic_machine=c34-convex +- os=-bsd ++ os=bsd + ;; + convex-c38) + basic_machine=c38-convex +- os=-bsd ++ os=bsd + ;; +- cray | j90) ++ cray) + basic_machine=j90-cray +- os=-unicos +- ;; +- craynv) +- basic_machine=craynv-cray +- os=-unicosmp +- ;; +- cr16 | cr16-*) +- basic_machine=cr16-unknown +- os=-elf ++ os=unicos + ;; + crds | unos) + basic_machine=m68k-crds ++ os= + ;; +- crisv32 | crisv32-* | etraxfs*) +- basic_machine=crisv32-axis +- ;; +- cris | cris-* | etrax*) +- basic_machine=cris-axis +- ;; +- crx) +- basic_machine=crx-unknown +- os=-elf +- ;; +- da30 | da30-*) ++ da30) + basic_machine=m68k-da30 ++ os= + ;; +- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) ++ decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec +- ;; +- decsystem10* | dec10*) +- basic_machine=pdp10-dec +- os=-tops10 +- ;; +- decsystem20* | dec20*) +- basic_machine=pdp10-dec +- os=-tops20 +- ;; +- delta | 3300 | motorola-3300 | motorola-delta \ +- | 3300-motorola | delta-motorola) +- basic_machine=m68k-motorola ++ os= + ;; + delta88) + basic_machine=m88k-motorola +- os=-sysv3 ++ os=sysv3 + ;; + dicos) + basic_machine=i686-pc +- os=-dicos ++ os=dicos + ;; + djgpp) + basic_machine=i586-pc +- os=-msdosdjgpp +- ;; +- dpx20 | dpx20-*) +- basic_machine=rs6000-bull +- os=-bosx +- ;; +- dpx2* | dpx2*-bull) +- basic_machine=m68k-bull +- os=-sysv3 +- ;; +- e500v[12]) +- basic_machine=powerpc-unknown +- os=$os"spe" +- ;; +- e500v[12]-*) +- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=$os"spe" ++ os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd +- os=-ebmon +- ;; +- elxsi) +- basic_machine=elxsi-elxsi +- os=-bsd +- ;; +- encore | umax | mmax) +- basic_machine=ns32k-encore ++ os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson +- os=-ose +- ;; +- fx2800) +- basic_machine=i860-alliant +- ;; +- genix) +- basic_machine=ns32k-ns ++ os=ose + ;; + gmicro) + basic_machine=tron-gmicro +- os=-sysv ++ os=sysv + ;; + go32) + basic_machine=i386-pc +- os=-go32 +- ;; +- h3050r* | hiux*) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 ++ os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi +- os=-hms ++ os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi +- os=-xray ++ os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi +- os=-hms ++ os=hms + ;; + harris) + basic_machine=m88k-harris +- os=-sysv3 ++ os=sysv3 + ;; +- hp300-*) ++ hp300 | hp300hpux) + basic_machine=m68k-hp ++ os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp +- os=-bsd +- ;; +- hp300hpux) +- basic_machine=m68k-hp +- os=-hpux +- ;; +- hp3k9[0-9][0-9] | hp9[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hp9k2[0-9][0-9] | hp9k31[0-9]) +- basic_machine=m68000-hp +- ;; +- hp9k3[2-9][0-9]) +- basic_machine=m68k-hp +- ;; +- hp9k6[0-9][0-9] | hp6[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hp9k7[0-79][0-9] | hp7[0-79][0-9]) +- basic_machine=hppa1.1-hp +- ;; +- hp9k78[0-9] | hp78[0-9]) +- # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp +- ;; +- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) +- # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp +- ;; +- hp9k8[0-9][13679] | hp8[0-9][13679]) +- basic_machine=hppa1.1-hp +- ;; +- hp9k8[0-9][0-9] | hp8[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hppa-next) +- os=-nextstep3 ++ os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp +- os=-osf ++ os=osf + ;; + hppro) + basic_machine=hppa1.1-hp +- os=-proelf +- ;; +- i370-ibm* | ibm*) +- basic_machine=i370-ibm +- ;; +- i*86v32) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv32 +- ;; +- i*86v4*) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv4 +- ;; +- i*86v) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv +- ;; +- i*86sol2) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-solaris2 ++ os=proelf + ;; + i386mach) + basic_machine=i386-mach +- os=-mach +- ;; +- i386-vsta | vsta) +- basic_machine=i386-unknown +- os=-vsta +- ;; +- iris | iris4d) +- basic_machine=mips-sgi +- case $os in +- -irix*) +- ;; +- *) +- os=-irix4 +- ;; +- esac ++ os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi +- os=-sysv +- ;; +- leon-*|leon[3-9]-*) +- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ++ os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown +- os=-linux +- ;; +- m68knommu-*) +- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- m88k-omron*) +- basic_machine=m88k-omron ++ os=linux + ;; + magnum | m3230) + basic_machine=mips-mips +- os=-sysv ++ os=sysv + ;; + merlin) + basic_machine=ns32k-utek +- os=-sysv +- ;; +- microblaze*) +- basic_machine=microblaze-xilinx ++ os=sysv + ;; + mingw64) + basic_machine=x86_64-pc +- os=-mingw64 ++ os=mingw64 + ;; + mingw32) + basic_machine=i686-pc +- os=-mingw32 ++ os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown +- os=-mingw32ce +- ;; +- miniframe) +- basic_machine=m68000-convergent +- ;; +- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) +- basic_machine=m68k-atari +- os=-mint +- ;; +- mips3*-*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` +- ;; +- mips3*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ++ os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k +- os=-coff ++ os=coff + ;; + morphos) + basic_machine=powerpc-unknown +- os=-morphos ++ os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown +- os=-moxiebox ++ os=moxiebox + ;; + msdos) + basic_machine=i386-pc +- os=-msdos +- ;; +- ms1-*) +- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ++ os=msdos + ;; + msys) + basic_machine=i686-pc +- os=-msys ++ os=msys + ;; + mvs) + basic_machine=i370-ibm +- os=-mvs ++ os=mvs + ;; + nacl) + basic_machine=le32-unknown +- os=-nacl ++ os=nacl + ;; + ncr3000) + basic_machine=i486-ncr +- os=-sysv4 ++ os=sysv4 + ;; + netbsd386) +- basic_machine=i386-unknown +- os=-netbsd ++ basic_machine=i386-pc ++ os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel +- os=-linux ++ os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony +- os=-newsos ++ os=newsos + ;; + news1000) + basic_machine=m68030-sony +- os=-newsos +- ;; +- news-3600 | risc-news) +- basic_machine=mips-sony +- os=-newsos ++ os=newsos + ;; + necv70) + basic_machine=v70-nec +- os=-sysv +- ;; +- next | m*-next ) +- basic_machine=m68k-next +- case $os in +- -nextstep* ) +- ;; +- -ns2*) +- os=-nextstep2 +- ;; +- *) +- os=-nextstep3 +- ;; +- esac ++ os=sysv + ;; + nh3000) + basic_machine=m68k-harris +- os=-cxux ++ os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris +- os=-cxux ++ os=cxux + ;; + nindy960) + basic_machine=i960-intel +- os=-nindy ++ os=nindy + ;; + mon960) + basic_machine=i960-intel +- os=-mon960 ++ os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq +- os=-nonstopux +- ;; +- np1) +- basic_machine=np1-gould +- ;; +- neo-tandem) +- basic_machine=neo-tandem +- ;; +- nse-tandem) +- basic_machine=nse-tandem +- ;; +- nsr-tandem) +- basic_machine=nsr-tandem +- ;; +- op50n-* | op60c-*) +- basic_machine=hppa1.1-oki +- os=-proelf +- ;; +- openrisc | openrisc-*) +- basic_machine=or32-unknown ++ os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm +- os=-os400 ++ os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson +- os=-ose ++ os=ose + ;; + os68k) + basic_machine=m68k-none +- os=-os68k +- ;; +- pa-hitachi) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 ++ os=os68k + ;; + paragon) + basic_machine=i860-intel +- os=-osf ++ os=osf + ;; + parisc) + basic_machine=hppa-unknown +- os=-linux +- ;; +- parisc-*) +- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- pbd) +- basic_machine=sparc-tti +- ;; +- pbb) +- basic_machine=m68k-tti +- ;; +- pc532 | pc532-*) +- basic_machine=ns32k-pc532 +- ;; +- pc98) +- basic_machine=i386-pc +- ;; +- pc98-*) +- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentium | p5 | k5 | k6 | nexgen | viac3) +- basic_machine=i586-pc +- ;; +- pentiumpro | p6 | 6x86 | athlon | athlon_*) +- basic_machine=i686-pc +- ;; +- pentiumii | pentium2 | pentiumiii | pentium3) +- basic_machine=i686-pc +- ;; +- pentium4) +- basic_machine=i786-pc +- ;; +- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) +- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentiumpro-* | p6-* | 6x86-* | athlon-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pentium4-*) +- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- pn) +- basic_machine=pn-gould +- ;; +- power) basic_machine=power-ibm +- ;; +- ppc | ppcbe) basic_machine=powerpc-unknown +- ;; +- ppc-* | ppcbe-*) +- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppcle | powerpclittle) +- basic_machine=powerpcle-unknown +- ;; +- ppcle-* | powerpclittle-*) +- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppc64) basic_machine=powerpc64-unknown +- ;; +- ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppc64le | powerpc64little) +- basic_machine=powerpc64le-unknown +- ;; +- ppc64le-* | powerpc64little-*) +- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ps2) +- basic_machine=i386-ibm ++ os=linux + ;; + pw32) + basic_machine=i586-unknown +- os=-pw32 ++ os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc +- os=-rdos ++ os=rdos + ;; + rdos32) + basic_machine=i386-pc +- os=-rdos ++ os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k +- os=-coff +- ;; +- rm[46]00) +- basic_machine=mips-siemens +- ;; +- rtpc | rtpc-*) +- basic_machine=romp-ibm +- ;; +- s390 | s390-*) +- basic_machine=s390-ibm +- ;; +- s390x | s390x-*) +- basic_machine=s390x-ibm ++ os=coff + ;; + sa29200) + basic_machine=a29k-amd +- os=-udi +- ;; +- sb1) +- basic_machine=mipsisa64sb1-unknown +- ;; +- sb1el) +- basic_machine=mipsisa64sb1el-unknown +- ;; +- sde) +- basic_machine=mipsisa32-sde +- os=-elf ++ os=udi + ;; + sei) + basic_machine=mips-sei +- os=-seiux ++ os=seiux + ;; + sequent) + basic_machine=i386-sequent +- ;; +- sh) +- basic_machine=sh-hitachi +- os=-hms +- ;; +- sh5el) +- basic_machine=sh5le-unknown +- ;; +- sh64) +- basic_machine=sh64-unknown +- ;; +- sparclite-wrs | simso-wrs) +- basic_machine=sparclite-wrs +- os=-vxworks ++ os= + ;; + sps7) + basic_machine=m68k-bull +- os=-sysv2 +- ;; +- spur) +- basic_machine=spur-unknown ++ os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem ++ os= + ;; + stratus) + basic_machine=i860-stratus +- os=-sysv4 +- ;; +- strongarm-* | thumb-*) +- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=sysv4 + ;; + sun2) + basic_machine=m68000-sun ++ os= + ;; + sun2os3) + basic_machine=m68000-sun +- os=-sunos3 ++ os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun +- os=-sunos4 ++ os=sunos4 ++ ;; ++ sun3) ++ basic_machine=m68k-sun ++ os= + ;; + sun3os3) + basic_machine=m68k-sun +- os=-sunos3 ++ os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun +- os=-sunos4 ++ os=sunos4 ++ ;; ++ sun4) ++ basic_machine=sparc-sun ++ os= + ;; + sun4os3) + basic_machine=sparc-sun +- os=-sunos3 ++ os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun +- os=-sunos4 ++ os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun +- os=-solaris2 +- ;; +- sun3 | sun3-*) +- basic_machine=m68k-sun +- ;; +- sun4) +- basic_machine=sparc-sun ++ os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun ++ os= + ;; + sv1) + basic_machine=sv1-cray +- os=-unicos ++ os=unicos + ;; + symmetry) + basic_machine=i386-sequent +- os=-dynix ++ os=dynix + ;; + t3e) + basic_machine=alphaev5-cray +- os=-unicos ++ os=unicos + ;; + t90) + basic_machine=t90-cray +- os=-unicos +- ;; +- tile*) +- basic_machine=$basic_machine-unknown +- os=-linux-gnu +- ;; +- tx39) +- basic_machine=mipstx39-unknown +- ;; +- tx39el) +- basic_machine=mipstx39el-unknown ++ os=unicos + ;; + toad1) + basic_machine=pdp10-xkl +- os=-tops20 +- ;; +- tower | tower-32) +- basic_machine=m68k-ncr ++ os=tops20 + ;; + tpf) + basic_machine=s390x-ibm +- os=-tpf ++ os=tpf + ;; + udi29k) + basic_machine=a29k-amd +- os=-udi ++ os=udi + ;; + ultra3) + basic_machine=a29k-nyu +- os=-sym1 ++ os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec +- os=-none ++ os=none + ;; + vaxv) + basic_machine=vax-dec +- os=-sysv ++ os=sysv + ;; + vms) + basic_machine=vax-dec +- os=-vms ++ os=vms + ;; +- vpp*|vx|vx-*) +- basic_machine=f301-fujitsu ++ vsta) ++ basic_machine=i386-pc ++ os=vsta + ;; + vxworks960) + basic_machine=i960-wrs +- os=-vxworks ++ os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs +- os=-vxworks ++ os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs +- os=-vxworks +- ;; +- w65*) +- basic_machine=w65-wdc +- os=-none +- ;; +- w89k-*) +- basic_machine=hppa1.1-winbond +- os=-proelf ++ os=vxworks + ;; + xbox) + basic_machine=i686-pc +- os=-mingw32 +- ;; +- xps | xps100) +- basic_machine=xps100-honeywell +- ;; +- xscale-* | xscalee[bl]-*) +- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ++ os=mingw32 + ;; + ymp) + basic_machine=ymp-cray +- os=-unicos ++ os=unicos + ;; +- z8k-*-coff) +- basic_machine=z8k-unknown +- os=-sim +- ;; +- z80-*-coff) +- basic_machine=z80-unknown +- os=-sim ++ *) ++ basic_machine=$1 ++ os= + ;; +- none) +- basic_machine=none-none +- os=-none ++ esac + ;; ++esac + ++# Decode 1-component or ad-hoc basic machines ++case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) +- basic_machine=hppa1.1-winbond ++ cpu=hppa1.1 ++ vendor=winbond + ;; + op50n) +- basic_machine=hppa1.1-oki ++ cpu=hppa1.1 ++ vendor=oki + ;; + op60c) +- basic_machine=hppa1.1-oki ++ cpu=hppa1.1 ++ vendor=oki + ;; +- romp) +- basic_machine=romp-ibm ++ ibm*) ++ cpu=i370 ++ vendor=ibm + ;; +- mmix) +- basic_machine=mmix-knuth ++ orion105) ++ cpu=clipper ++ vendor=highlevel + ;; +- rs6000) +- basic_machine=rs6000-ibm ++ mac | mpw | mac-mpw) ++ cpu=m68k ++ vendor=apple + ;; +- vax) +- basic_machine=vax-dec ++ pmac | pmac-mpw) ++ cpu=powerpc ++ vendor=apple + ;; +- pdp10) +- # there are many clones, so DEC is not a safe bet +- basic_machine=pdp10-unknown ++ ++ # Recognize the various machine names and aliases which stand ++ # for a CPU type and a company and sometimes even an OS. ++ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) ++ cpu=m68000 ++ vendor=att + ;; +- pdp11) +- basic_machine=pdp11-dec ++ 3b*) ++ cpu=we32k ++ vendor=att + ;; +- we32k) +- basic_machine=we32k-att ++ bluegene*) ++ cpu=powerpc ++ vendor=ibm ++ os=cnk + ;; +- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) +- basic_machine=sh-unknown ++ decsystem10* | dec10*) ++ cpu=pdp10 ++ vendor=dec ++ os=tops10 + ;; +- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) +- basic_machine=sparc-sun ++ decsystem20* | dec20*) ++ cpu=pdp10 ++ vendor=dec ++ os=tops20 + ;; +- cydra) +- basic_machine=cydra-cydrome ++ delta | 3300 | motorola-3300 | motorola-delta \ ++ | 3300-motorola | delta-motorola) ++ cpu=m68k ++ vendor=motorola + ;; +- orion) +- basic_machine=orion-highlevel ++ dpx2*) ++ cpu=m68k ++ vendor=bull ++ os=sysv3 + ;; +- orion105) +- basic_machine=clipper-highlevel ++ encore | umax | mmax) ++ cpu=ns32k ++ vendor=encore + ;; +- mac | mpw | mac-mpw) +- basic_machine=m68k-apple ++ elxsi) ++ cpu=elxsi ++ vendor=elxsi ++ os=${os:-bsd} + ;; +- pmac | pmac-mpw) +- basic_machine=powerpc-apple ++ fx2800) ++ cpu=i860 ++ vendor=alliant ++ ;; ++ genix) ++ cpu=ns32k ++ vendor=ns ++ ;; ++ h3050r* | hiux*) ++ cpu=hppa1.1 ++ vendor=hitachi ++ os=hiuxwe2 ++ ;; ++ hp3k9[0-9][0-9] | hp9[0-9][0-9]) ++ cpu=hppa1.0 ++ vendor=hp ++ ;; ++ hp9k2[0-9][0-9] | hp9k31[0-9]) ++ cpu=m68000 ++ vendor=hp ++ ;; ++ hp9k3[2-9][0-9]) ++ cpu=m68k ++ vendor=hp ++ ;; ++ hp9k6[0-9][0-9] | hp6[0-9][0-9]) ++ cpu=hppa1.0 ++ vendor=hp ++ ;; ++ hp9k7[0-79][0-9] | hp7[0-79][0-9]) ++ cpu=hppa1.1 ++ vendor=hp ++ ;; ++ hp9k78[0-9] | hp78[0-9]) ++ # FIXME: really hppa2.0-hp ++ cpu=hppa1.1 ++ vendor=hp ++ ;; ++ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) ++ # FIXME: really hppa2.0-hp ++ cpu=hppa1.1 ++ vendor=hp ++ ;; ++ hp9k8[0-9][13679] | hp8[0-9][13679]) ++ cpu=hppa1.1 ++ vendor=hp ++ ;; ++ hp9k8[0-9][0-9] | hp8[0-9][0-9]) ++ cpu=hppa1.0 ++ vendor=hp ++ ;; ++ i*86v32) ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ os=sysv32 ++ ;; ++ i*86v4*) ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ os=sysv4 ++ ;; ++ i*86v) ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ os=sysv ++ ;; ++ i*86sol2) ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ os=solaris2 ++ ;; ++ j90 | j90-cray) ++ cpu=j90 ++ vendor=cray ++ os=${os:-unicos} ++ ;; ++ iris | iris4d) ++ cpu=mips ++ vendor=sgi ++ case $os in ++ irix*) ++ ;; ++ *) ++ os=irix4 ++ ;; ++ esac ++ ;; ++ miniframe) ++ cpu=m68000 ++ vendor=convergent ++ ;; ++ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) ++ cpu=m68k ++ vendor=atari ++ os=mint ++ ;; ++ news-3600 | risc-news) ++ cpu=mips ++ vendor=sony ++ os=newsos ++ ;; ++ next | m*-next) ++ cpu=m68k ++ vendor=next ++ case $os in ++ openstep*) ++ ;; ++ nextstep*) + ;; +- *-unknown) +- # Make sure to match an already-canonicalized machine name. ++ ns2*) ++ os=nextstep2 + ;; + *) +- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 ++ os=nextstep3 ++ ;; ++ esac ++ ;; ++ np1) ++ cpu=np1 ++ vendor=gould ++ ;; ++ op50n-* | op60c-*) ++ cpu=hppa1.1 ++ vendor=oki ++ os=proelf ++ ;; ++ pa-hitachi) ++ cpu=hppa1.1 ++ vendor=hitachi ++ os=hiuxwe2 ++ ;; ++ pbd) ++ cpu=sparc ++ vendor=tti ++ ;; ++ pbb) ++ cpu=m68k ++ vendor=tti ++ ;; ++ pc532) ++ cpu=ns32k ++ vendor=pc532 ++ ;; ++ pn) ++ cpu=pn ++ vendor=gould ++ ;; ++ power) ++ cpu=power ++ vendor=ibm ++ ;; ++ ps2) ++ cpu=i386 ++ vendor=ibm ++ ;; ++ rm[46]00) ++ cpu=mips ++ vendor=siemens ++ ;; ++ rtpc | rtpc-*) ++ cpu=romp ++ vendor=ibm ++ ;; ++ sde) ++ cpu=mipsisa32 ++ vendor=sde ++ os=${os:-elf} ++ ;; ++ simso-wrs) ++ cpu=sparclite ++ vendor=wrs ++ os=vxworks ++ ;; ++ tower | tower-32) ++ cpu=m68k ++ vendor=ncr ++ ;; ++ vpp*|vx|vx-*) ++ cpu=f301 ++ vendor=fujitsu ++ ;; ++ w65) ++ cpu=w65 ++ vendor=wdc ++ ;; ++ w89k-*) ++ cpu=hppa1.1 ++ vendor=winbond ++ os=proelf ++ ;; ++ none) ++ cpu=none ++ vendor=none ++ ;; ++ leon|leon[3-9]) ++ cpu=sparc ++ vendor=$basic_machine ++ ;; ++ leon-*|leon[3-9]-*) ++ cpu=sparc ++ vendor=`echo "$basic_machine" | sed 's/-.*//'` ++ ;; ++ ++ *-*) ++ # shellcheck disable=SC2162 ++ IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac ++ ;; ++esac + + # Here we canonicalize certain aliases for manufacturers. +-case $basic_machine in +- *-digital*) +- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ++case $vendor in ++ digital*) ++ vendor=dec + ;; +- *-commodore*) +- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ++ commodore*) ++ vendor=cbm + ;; + *) + ;; +@@ -1353,200 +1275,244 @@ + + # Decode manufacturer-specific aliases for certain operating systems. + +-if [ x"$os" != x"" ] ++if [ x$os != x ] + then + case $os in +- # First match some system type aliases +- # that might get confused with valid system types. +- # -solaris* is a basic system type, with this one exception. +- -auroraux) +- os=-auroraux ++ # First match some system type aliases that might get confused ++ # with valid system types. ++ # solaris* is a basic system type, with this one exception. ++ auroraux) ++ os=auroraux + ;; +- -solaris1 | -solaris1.*) +- os=`echo $os | sed -e 's|solaris1|sunos4|'` ++ bluegene*) ++ os=cnk + ;; +- -solaris) +- os=-solaris2 ++ solaris1 | solaris1.*) ++ os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; +- -svr4*) +- os=-sysv4 ++ solaris) ++ os=solaris2 + ;; +- -unixware*) +- os=-sysv4.2uw ++ unixware*) ++ os=sysv4.2uw + ;; +- -gnu/linux*) ++ gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; +- # First accept the basic system types. ++ # es1800 is here to avoid being matched by es* (a different OS) ++ es1800*) ++ os=ose ++ ;; ++ # Some version numbers need modification ++ chorusos*) ++ os=chorusos ++ ;; ++ isc) ++ os=isc2.2 ++ ;; ++ sco6) ++ os=sco5v6 ++ ;; ++ sco5) ++ os=sco3.2v5 ++ ;; ++ sco4) ++ os=sco3.2v4 ++ ;; ++ sco3.2.[4-9]*) ++ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ++ ;; ++ sco3.2v[4-9]* | sco5v6*) ++ # Don't forget version if it is 3.2v4 or newer. ++ ;; ++ scout) ++ # Don't match below ++ ;; ++ sco*) ++ os=sco3.2v2 ++ ;; ++ psos*) ++ os=psos ++ ;; ++ # Now accept the basic system types. + # The portable systems comes first. +- # Each alternative MUST END IN A *, to match a version number. +- # -sysv* is not here because it comes later, after sysvr4. +- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ +- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ +- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ +- | -sym* | -kopensolaris* | -plan9* \ +- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ +- | -aos* | -aros* | -cloudabi* | -sortix* \ +- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ +- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ +- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ +- | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ +- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ +- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ +- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ +- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ +- | -chorusos* | -chorusrdb* | -cegcc* \ +- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ +- | -linux-newlib* | -linux-musl* | -linux-uclibc* \ +- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ +- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ +- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ +- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ +- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ +- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ +- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ +- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ +- | -onefs* | -tirtos* | -phoenix*) ++ # Each alternative MUST end in a * to match a version number. ++ # sysv* is not here because it comes later, after sysvr4. ++ gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ ++ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ ++ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ ++ | sym* | kopensolaris* | plan9* \ ++ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ ++ | aos* | aros* | cloudabi* | sortix* | twizzler* \ ++ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ ++ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ ++ | knetbsd* | mirbsd* | netbsd* \ ++ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ ++ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ ++ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ ++ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ ++ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ ++ | chorusrdb* | cegcc* | glidix* \ ++ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ ++ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ ++ | linux-newlib* | linux-musl* | linux-uclibc* \ ++ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ ++ | interix* | uwin* | mks* | rhapsody* | darwin* \ ++ | openstep* | oskit* | conix* | pw32* | nonstopux* \ ++ | storm-chaos* | tops10* | tenex* | tops20* | its* \ ++ | os2* | vos* | palmos* | uclinux* | nucleus* \ ++ | morphos* | superux* | rtmk* | windiss* \ ++ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ ++ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ ++ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ ++ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ ++ | nsk* | powerunix* | genode*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; +- -qnx*) +- case $basic_machine in +- x86-* | i*86-*) ++ qnx*) ++ case $cpu in ++ x86 | i*86) + ;; + *) +- os=-nto$os ++ os=nto-$os + ;; + esac + ;; +- -nto-qnx*) ++ hiux*) ++ os=hiuxwe2 + ;; +- -nto*) +- os=`echo $os | sed -e 's|nto|nto-qnx|'` ++ nto-qnx*) + ;; +- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ +- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ +- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ++ nto*) ++ os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; +- -mac*) +- os=`echo $os | sed -e 's|mac|macos|'` ++ sim | xray | os68k* | v88r* \ ++ | windows* | osx | abug | netware* | os9* \ ++ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) + ;; +- -linux-dietlibc) +- os=-linux-dietlibc ++ linux-dietlibc) ++ os=linux-dietlibc + ;; +- -linux*) ++ linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; +- -sunos5*) +- os=`echo $os | sed -e 's|sunos5|solaris2|'` ++ lynx*178) ++ os=lynxos178 + ;; +- -sunos6*) +- os=`echo $os | sed -e 's|sunos6|solaris3|'` ++ lynx*5) ++ os=lynxos5 + ;; +- -opened*) +- os=-openedition ++ lynx*) ++ os=lynxos + ;; +- -os400*) +- os=-os400 ++ mac*) ++ os=`echo "$os" | sed -e 's|mac|macos|'` + ;; +- -wince*) +- os=-wince ++ opened*) ++ os=openedition + ;; +- -osfrose*) +- os=-osfrose ++ os400*) ++ os=os400 + ;; +- -osf*) +- os=-osf ++ sunos5*) ++ os=`echo "$os" | sed -e 's|sunos5|solaris2|'` + ;; +- -utek*) +- os=-bsd ++ sunos6*) ++ os=`echo "$os" | sed -e 's|sunos6|solaris3|'` + ;; +- -dynix*) +- os=-bsd ++ wince*) ++ os=wince + ;; +- -acis*) +- os=-aos ++ utek*) ++ os=bsd + ;; +- -atheos*) +- os=-atheos ++ dynix*) ++ os=bsd + ;; +- -syllable*) +- os=-syllable ++ acis*) ++ os=aos + ;; +- -386bsd) +- os=-bsd ++ atheos*) ++ os=atheos + ;; +- -ctix* | -uts*) +- os=-sysv ++ syllable*) ++ os=syllable + ;; +- -nova*) +- os=-rtmk-nova ++ 386bsd) ++ os=bsd + ;; +- -ns2 ) +- os=-nextstep2 ++ ctix* | uts*) ++ os=sysv + ;; +- -nsk*) +- os=-nsk ++ nova*) ++ os=rtmk-nova ++ ;; ++ ns2) ++ os=nextstep2 + ;; + # Preserve the version number of sinix5. +- -sinix5.*) ++ sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; +- -sinix*) +- os=-sysv4 ++ sinix*) ++ os=sysv4 + ;; +- -tpf*) +- os=-tpf ++ tpf*) ++ os=tpf + ;; +- -triton*) +- os=-sysv3 ++ triton*) ++ os=sysv3 + ;; +- -oss*) +- os=-sysv3 ++ oss*) ++ os=sysv3 + ;; +- -svr4) +- os=-sysv4 ++ svr4*) ++ os=sysv4 + ;; +- -svr3) +- os=-sysv3 ++ svr3) ++ os=sysv3 + ;; +- -sysvr4) +- os=-sysv4 ++ sysvr4) ++ os=sysv4 + ;; +- # This must come after -sysvr4. +- -sysv*) ++ # This must come after sysvr4. ++ sysv*) + ;; +- -ose*) +- os=-ose ++ ose*) ++ os=ose + ;; +- -es1800*) +- os=-ose ++ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) ++ os=mint + ;; +- -xenix) +- os=-xenix ++ zvmoe) ++ os=zvmoe + ;; +- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) +- os=-mint ++ dicos*) ++ os=dicos + ;; +- -aros*) +- os=-aros ++ pikeos*) ++ # Until real need of OS specific support for ++ # particular features comes up, bare metal ++ # configurations are quite functional. ++ case $cpu in ++ arm*) ++ os=eabi + ;; +- -zvmoe) +- os=-zvmoe ++ *) ++ os=elf + ;; +- -dicos*) +- os=-dicos ++ esac + ;; +- -nacl*) ++ nacl*) + ;; +- -ios) ++ ios) ++ ;; ++ none) + ;; +- -none) ++ *-eabi) + ;; + *) +- # Get rid of the `-' at the beginning of $os. +- os=`echo $os | sed 's/[^-]*-//'` +- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 ++ echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 + exit 1 + ;; + esac +@@ -1562,261 +1528,265 @@ + # will signal an error saying that MANUFACTURER isn't an operating + # system, and we'll never get to this point. + +-case $basic_machine in ++case $cpu-$vendor in + score-*) +- os=-elf ++ os=elf + ;; + spu-*) +- os=-elf ++ os=elf + ;; + *-acorn) +- os=-riscix1.2 ++ os=riscix1.2 + ;; + arm*-rebel) +- os=-linux ++ os=linux + ;; + arm*-semi) +- os=-aout ++ os=aout + ;; + c4x-* | tic4x-*) +- os=-coff ++ os=coff + ;; + c8051-*) +- os=-elf ++ os=elf ++ ;; ++ clipper-intergraph) ++ os=clix + ;; + hexagon-*) +- os=-elf ++ os=elf + ;; + tic54x-*) +- os=-coff ++ os=coff + ;; + tic55x-*) +- os=-coff ++ os=coff + ;; + tic6x-*) +- os=-coff ++ os=coff + ;; + # This must come before the *-dec entry. + pdp10-*) +- os=-tops20 ++ os=tops20 + ;; + pdp11-*) +- os=-none ++ os=none + ;; + *-dec | vax-*) +- os=-ultrix4.2 ++ os=ultrix4.2 + ;; + m68*-apollo) +- os=-domain ++ os=domain + ;; + i386-sun) +- os=-sunos4.0.2 ++ os=sunos4.0.2 + ;; + m68000-sun) +- os=-sunos3 ++ os=sunos3 + ;; + m68*-cisco) +- os=-aout ++ os=aout + ;; + mep-*) +- os=-elf ++ os=elf + ;; + mips*-cisco) +- os=-elf ++ os=elf + ;; + mips*-*) +- os=-elf ++ os=elf + ;; + or32-*) +- os=-coff ++ os=coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. +- os=-sysv3 ++ os=sysv3 + ;; + sparc-* | *-sun) +- os=-sunos4.1.1 ++ os=sunos4.1.1 + ;; +- *-be) +- os=-beos ++ pru-*) ++ os=elf + ;; +- *-haiku) +- os=-haiku ++ *-be) ++ os=beos + ;; + *-ibm) +- os=-aix ++ os=aix + ;; + *-knuth) +- os=-mmixware ++ os=mmixware + ;; + *-wec) +- os=-proelf ++ os=proelf + ;; + *-winbond) +- os=-proelf ++ os=proelf + ;; + *-oki) +- os=-proelf ++ os=proelf + ;; + *-hp) +- os=-hpux ++ os=hpux + ;; + *-hitachi) +- os=-hiux ++ os=hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) +- os=-sysv ++ os=sysv + ;; + *-cbm) +- os=-amigaos ++ os=amigaos + ;; + *-dg) +- os=-dgux ++ os=dgux + ;; + *-dolphin) +- os=-sysv3 ++ os=sysv3 + ;; + m68k-ccur) +- os=-rtu ++ os=rtu + ;; + m88k-omron*) +- os=-luna ++ os=luna + ;; + *-next ) +- os=-nextstep ++ os=nextstep + ;; + *-sequent) +- os=-ptx ++ os=ptx + ;; + *-crds) +- os=-unos ++ os=unos + ;; + *-ns) +- os=-genix ++ os=genix + ;; + i370-*) +- os=-mvs +- ;; +- *-next) +- os=-nextstep3 ++ os=mvs + ;; + *-gould) +- os=-sysv ++ os=sysv + ;; + *-highlevel) +- os=-bsd ++ os=bsd + ;; + *-encore) +- os=-bsd ++ os=bsd + ;; + *-sgi) +- os=-irix ++ os=irix + ;; + *-siemens) +- os=-sysv4 ++ os=sysv4 + ;; + *-masscomp) +- os=-rtu ++ os=rtu + ;; + f30[01]-fujitsu | f700-fujitsu) +- os=-uxpv ++ os=uxpv + ;; + *-rom68k) +- os=-coff ++ os=coff + ;; + *-*bug) +- os=-coff ++ os=coff + ;; + *-apple) +- os=-macos ++ os=macos + ;; + *-atari*) +- os=-mint ++ os=mint ++ ;; ++ *-wrs) ++ os=vxworks + ;; + *) +- os=-none ++ os=none + ;; + esac + fi + + # Here we handle the case where we know the os, and the CPU type, but not the + # manufacturer. We pick the logical manufacturer. +-vendor=unknown +-case $basic_machine in +- *-unknown) ++case $vendor in ++ unknown) + case $os in +- -riscix*) ++ riscix*) + vendor=acorn + ;; +- -sunos*) ++ sunos*) + vendor=sun + ;; +- -cnk*|-aix*) ++ cnk*|-aix*) + vendor=ibm + ;; +- -beos*) ++ beos*) + vendor=be + ;; +- -hpux*) ++ hpux*) + vendor=hp + ;; +- -mpeix*) ++ mpeix*) + vendor=hp + ;; +- -hiux*) ++ hiux*) + vendor=hitachi + ;; +- -unos*) ++ unos*) + vendor=crds + ;; +- -dgux*) ++ dgux*) + vendor=dg + ;; +- -luna*) ++ luna*) + vendor=omron + ;; +- -genix*) ++ genix*) + vendor=ns + ;; +- -mvs* | -opened*) ++ clix*) ++ vendor=intergraph ++ ;; ++ mvs* | opened*) + vendor=ibm + ;; +- -os400*) ++ os400*) + vendor=ibm + ;; +- -ptx*) ++ ptx*) + vendor=sequent + ;; +- -tpf*) ++ tpf*) + vendor=ibm + ;; +- -vxsim* | -vxworks* | -windiss*) ++ vxsim* | vxworks* | windiss*) + vendor=wrs + ;; +- -aux*) ++ aux*) + vendor=apple + ;; +- -hms*) ++ hms*) + vendor=hitachi + ;; +- -mpw* | -macos*) ++ mpw* | macos*) + vendor=apple + ;; +- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) ++ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + vendor=atari + ;; +- -vos*) ++ vos*) + vendor=stratus + ;; + esac +- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; + esac + +-echo $basic_machine$os ++echo "$cpu-$vendor-$os" + exit + + # Local variables: +-# eval: (add-hook 'write-file-hooks 'time-stamp) ++# eval: (add-hook 'before-save-hook 'time-stamp) + # time-stamp-start: "timestamp='" + # time-stamp-format: "%:y-%02m-%02d" + # time-stamp-end: "'" diff --git a/recipes/pcre/recipe.toml b/recipes/pcre/recipe.toml new file mode 100644 index 000000000..ebde0bd04 --- /dev/null +++ b/recipes/pcre/recipe.toml @@ -0,0 +1,8 @@ +[source] +tar = "https://ftp.pcre.org/pub/pcre/pcre-8.42.tar.bz2" +patches = [ + "redox.patch" +] + +[build] +template = "configure" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 06edae0c4..e0ab5a4f4 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -58,6 +58,48 @@ fn run_command(mut command: process::Command) -> Result<(), String> { Ok(()) } +fn run_command_stdin(mut command: process::Command, stdin_data: &[u8]) -> Result<(), String> { + command.stdin(Stdio::piped()); + + let mut child = command.spawn().map_err(|err| format!( + "failed to spawn {:?}: {}\n{:#?}", + command, + err, + err + ))?; + + if let Some(ref mut stdin) = child.stdin { + stdin.write_all(stdin_data).map_err(|err| format!( + "failed to write stdin of {:?}: {}\n{:#?}", + command, + err, + err + ))?; + } else { + return Err(format!( + "failed to find stdin of {:?}", + command + )); + } + + let status = child.wait().map_err(|err| format!( + "failed to run {:?}: {}\n{:#?}", + command, + err, + err + ))?; + + if ! status.success() { + return Err(format!( + "failed to run {:?}: exited with status {}", + command, + status + )); + } + + Ok(()) +} + fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { let source_dir = recipe_dir.join("source"); match source { @@ -73,7 +115,7 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { if let Some(branch) = branch { command.arg("--branch").arg(&branch); } - command.arg(&source_dir); + command.arg(&source_dir_tmp); run_command(command)?; // Move source.tmp to source atomically @@ -221,43 +263,7 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { let mut command = Command::new("patch"); command.arg("--directory").arg(&source_dir_tmp); command.arg("--strip=1"); - command.stdin(Stdio::piped()); - - let mut child = command.spawn().map_err(|err| format!( - "failed to spawn {:?}: {}\n{:#?}", - command, - err, - err - ))?; - - if let Some(ref mut stdin) = child.stdin { - stdin.write_all(patch.as_bytes()).map_err(|err| format!( - "failed to write stdin of {:?}: {}\n{:#?}", - command, - err, - err - ))?; - } else { - return Err(format!( - "failed to find stdin of {:?}", - command - )); - } - - let status = child.wait().map_err(|err| format!( - "failed to run {:?}: {}\n{:#?}", - command, - err, - err - ))?; - - if ! status.success() { - return Err(format!( - "failed to run {:?}: exited with status {}", - command, - status - )); - } + run_command_stdin(command, patch.as_bytes())?; } // Move source.tmp to source atomically @@ -269,6 +275,83 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { Ok(source_dir) } +fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result { + let stage_dir = recipe_dir.join("stage"); + if ! stage_dir.is_dir() { + // Create stage.tmp + let stage_dir_tmp = recipe_dir.join("stage.tmp"); + create_dir_clean(&stage_dir_tmp)?; + + // Create build, if it does not exist + //TODO: flag for clean builds where build is wiped out + let build_dir = recipe_dir.join("build"); + if ! build_dir.is_dir() { + create_dir_clean(&build_dir)?; + } + + //TODO: better integration with redoxer (library instead of binary) + //TODO: configurable target + match build { + BuildRecipe::Cargo => { + let mut command = Command::new("redoxer"); + command.arg("install"); + //TODO: --debug if desired + command.arg("--path").arg(&source_dir); + command.arg("--root").arg(&stage_dir_tmp); + command.env("CARGO_TARGET_DIR", &build_dir); + run_command(command)?; + }, + BuildRecipe::Configure => { + //TODO: Add more configurability, convert script to Rust + let mut command = Command::new("redoxer"); + command.arg("env"); + command.arg("bash").arg("-ex"); + //TODO: remove unwraps + command.env("COOKBOOK_STAGE", &stage_dir_tmp.canonicalize().unwrap()); + command.env("COOKBOOK_SOURCE", &source_dir.canonicalize().unwrap()); + command.current_dir(&build_dir); + run_command_stdin(command, r#" + export LDFLAGS="--static" + "${COOKBOOK_SOURCE}/configure" \ + --host="${TARGET}" \ + --prefix="" \ + --disable-shared \ + --enable-static + make -j "$(nproc)" + make install DESTDIR="${COOKBOOK_STAGE}" + + # Strip binaries + if [ -d "${COOKBOOK_STAGE}/bin" ] + then + find "${COOKBOOK_STAGE}/bin" -type f -exec "${TARGET}-strip" -v {} ';' + fi + + # Remove libtool files + if [ -d "${COOKBOOK_STAGE}/lib" ] + then + find "${COOKBOOK_STAGE}/lib" -type f -name '*.la' -exec rm -fv {} ';' + fi + "#.as_bytes())?; + }, + BuildRecipe::Custom { script } => { + let mut command = Command::new("redoxer"); + command.arg("env"); + command.arg("bash").arg("-ex"); + //TODO: remove unwraps + command.env("COOKBOOK_STAGE", &stage_dir_tmp.canonicalize().unwrap()); + command.env("COOKBOOK_SOURCE", &source_dir.canonicalize().unwrap()); + command.current_dir(&build_dir); + run_command_stdin(command, script.as_bytes())?; + }, + } + + // Move stage.tmp to stage atomically + rename(&stage_dir_tmp, &stage_dir)?; + } + + Ok(stage_dir) +} + fn cook(recipe_name: &str) -> Result<(), String> { //TODO: sanitize recipe name? let recipe_dir = Path::new("recipes").join(recipe_name); @@ -306,6 +389,11 @@ fn cook(recipe_name: &str) -> Result<(), String> { err ))?; + let stage_dir = build(&recipe_dir, &source_dir, &recipe.build).map_err(|err| format!( + "failed to build: {}", + err + ))?; + Ok(()) } diff --git a/src/recipe.rs b/src/recipe.rs index da6db88aa..0fee27d36 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -39,6 +39,9 @@ pub enum BuildRecipe { /// Will build and install using cargo #[serde(rename = "cargo")] Cargo, + /// Will build and install using configure and make + #[serde(rename = "configure")] + Configure, /// Will build and install using custom commands #[serde(rename = "custom")] Custom { From ae4b56fca674e84d68c205525700fb131d16776e Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 16:07:55 -0600 Subject: [PATCH 06/45] Add zlib recipe.toml --- recipes/zlib/recipe.toml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 recipes/zlib/recipe.toml diff --git a/recipes/zlib/recipe.toml b/recipes/zlib/recipe.toml new file mode 100644 index 000000000..178a62eda --- /dev/null +++ b/recipes/zlib/recipe.toml @@ -0,0 +1,14 @@ +[source] +tar = "http://zlib.net/zlib-1.2.11.tar.gz" + +[build] +template = "custom" +script = """ + export LDFLAGS="--static" + # See https://stackoverflow.com/questions/21396988/zlib-build-not-configuring-properly-with-cross-compiler-ignores-ar. + CHOST="${TARGET}" "${COOKBOOK_SOURCE}/configure" \ + --prefix="" \ + --static + make -j "$(nproc)" + make install DESTDIR="${COOKBOOK_STAGE}" +""" From 21a4106dc76a8b21c5d041fa2a8f898a378989df Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 21:16:16 -0600 Subject: [PATCH 07/45] Build pkgar archives, implement build depends --- Cargo.lock | 313 ++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/bin/cook.rs | 211 ++++++++++++++++++++++++++------ src/recipe.rs | 45 +++++-- 4 files changed, 524 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0a5f1d06..72a25cf97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,13 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "arrayref" version = "0.3.6" @@ -10,6 +18,41 @@ name = "arrayvec" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "blake3" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "blake3" version = "0.3.3" @@ -63,11 +106,68 @@ name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "clap" +version = "2.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "crossbeam-deque" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crypto-mac" version = "0.7.0" @@ -85,6 +185,11 @@ dependencies = [ "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fake-simd" version = "0.1.2" @@ -98,11 +203,61 @@ dependencies = [ "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hermit-abi" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "index-fixed" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "libc" version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "numtoa" version = "0.1.0" @@ -124,6 +279,29 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "pkgar" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "blake3 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)", + "plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sodalite 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ppv-lite86" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc-macro2" version = "1.0.13" @@ -140,12 +318,72 @@ dependencies = [ "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "redox_cookbook" version = "0.1.0" dependencies = [ "blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pkgar 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -165,6 +403,11 @@ dependencies = [ "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "serde" version = "1.0.110" @@ -194,6 +437,19 @@ dependencies = [ "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "sodalite" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "index-fixed 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "subtle" version = "1.0.0" @@ -220,6 +476,14 @@ dependencies = [ "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "time" version = "0.1.43" @@ -242,11 +506,26 @@ name = "typenum" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi" version = "0.3.8" @@ -267,8 +546,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum blake3 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "667d945f23cefed0b5f973af35c4bc3319caa6776fbda270e4897d8504afa8e4" "checksum blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "68df31bdf2bbb567e5adf8f21ac125dc0e897b1381e7b841f181521f06fc3134" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" @@ -276,29 +560,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" "checksum cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)" = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" "checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" "checksum crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71" +"checksum index-fixed 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63adf4f50cae82ddb03b088a55172f5044e73c8f02d029e69780717f764bbfa" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)" = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" +"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +"checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" "checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4403eb718d70c03ee279e51737782902c68cca01e870a33b6a2f9dfb50b9cd83" +"checksum pkgar 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74003f2ac9baa8600352a677bd8763088cc35498a4364abe9ae5898832015bb9" +"checksum plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +"checksum ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" "checksum proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "53f5ffe53a6b28e37c9c1ce74893477864d64f74778a93a4beb43c8fa167f639" "checksum quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" +"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +"checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" "checksum serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c" "checksum serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" "checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +"checksum sodalite 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67643084c740297bac275b1d97901ec27ca5984be4e8f75d86a33498e0e3e61c" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum syn 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)" = "1425de3c33b0941002740a420b1a906a350b88d08b82b2c8a01035a3f9447bac" "checksum termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" "checksum toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" "checksum typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index 5b297bc9f..34ce71a28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ path = "src/lib.rs" [dependencies] blake3 = "0.3.3" pbr = "1.0.2" +pkgar = "0.1.6" serde = { version = "1.0", features = ["derive"] } sha2 = "0.8.1" termion = "1.5.5" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index e0ab5a4f4..e9ed47e85 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -1,5 +1,5 @@ use cookbook::blake3::blake3_progress; -use cookbook::recipe::{Recipe, SourceRecipe, BuildRecipe}; +use cookbook::recipe::{Recipe, SourceRecipe, BuildKind, BuildRecipe, PackageRecipe}; use cookbook::sha256::sha256_progress; use std::{ env, @@ -276,6 +276,32 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { } fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result { + let sysroot_dir = recipe_dir.join("sysroot"); + if ! sysroot_dir.is_dir() { + // Create sysroot.tmp + let sysroot_dir_tmp = recipe_dir.join("sysroot.tmp"); + create_dir_clean(&sysroot_dir_tmp)?; + + for dependency in build.dependencies.iter() { + let public_path = "build/public.key"; + //TODO: sanitize name + let archive_path = format!("recipes/{}/stage.pkgar", dependency); + pkgar::bin::extract( + public_path, + &archive_path, + sysroot_dir_tmp.to_str().unwrap() + ).map_err(|err| format!( + "failed to install '{}' in '{}': {:?}", + archive_path, + sysroot_dir_tmp.display(), + err + ))?; + } + + // Move sysroot.tmp to sysroot atomically + rename(&sysroot_dir_tmp, &sysroot_dir)?; + } + let stage_dir = recipe_dir.join("stage"); if ! stage_dir.is_dir() { // Create stage.tmp @@ -291,8 +317,8 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result { + match &build.kind { + BuildKind::Cargo => { let mut command = Command::new("redoxer"); command.arg("install"); //TODO: --debug if desired @@ -301,7 +327,7 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result { + BuildKind::Configure => { //TODO: Add more configurability, convert script to Rust let mut command = Command::new("redoxer"); command.arg("env"); @@ -309,9 +335,11 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result Result { + BuildKind::Custom { script } => { let mut command = Command::new("redoxer"); command.arg("env"); command.arg("bash").arg("-ex"); //TODO: remove unwraps command.env("COOKBOOK_STAGE", &stage_dir_tmp.canonicalize().unwrap()); command.env("COOKBOOK_SOURCE", &source_dir.canonicalize().unwrap()); + command.env("COOKBOOK_SYSROOT", &sysroot_dir.canonicalize().unwrap()); command.current_dir(&build_dir); run_command_stdin(command, script.as_bytes())?; }, @@ -352,38 +381,34 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result Result<(), String> { - //TODO: sanitize recipe name? - let recipe_dir = Path::new("recipes").join(recipe_name); - if ! recipe_dir.is_dir() { - return Err(format!( - "failed to find recipe directory '{}'", - recipe_dir.display() - )); +fn package(recipe_dir: &Path, stage_dir: &Path, package: &PackageRecipe) -> Result { + //TODO: metadata like dependencies, name, and version + + let secret_path = "build/secret.key"; + let public_path = "build/public.key"; + if ! Path::new(secret_path).is_file() || ! Path::new(public_path).is_file() { + pkgar::bin::keygen(secret_path, public_path).map_err(|err| format!( + "failed to generate pkgar keys: {:?}", + err + ))?; } - let recipe_file = recipe_dir.join("recipe.toml"); - if ! recipe_file.is_file() { - return Err(format!( - "failed to find recipe file '{}'", - recipe_file.display() - )); + let package_file = recipe_dir.join("stage.pkgar"); + if ! package_file.is_file() { + pkgar::bin::create( + secret_path, + package_file.to_str().unwrap(), + stage_dir.to_str().unwrap() + ).map_err(|err| format!( + "failed to create pkgar archive: {:?}", + err + ))?; } - let recipe_toml = fs::read_to_string(&recipe_file).map_err(|err| format!( - "failed to read recipe file '{}': {}\n{:#?}", - recipe_file.display(), - err, - err - ))?; - - let recipe: Recipe = toml::from_str(&recipe_toml).map_err(|err| format!( - "failed to parse recipe file '{}': {}\n{:#?}", - recipe_file.display(), - err, - err - ))?; + Ok(package_file) +} +fn cook(recipe_dir: &Path, recipe: &Recipe) -> Result<(), String> { let source_dir = fetch(&recipe_dir, &recipe.source).map_err(|err| format!( "failed to fetch: {}", err @@ -394,41 +419,151 @@ fn cook(recipe_name: &str) -> Result<(), String> { err ))?; + let package_file = package(&recipe_dir, &stage_dir, &recipe.package).map_err(|err| format!( + "failed to package: {}", + err + ))?; + Ok(()) } +pub struct CookRecipe { + name: String, + dir: PathBuf, + recipe: Recipe, +} + +impl CookRecipe { + pub fn new(name: String) -> Result { + //TODO: sanitize recipe name? + let dir = Path::new("recipes").join(&name); + if ! dir.is_dir() { + return Err(format!( + "failed to find recipe directory '{}'", + dir.display() + )); + } + + let file = dir.join("recipe.toml"); + if ! file.is_file() { + return Err(format!( + "failed to find recipe file '{}'", + file.display() + )); + } + + let toml = fs::read_to_string(&file).map_err(|err| format!( + "failed to read recipe file '{}': {}\n{:#?}", + file.display(), + err, + err + ))?; + + let recipe: Recipe = toml::from_str(&toml).map_err(|err| format!( + "failed to parse recipe file '{}': {}\n{:#?}", + file.display(), + err, + err + ))?; + + Ok(Self { + name, + dir, + recipe + }) + } + + //TODO: make this more efficient, smarter, and not return duplicates + pub fn new_recursive(names: &[String], recursion: usize) -> Result, String> { + if recursion == 0 { + return Err(format!( + "recursion limit while processing build dependencies: {:#?}", + names + )); + } + + let mut recipes = Vec::new(); + for name in names { + let recipe = Self::new(name.clone())?; + + let dependencies = Self::new_recursive( + &recipe.recipe.build.dependencies, + recursion - 1 + ).map_err(|err| format!( + "{}: failed on loading build dependencies:\n{}", + name, + err + ))?; + + for dependency in dependencies { + recipes.push(dependency); + } + + recipes.push(recipe); + } + + Ok(recipes) + } +} + fn main() { let mut matching = true; + let mut dry_run = false; let mut quiet = false; let mut recipe_names = Vec::new(); for arg in env::args().skip(1) { match arg.as_str() { "--" if matching => matching = false, + "-d" | "--dry-run" if matching => dry_run = true, "-q" | "--quiet" if matching => quiet = true, _ => recipe_names.push(arg), } } - for recipe_name in recipe_names.iter() { + let recipes = match CookRecipe::new_recursive(&recipe_names, 16) { + Ok(ok) => ok, + Err(err) => { + eprintln!( + "{}{}cook - error:{}{} {}", + style::Bold, + color::Fg(color::AnsiValue(196)), + color::Fg(color::Reset), + style::Reset, + err, + ); + process::exit(1); + } + }; + + for recipe in recipes { if ! quiet { eprintln!( "{}{}cook - {}{}{}", style::Bold, color::Fg(color::AnsiValue(215)), - recipe_name, + recipe.name, color::Fg(color::Reset), style::Reset, ); } - match cook(recipe_name) { + let res = if dry_run { + if ! quiet { + eprintln!("DRY RUN: {:#?}", recipe.recipe); + } + Ok(()) + } else { + cook(&recipe.dir, &recipe.recipe) + }; + + match res { Ok(()) => { if ! quiet { eprintln!( "{}{}cook - {} - successful{}{}", style::Bold, color::Fg(color::AnsiValue(46)), - recipe_name, + recipe.name, color::Fg(color::Reset), style::Reset, ); @@ -439,7 +574,7 @@ fn main() { "{}{}cook - {} - error:{}{} {}", style::Bold, color::Fg(color::AnsiValue(196)), - recipe_name, + recipe.name, color::Fg(color::Reset), style::Reset, err, diff --git a/src/recipe.rs b/src/recipe.rs index 0fee27d36..7385076bf 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -35,7 +35,7 @@ pub enum SourceRecipe { /// Specifies how to build a recipe #[derive(Debug, Deserialize, PartialEq, Serialize)] #[serde(tag = "template")] -pub enum BuildRecipe { +pub enum BuildKind { /// Will build and install using cargo #[serde(rename = "cargo")] Cargo, @@ -49,6 +49,20 @@ pub enum BuildRecipe { }, } +#[derive(Debug, Deserialize, PartialEq, Serialize)] +pub struct BuildRecipe { + #[serde(flatten)] + pub kind: BuildKind, + #[serde(default)] + pub dependencies: Vec, +} + +#[derive(Debug, Default, Deserialize, PartialEq, Serialize)] +pub struct PackageRecipe { + #[serde(default)] + pub dependencies: Vec, +} + /// Everything required to build a Redox package #[derive(Debug, Deserialize, PartialEq, Serialize)] pub struct Recipe { @@ -56,6 +70,9 @@ pub struct Recipe { pub source: SourceRecipe, /// Specifies how to build this recipe pub build: BuildRecipe, + /// Specifies how to package this recipe + #[serde(default)] + pub package: PackageRecipe, } @@ -63,7 +80,7 @@ pub struct Recipe { mod tests { #[test] fn git_cargo_recipe() { - use crate::recipe::{Recipe, SourceRecipe, BuildRecipe}; + use crate::recipe::{Recipe, SourceRecipe, BuildKind, BuildRecipe, PackageRecipe}; let recipe: Recipe = toml::from_str(r#" [source] @@ -82,14 +99,19 @@ mod tests { branch: Some("master".to_string()), rev: Some("06344744d3d55a5ac9a62a6059cb363d40699bbc".to_string()), }, - patches: Vec::new(), - build: BuildRecipe::Cargo, + build: BuildRecipe { + kind: BuildKind::Cargo, + dependencies: Vec::new(), + }, + package: PackageRecipe { + dependencies: Vec::new(), + }, }); } #[test] fn tar_custom_recipe() { - use crate::recipe::{Recipe, SourceRecipe, BuildRecipe}; + use crate::recipe::{Recipe, SourceRecipe, BuildKind, BuildRecipe, PackageRecipe}; let recipe: Recipe = toml::from_str(r#" [source] @@ -104,11 +126,18 @@ mod tests { assert_eq!(recipe, Recipe { source: SourceRecipe::Tar { tar: "http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.xz".to_string(), + blake3: None, sha256: Some("4f3fc6178a533d392064f14776b23c397ed4b9f48f5de297aba73b643f955c08".to_string()), + patches: Vec::new(), }, - patches: Vec::new(), - build: BuildRecipe::Custom { - script: "make".to_string() + build: BuildRecipe { + kind: BuildKind::Custom { + script: "make".to_string() + }, + dependencies: Vec::new(), + }, + package: PackageRecipe { + dependencies: Vec::new(), }, }); } From a555a6d865c9dc68e52aedbc893532c1743fbcc6 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 21:16:30 -0600 Subject: [PATCH 08/45] Add libxml2 and xz recipe.toml --- recipes/libxml2/recipe.toml | 33 +++++++++++++++++++++++++++++++++ recipes/xz/recipe.toml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 recipes/libxml2/recipe.toml create mode 100644 recipes/xz/recipe.toml diff --git a/recipes/libxml2/recipe.toml b/recipes/libxml2/recipe.toml new file mode 100644 index 000000000..befedf226 --- /dev/null +++ b/recipes/libxml2/recipe.toml @@ -0,0 +1,33 @@ +[source] +tar = "ftp://xmlsoft.org/libxml2/libxml2-2.9.9.tar.gz" + +[build] +template = "custom" +dependencies = [ + "xz", + "zlib" +] +script = """ +export CFLAGS="-I'${COOKBOOK_SYSROOT}/include'" +export LDFLAGS="-L'${COOKBOOK_SYSROOT}/lib' --static" +"${COOKBOOK_SOURCE}/configure" \ + --host="${TARGET}" \ + --prefix="" \ + --disable-shared \ + --enable-static \ + --without-python +make -j "$(nproc)" +make install DESTDIR="${COOKBOOK_STAGE}" + +# Strip binaries +if [ -d "${COOKBOOK_STAGE}/bin" ] +then + find "${COOKBOOK_STAGE}/bin" -type f -exec "${TARGET}-strip" -v {} ';' +fi + +# Remove libtool files +if [ -d "${COOKBOOK_STAGE}/lib" ] +then + find "${COOKBOOK_STAGE}/lib" -type f -name '*.la' -exec rm -fv {} ';' +fi +""" diff --git a/recipes/xz/recipe.toml b/recipes/xz/recipe.toml new file mode 100644 index 000000000..8130662d8 --- /dev/null +++ b/recipes/xz/recipe.toml @@ -0,0 +1,34 @@ +[source] +tar = "https://codeload.github.com/xz-mirror/xz/tar.gz/v5.2.3" +patches = [ + "01-no-poll.patch", + "02-o_noctty.patch", + "03-no-signals.patch" +] + +[build] +template = "custom" +script = """ +#TODO: simpler recipe +rsync -av --delete "${COOKBOOK_SOURCE}/" ./ + +./autogen.sh + +chmod +w build-aux/config.sub +wget -O build-aux/config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub + +export CFLAGS="-static" +"./configure" \ + --host="${TARGET}" \ + --prefix="" \ + --disable-lzmadec \ + --disable-lzmainfo \ + --disable-xz \ + --disable-xzdec \ + --enable-shared=no \ + --enable-static=yes \ + --enable-threads=no \ + --with-pic=no +make -j "$(nproc)" +make install DESTDIR="${COOKBOOK_STAGE}" +""" From a0b68cc4376251fef37dd2aa3848a9f0b8e8a2b1 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 21:19:18 -0600 Subject: [PATCH 09/45] Ignore new tmp files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 7fd983980..c85b9a858 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,12 @@ build repo source +source.tmp source-new source.tar +source.tar.tmp stage +stage.tmp stage.pkg stage.pkgar stage.sig @@ -11,6 +14,7 @@ stage.tar stage.tar.gz stage.toml sysroot +sysroot.tmp xargo From ebc3e64b09bbecbd4320836c0442315fe7238d96 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 20 May 2020 21:19:30 -0600 Subject: [PATCH 10/45] Add ion recipe --- recipes/ion/recipe.toml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 recipes/ion/recipe.toml diff --git a/recipes/ion/recipe.toml b/recipes/ion/recipe.toml new file mode 100644 index 000000000..5ac9d4520 --- /dev/null +++ b/recipes/ion/recipe.toml @@ -0,0 +1,6 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/ion.git" +branch = "master" + +[build] +template = "cargo" From 69ef10f035dc62c519d579e28c4e89938eb0747d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 11:14:00 -0600 Subject: [PATCH 11/45] Improve ability to override cookbook items, improve C support --- src/bin/cook.rs | 154 +++++++++++++++++++++++++++++++----------------- 1 file changed, 100 insertions(+), 54 deletions(-) diff --git a/src/bin/cook.rs b/src/bin/cook.rs index e9ed47e85..43c188dd6 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -282,6 +282,21 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result Result { - let mut command = Command::new("redoxer"); - command.arg("install"); - //TODO: --debug if desired - command.arg("--path").arg(&source_dir); - command.arg("--root").arg(&stage_dir_tmp); - command.env("CARGO_TARGET_DIR", &build_dir); - run_command(command)?; - }, - BuildKind::Configure => { - //TODO: Add more configurability, convert script to Rust - let mut command = Command::new("redoxer"); - command.arg("env"); - command.arg("bash").arg("-ex"); - //TODO: remove unwraps - command.env("COOKBOOK_STAGE", &stage_dir_tmp.canonicalize().unwrap()); - command.env("COOKBOOK_SOURCE", &source_dir.canonicalize().unwrap()); - command.env("COOKBOOK_SYSROOT", &sysroot_dir.canonicalize().unwrap()); - command.current_dir(&build_dir); - run_command_stdin(command, r#" - export CFLAGS="-I'${COOKBOOK_SYSROOT}/include'" - export LDFLAGS="-L'${COOKBOOK_SYSROOT}/lib' --static" - "${COOKBOOK_SOURCE}/configure" \ - --host="${TARGET}" \ - --prefix="" \ - --disable-shared \ - --enable-static - make -j "$(nproc)" - make install DESTDIR="${COOKBOOK_STAGE}" + //TODO: Add more configurability, convert scripts to Rust? + let script = match &build.kind { + BuildKind::Cargo => "cookbook_cargo", + BuildKind::Configure => "cookbook_configure", + BuildKind::Custom { script } => script + }; - # Strip binaries - if [ -d "${COOKBOOK_STAGE}/bin" ] - then - find "${COOKBOOK_STAGE}/bin" -type f -exec "${TARGET}-strip" -v {} ';' - fi + let command = { + let mut command = Command::new("redoxer"); + command.arg("env"); + command.arg("bash").arg("-ex"); - # Remove libtool files - if [ -d "${COOKBOOK_STAGE}/lib" ] - then - find "${COOKBOOK_STAGE}/lib" -type f -name '*.la' -exec rm -fv {} ';' - fi - "#.as_bytes())?; - }, - BuildKind::Custom { script } => { - let mut command = Command::new("redoxer"); - command.arg("env"); - command.arg("bash").arg("-ex"); - //TODO: remove unwraps - command.env("COOKBOOK_STAGE", &stage_dir_tmp.canonicalize().unwrap()); - command.env("COOKBOOK_SOURCE", &source_dir.canonicalize().unwrap()); - command.env("COOKBOOK_SYSROOT", &sysroot_dir.canonicalize().unwrap()); - command.current_dir(&build_dir); - run_command_stdin(command, script.as_bytes())?; - }, - } + //TODO: remove unwraps + let cookbook_build = build_dir.canonicalize().unwrap(); + let cookbook_recipe = recipe_dir.canonicalize().unwrap(); + let cookbook_stage = stage_dir_tmp.canonicalize().unwrap(); + let cookbook_source = source_dir.canonicalize().unwrap(); + let cookbook_sysroot = sysroot_dir.canonicalize().unwrap(); + command.current_dir(&cookbook_build); + command.env("COOKBOOK_BUILD", &cookbook_build); + command.env("COOKBOOK_RECIPE", &cookbook_recipe); + command.env("COOKBOOK_STAGE", &cookbook_stage); + command.env("COOKBOOK_SOURCE", &cookbook_source); + command.env("COOKBOOK_SYSROOT", &cookbook_sysroot); + command + }; + + let full_script = format!("{}\n{}\n{}", pre_script, script, post_script); + run_command_stdin(command, full_script.as_bytes())?; // Move stage.tmp to stage atomically rename(&stage_dir_tmp, &stage_dir)?; From b2a60668713ceb97400997a39eea9af51e718365 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 11:14:24 -0600 Subject: [PATCH 12/45] Simplify recipes --- recipes/acid/recipe.toml | 1 - recipes/ion/recipe.toml | 1 - recipes/libxml2/recipe.toml | 24 +++--------------------- recipes/xz/recipe.toml | 25 +++++++++++++------------ recipes/zlib/recipe.toml | 6 +++--- 5 files changed, 19 insertions(+), 38 deletions(-) diff --git a/recipes/acid/recipe.toml b/recipes/acid/recipe.toml index 2c63247f6..1f1262905 100644 --- a/recipes/acid/recipe.toml +++ b/recipes/acid/recipe.toml @@ -1,6 +1,5 @@ [source] git = "https://gitlab.redox-os.org/redox-os/acid.git" -branch = "master" [build] template = "cargo" diff --git a/recipes/ion/recipe.toml b/recipes/ion/recipe.toml index 5ac9d4520..80c82e33e 100644 --- a/recipes/ion/recipe.toml +++ b/recipes/ion/recipe.toml @@ -1,6 +1,5 @@ [source] git = "https://gitlab.redox-os.org/redox-os/ion.git" -branch = "master" [build] template = "cargo" diff --git a/recipes/libxml2/recipe.toml b/recipes/libxml2/recipe.toml index befedf226..d99963e22 100644 --- a/recipes/libxml2/recipe.toml +++ b/recipes/libxml2/recipe.toml @@ -8,26 +8,8 @@ dependencies = [ "zlib" ] script = """ -export CFLAGS="-I'${COOKBOOK_SYSROOT}/include'" -export LDFLAGS="-L'${COOKBOOK_SYSROOT}/lib' --static" -"${COOKBOOK_SOURCE}/configure" \ - --host="${TARGET}" \ - --prefix="" \ - --disable-shared \ - --enable-static \ +COOKBOOK_CONFIGURE_FLAGS+=( --without-python -make -j "$(nproc)" -make install DESTDIR="${COOKBOOK_STAGE}" - -# Strip binaries -if [ -d "${COOKBOOK_STAGE}/bin" ] -then - find "${COOKBOOK_STAGE}/bin" -type f -exec "${TARGET}-strip" -v {} ';' -fi - -# Remove libtool files -if [ -d "${COOKBOOK_STAGE}/lib" ] -then - find "${COOKBOOK_STAGE}/lib" -type f -name '*.la' -exec rm -fv {} ';' -fi +) +cookbook_configure """ diff --git a/recipes/xz/recipe.toml b/recipes/xz/recipe.toml index 8130662d8..6180ff10b 100644 --- a/recipes/xz/recipe.toml +++ b/recipes/xz/recipe.toml @@ -18,17 +18,18 @@ chmod +w build-aux/config.sub wget -O build-aux/config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub export CFLAGS="-static" -"./configure" \ - --host="${TARGET}" \ - --prefix="" \ - --disable-lzmadec \ - --disable-lzmainfo \ - --disable-xz \ - --disable-xzdec \ - --enable-shared=no \ - --enable-static=yes \ - --enable-threads=no \ +COOKBOOK_CONFIGURE="./configure" +COOKBOOK_CONFIGURE_FLAGS=( + --host="${TARGET}" + --prefix="" + --disable-lzmadec + --disable-lzmainfo + --disable-xz + --disable-xzdec + --enable-shared=no + --enable-static=yes + --enable-threads=no --with-pic=no -make -j "$(nproc)" -make install DESTDIR="${COOKBOOK_STAGE}" +) +cookbook_configure """ diff --git a/recipes/zlib/recipe.toml b/recipes/zlib/recipe.toml index 178a62eda..11b97874f 100644 --- a/recipes/zlib/recipe.toml +++ b/recipes/zlib/recipe.toml @@ -6,9 +6,9 @@ template = "custom" script = """ export LDFLAGS="--static" # See https://stackoverflow.com/questions/21396988/zlib-build-not-configuring-properly-with-cross-compiler-ignores-ar. - CHOST="${TARGET}" "${COOKBOOK_SOURCE}/configure" \ + CHOST="${TARGET}" "${COOKBOOK_CONFIGURE}" \ --prefix="" \ --static - make -j "$(nproc)" - make install DESTDIR="${COOKBOOK_STAGE}" + "${COOKBOOK_MAKE}" -j "$(nproc)" + "${COOKBOOK_MAKE}" install DESTDIR="${COOKBOOK_STAGE}" """ From 2ea2a056ed24080eadb894ee07ad44f16b9ee7ba Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 11:16:58 -0600 Subject: [PATCH 13/45] Add more cargo recipes --- recipes/audiod/recipe.toml | 5 +++++ recipes/contain/recipe.toml | 5 +++++ recipes/coreutils/recipe.toml | 5 +++++ recipes/extrautils/recipe.toml | 8 ++++++++ recipes/init/recipe.toml | 5 +++++ 5 files changed, 28 insertions(+) create mode 100644 recipes/audiod/recipe.toml create mode 100644 recipes/contain/recipe.toml create mode 100644 recipes/coreutils/recipe.toml create mode 100644 recipes/extrautils/recipe.toml create mode 100644 recipes/init/recipe.toml diff --git a/recipes/audiod/recipe.toml b/recipes/audiod/recipe.toml new file mode 100644 index 000000000..555fa9faf --- /dev/null +++ b/recipes/audiod/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/audiod.git" + +[build] +template = "cargo" diff --git a/recipes/contain/recipe.toml b/recipes/contain/recipe.toml new file mode 100644 index 000000000..06edc8a65 --- /dev/null +++ b/recipes/contain/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/contain.git" + +[build] +template = "cargo" diff --git a/recipes/coreutils/recipe.toml b/recipes/coreutils/recipe.toml new file mode 100644 index 000000000..e17994e44 --- /dev/null +++ b/recipes/coreutils/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/coreutils.git" + +[build] +template = "cargo" diff --git a/recipes/extrautils/recipe.toml b/recipes/extrautils/recipe.toml new file mode 100644 index 000000000..82a72f0dd --- /dev/null +++ b/recipes/extrautils/recipe.toml @@ -0,0 +1,8 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/extrautils.git" + +[build] +template = "cargo" +dependencies = [ + "xz" +] diff --git a/recipes/init/recipe.toml b/recipes/init/recipe.toml new file mode 100644 index 000000000..2c8fdea17 --- /dev/null +++ b/recipes/init/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/init.git" + +[build] +template = "cargo" From 94d85accd33aa7e5c90446a9ff87e168b080df2d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 11:40:08 -0600 Subject: [PATCH 14/45] Add optional script to transform source after patches, add more recipes --- recipes/bootloader/recipe.toml | 14 ++++++++++++++ recipes/drivers/recipe.toml | 27 +++++++++++++++++++++++++++ recipes/libiconv/recipe.toml | 14 ++++++++++++++ recipes/libjpeg/recipe.toml | 5 +++++ recipes/liborbital/recipe.toml | 10 ++++++++++ recipes/libsodium/recipe.toml | 9 +++++++++ recipes/xz/recipe.toml | 14 +++++--------- src/bin/cook.rs | 10 +++++++++- src/recipe.rs | 3 +++ 9 files changed, 96 insertions(+), 10 deletions(-) create mode 100644 recipes/bootloader/recipe.toml create mode 100644 recipes/drivers/recipe.toml create mode 100644 recipes/libiconv/recipe.toml create mode 100644 recipes/libjpeg/recipe.toml create mode 100644 recipes/liborbital/recipe.toml create mode 100644 recipes/libsodium/recipe.toml diff --git a/recipes/bootloader/recipe.toml b/recipes/bootloader/recipe.toml new file mode 100644 index 000000000..dacd541c2 --- /dev/null +++ b/recipes/bootloader/recipe.toml @@ -0,0 +1,14 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/bootloader.git" + +[build] +template = "custom" +script = """ +ARCH="$(echo "${TARGET}" | cut -d - -f1)" +nasm \ + -f bin \ + -o "${COOKBOOK_STAGE}/bootloader" \ + -D "ARCH_${ARCH}" \ + -i"${COOKBOOK_SOURCE}/${ARCH}/" \ + "${COOKBOOK_SOURCE}/${ARCH}/disk.asm" +""" diff --git a/recipes/drivers/recipe.toml b/recipes/drivers/recipe.toml new file mode 100644 index 000000000..fdb437697 --- /dev/null +++ b/recipes/drivers/recipe.toml @@ -0,0 +1,27 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/drivers.git" + +[build] +template = "custom" +script = """ +redoxer build --release \ + --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \ + --workspace + +mkdir -pv "${COOKBOOK_STAGE}/bin" +find "target/${TARGET}/release" \ + -maxdepth 1 \ + -executable \ + -type f \ + -exec cp -v {} "${COOKBOOK_STAGE}/bin/" ';' + +mkdir -pv "${COOKBOOK_STAGE}/etc/pcid" +cp -v "${COOKBOOK_SOURCE}/initfs.toml" "${COOKBOOK_STAGE}/etc/pcid/initfs.toml" + +mkdir -pv "${COOKBOOK_STAGE}/etc/pcid.d" +find "${COOKBOOK_SOURCE}" -maxdepth 2 -type f -name 'config.toml' | while read conf +do + driver="$(basename "$(dirname "$conf")")" + cp -v "$conf" "${COOKBOOK_STAGE}/etc/pcid.d/$driver.toml" +done +""" diff --git a/recipes/libiconv/recipe.toml b/recipes/libiconv/recipe.toml new file mode 100644 index 000000000..5ab4337a1 --- /dev/null +++ b/recipes/libiconv/recipe.toml @@ -0,0 +1,14 @@ +[source] +tar = "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz" +patches = [ + "01_redox.patch" +] + +[build] +template = "custom" +script = """ +COOKBOOK_CONFIGURE_FLAGS+=( + ac_cv_have_decl_program_invocation_name=no +) +cookbook_configure +""" diff --git a/recipes/libjpeg/recipe.toml b/recipes/libjpeg/recipe.toml new file mode 100644 index 000000000..47859e1d2 --- /dev/null +++ b/recipes/libjpeg/recipe.toml @@ -0,0 +1,5 @@ +[source] +tar = "http://ijg.org/files/jpegsrc.v9c.tar.gz" + +[build] +template = "configure" diff --git a/recipes/liborbital/recipe.toml b/recipes/liborbital/recipe.toml new file mode 100644 index 000000000..cbbe41c9d --- /dev/null +++ b/recipes/liborbital/recipe.toml @@ -0,0 +1,10 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/liborbital.git" + +[build] +template = "custom" +script = """ +rsync -av --delete "${COOKBOOK_SOURCE}/" ./ +"${COOKBOOK_CARGO}" build --release +"${COOKBOOK_MAKE}" install HOST="${TARGET}" DESTDIR="${COOKBOOK_STAGE}" +""" diff --git a/recipes/libsodium/recipe.toml b/recipes/libsodium/recipe.toml new file mode 100644 index 000000000..cd4ed4937 --- /dev/null +++ b/recipes/libsodium/recipe.toml @@ -0,0 +1,9 @@ +[source] +tar = "https://github.com/jedisct1/libsodium/archive/1.0.16.tar.gz" +patches = [ + "random.patch" +] +script = "./autogen.sh" + +[build] +template = "configure" diff --git a/recipes/xz/recipe.toml b/recipes/xz/recipe.toml index 6180ff10b..3c19525af 100644 --- a/recipes/xz/recipe.toml +++ b/recipes/xz/recipe.toml @@ -5,20 +5,16 @@ patches = [ "02-o_noctty.patch", "03-no-signals.patch" ] +script = """ +./autogen.sh +chmod +w build-aux/config.sub +wget -O build-aux/config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub +""" [build] template = "custom" script = """ -#TODO: simpler recipe -rsync -av --delete "${COOKBOOK_SOURCE}/" ./ - -./autogen.sh - -chmod +w build-aux/config.sub -wget -O build-aux/config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub - export CFLAGS="-static" -COOKBOOK_CONFIGURE="./configure" COOKBOOK_CONFIGURE_FLAGS=( --host="${TARGET}" --prefix="" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 43c188dd6..db2d2bdec 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -173,7 +173,7 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { command.arg("submodule").arg("update").arg("--init").arg("--recursive"); run_command(command)?; }, - SourceRecipe::Tar { tar, blake3, sha256, patches } => { + SourceRecipe::Tar { tar, blake3, sha256, patches, script } => { if ! source_dir.is_dir() { // Download tar //TODO: replace wget @@ -266,6 +266,14 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { run_command_stdin(command, patch.as_bytes())?; } + // Run source script + if let Some(script) = script { + let mut command = Command::new("bash"); + command.arg("-ex"); + command.current_dir(&source_dir_tmp); + run_command_stdin(command, script.as_bytes())?; + } + // Move source.tmp to source atomically rename(&source_dir_tmp, &source_dir)?; } diff --git a/src/recipe.rs b/src/recipe.rs index 7385076bf..972029243 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -29,6 +29,8 @@ pub enum SourceRecipe { /// A list of patch files to apply to the source #[serde(default)] patches: Vec, + /// Optional script to run to prepare the source, such as ./autogen.sh + script: Option, }, } @@ -129,6 +131,7 @@ mod tests { blake3: None, sha256: Some("4f3fc6178a533d392064f14776b23c397ed4b9f48f5de297aba73b643f955c08".to_string()), patches: Vec::new(), + script: None, }, build: BuildRecipe { kind: BuildKind::Custom { From 28180c39ff31e029dd3791af10f43972c20e9067 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 12:02:16 -0600 Subject: [PATCH 15/45] Set CPPFLAGS, add more recipes --- recipes/libpng/recipe.toml | 13 +++++++++++++ recipes/libvorbis/recipe.toml | 9 +++++++++ recipes/logd/recipe.toml | 5 +++++ recipes/nasm/recipe.toml | 5 +++++ recipes/netstack/recipe.toml | 5 +++++ recipes/netutils/recipe.toml | 6 ++++++ recipes/nulld/recipe.toml | 5 +++++ recipes/pkgar/recipe.toml | 5 +++++ recipes/pkgutils/recipe.toml | 5 +++++ recipes/ptyd/recipe.toml | 5 +++++ recipes/ramfs/recipe.toml | 5 +++++ recipes/redoxerd/recipe.toml | 12 ++++++++++++ recipes/redoxfs/recipe.toml | 5 +++++ recipes/sed/recipe.toml | 5 +++++ recipes/shellstorm/recipe.toml | 5 +++++ recipes/smith/recipe.toml | 5 +++++ recipes/zerod/recipe.toml | 5 +++++ src/bin/cook.rs | 1 + 18 files changed, 106 insertions(+) create mode 100644 recipes/libpng/recipe.toml create mode 100644 recipes/libvorbis/recipe.toml create mode 100644 recipes/logd/recipe.toml create mode 100644 recipes/nasm/recipe.toml create mode 100644 recipes/netstack/recipe.toml create mode 100644 recipes/netutils/recipe.toml create mode 100644 recipes/nulld/recipe.toml create mode 100644 recipes/pkgar/recipe.toml create mode 100644 recipes/pkgutils/recipe.toml create mode 100644 recipes/ptyd/recipe.toml create mode 100644 recipes/ramfs/recipe.toml create mode 100644 recipes/redoxerd/recipe.toml create mode 100644 recipes/redoxfs/recipe.toml create mode 100644 recipes/sed/recipe.toml create mode 100644 recipes/shellstorm/recipe.toml create mode 100644 recipes/smith/recipe.toml create mode 100644 recipes/zerod/recipe.toml diff --git a/recipes/libpng/recipe.toml b/recipes/libpng/recipe.toml new file mode 100644 index 000000000..ed7b95f14 --- /dev/null +++ b/recipes/libpng/recipe.toml @@ -0,0 +1,13 @@ +[source] +tar = "https://github.com/glennrp/libpng/archive/v1.6.36.tar.gz" +script = """ +chmod +w config.sub +wget -O config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub +""" + + +[build] +template = "configure" +dependencies = [ + "zlib" +] diff --git a/recipes/libvorbis/recipe.toml b/recipes/libvorbis/recipe.toml new file mode 100644 index 000000000..47facfd66 --- /dev/null +++ b/recipes/libvorbis/recipe.toml @@ -0,0 +1,9 @@ +[source] +tar = "http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.6.tar.xz" +sha256 = "af00bb5a784e7c9e69f56823de4637c350643deedaf333d0fa86ecdba6fcb415" + +[build] +template = "configure" +dependencies = [ + "libogg" +] diff --git a/recipes/logd/recipe.toml b/recipes/logd/recipe.toml new file mode 100644 index 000000000..6e906f119 --- /dev/null +++ b/recipes/logd/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/logd.git" + +[build] +template = "cargo" diff --git a/recipes/nasm/recipe.toml b/recipes/nasm/recipe.toml new file mode 100644 index 000000000..384cd9e1f --- /dev/null +++ b/recipes/nasm/recipe.toml @@ -0,0 +1,5 @@ +[source] +tar = "http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz" + +[build] +template = "configure" diff --git a/recipes/netstack/recipe.toml b/recipes/netstack/recipe.toml new file mode 100644 index 000000000..c2a534a28 --- /dev/null +++ b/recipes/netstack/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/netstack.git" + +[build] +template = "cargo" diff --git a/recipes/netutils/recipe.toml b/recipes/netutils/recipe.toml new file mode 100644 index 000000000..e46f33a08 --- /dev/null +++ b/recipes/netutils/recipe.toml @@ -0,0 +1,6 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/netutils.git" +branch = "redox-unix" + +[build] +template = "cargo" diff --git a/recipes/nulld/recipe.toml b/recipes/nulld/recipe.toml new file mode 100644 index 000000000..f9c725468 --- /dev/null +++ b/recipes/nulld/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/nulld.git" + +[build] +template = "cargo" diff --git a/recipes/pkgar/recipe.toml b/recipes/pkgar/recipe.toml new file mode 100644 index 000000000..6770c627d --- /dev/null +++ b/recipes/pkgar/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/pkgar.git" + +[build] +template = "cargo" diff --git a/recipes/pkgutils/recipe.toml b/recipes/pkgutils/recipe.toml new file mode 100644 index 000000000..e222cb459 --- /dev/null +++ b/recipes/pkgutils/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/pkgutils.git" + +[build] +template = "cargo" diff --git a/recipes/ptyd/recipe.toml b/recipes/ptyd/recipe.toml new file mode 100644 index 000000000..6984bbd95 --- /dev/null +++ b/recipes/ptyd/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/ptyd.git" + +[build] +template = "cargo" diff --git a/recipes/ramfs/recipe.toml b/recipes/ramfs/recipe.toml new file mode 100644 index 000000000..dd8e751ee --- /dev/null +++ b/recipes/ramfs/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/ramfs.git" + +[build] +template = "cargo" diff --git a/recipes/redoxerd/recipe.toml b/recipes/redoxerd/recipe.toml new file mode 100644 index 000000000..16d4a5a7f --- /dev/null +++ b/recipes/redoxerd/recipe.toml @@ -0,0 +1,12 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/redoxer.git" + +[build] +template = "custom" +script = """ +COOKBOOK_CARGO_FLAGS=( + --path "${COOKBOOK_SOURCE}/daemon" + --root "${COOKBOOK_STAGE}" +) +cookbook_cargo +""" diff --git a/recipes/redoxfs/recipe.toml b/recipes/redoxfs/recipe.toml new file mode 100644 index 000000000..31fdb491e --- /dev/null +++ b/recipes/redoxfs/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/redoxfs.git" + +[build] +template = "cargo" diff --git a/recipes/sed/recipe.toml b/recipes/sed/recipe.toml new file mode 100644 index 000000000..37f5f2fb6 --- /dev/null +++ b/recipes/sed/recipe.toml @@ -0,0 +1,5 @@ +[source] +tar = "http://ftp.gnu.org/gnu/sed/sed-4.4.tar.xz" + +[build] +template = "configure" diff --git a/recipes/shellstorm/recipe.toml b/recipes/shellstorm/recipe.toml new file mode 100644 index 000000000..daa6d4d46 --- /dev/null +++ b/recipes/shellstorm/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/shellstorm.git" + +[build] +template = "cargo" diff --git a/recipes/smith/recipe.toml b/recipes/smith/recipe.toml new file mode 100644 index 000000000..fabc0dee4 --- /dev/null +++ b/recipes/smith/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/Smith.git" + +[build] +template = "cargo" diff --git a/recipes/zerod/recipe.toml b/recipes/zerod/recipe.toml new file mode 100644 index 000000000..4606caf43 --- /dev/null +++ b/recipes/zerod/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/zerod.git" + +[build] +template = "cargo" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index db2d2bdec..303579421 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -345,6 +345,7 @@ export CARGO_TARGET_DIR="${COOKBOOK_BUILD}/target" # This adds the sysroot includes for most C compilation #TODO: check paths for spaces! export CFLAGS="-I${COOKBOOK_SYSROOT}/include" +export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" # This adds the sysroot libraries and compiles binaries statically for most C compilation #TODO: check paths for spaces! From 5b47f0e63e4db728035654439b0fbd999a71e493 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 12:50:39 -0600 Subject: [PATCH 16/45] Hack repo to allow building with rust cook --- repo.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/repo.sh b/repo.sh index 5084f866b..a2792d0b9 100755 --- a/repo.sh +++ b/repo.sh @@ -22,6 +22,12 @@ fi for recipe in $recipes do + if [ -e "recipes/$recipe/recipe.toml" ] + then + cargo run --release -- "$recipe" + continue + fi + if [ ! -d "recipes/$recipe/source/" ] then echo -e "\033[01;38;5;155mrepo - fetching $recipe\033[0m" >&2 From 563398f5c129317b7bee6dab7580ffe2044afeb8 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 12:50:53 -0600 Subject: [PATCH 17/45] Add more recipes --- recipes/exampled/recipe.toml | 5 +++++ recipes/installer/recipe.toml | 5 +++++ recipes/ipcd/recipe.toml | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 recipes/exampled/recipe.toml create mode 100644 recipes/installer/recipe.toml create mode 100644 recipes/ipcd/recipe.toml diff --git a/recipes/exampled/recipe.toml b/recipes/exampled/recipe.toml new file mode 100644 index 000000000..e35bc734d --- /dev/null +++ b/recipes/exampled/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/exampled.git" + +[build] +template = "cargo" diff --git a/recipes/installer/recipe.toml b/recipes/installer/recipe.toml new file mode 100644 index 000000000..023538211 --- /dev/null +++ b/recipes/installer/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/installer.git" + +[build] +template = "cargo" diff --git a/recipes/ipcd/recipe.toml b/recipes/ipcd/recipe.toml new file mode 100644 index 000000000..308574d29 --- /dev/null +++ b/recipes/ipcd/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/ipcd.git" + +[build] +template = "cargo" From 11777aef25c70ecd550d7c18eb70b479fbc6aad1 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 13:49:41 -0600 Subject: [PATCH 18/45] Remove patches --- .cargo/config | 15 ----------- .gitmodules | 62 +++---------------------------------------- patches/jobserver-rs | 1 - patches/mio | 1 - patches/net2-rs | 1 - patches/nix | 1 - patches/pb | 1 - patches/platform-info | 1 - patches/ring | 1 - patches/tar-rs | 1 - patches/termsize | 1 - patches/time | 1 - patches/tokio | 1 - 13 files changed, 4 insertions(+), 84 deletions(-) delete mode 160000 patches/jobserver-rs delete mode 160000 patches/mio delete mode 160000 patches/net2-rs delete mode 160000 patches/nix delete mode 160000 patches/pb delete mode 160000 patches/platform-info delete mode 160000 patches/ring delete mode 160000 patches/tar-rs delete mode 160000 patches/termsize delete mode 160000 patches/time delete mode 160000 patches/tokio diff --git a/.cargo/config b/.cargo/config index e2c90b5f2..69c4db47d 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,18 +1,3 @@ -paths = [ - "patches/jobserver-rs", - "patches/mio", - "patches/nix", - "patches/tokio/tokio", - "patches/tokio/tokio-reactor", - "patches/net2-rs", - "patches/pb", - "patches/platform-info", - "patches/ring", - "patches/tar-rs", - "patches/termsize", - "patches/time", -] - [target.aarch64-unknown-redox] linker = "aarch64-unknown-redox-gcc" rustflags = [] diff --git a/.gitmodules b/.gitmodules index cc1ec1f57..849ef0779 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,66 +1,12 @@ [submodule "docgen"] path = docgen url = https://gitlab.redox-os.org/redox-os/docgen.git -[submodule "pkgutils"] - path = pkgutils - url = https://gitlab.redox-os.org/redox-os/pkgutils.git branch = master -[submodule "patches/atty"] - path = patches/atty - url = https://gitlab.redox-os.org/redox-os/atty.git - branch = redox-unix -[submodule "patches/pb"] - path = patches/pb - url = https://gitlab.redox-os.org/redox-os/pb.git - branch = redox-unix -[submodule "patches/net2-rs"] - path = patches/net2-rs - url = https://gitlab.redox-os.org/redox-os/net2-rs.git - branch = redox-unix -[submodule "patches/ring"] - path = patches/ring - url = https://gitlab.redox-os.org/redox-os/ring.git - branch = redox-unix-0.13.5 -[submodule "patches/time"] - path = patches/time - url = https://gitlab.redox-os.org/redox-os/time.git - branch = redox-unix -[submodule "patches/termsize"] - path = patches/termsize - url = https://gitlab.redox-os.org/redox-os/termsize.git - branch = redox-unix -[submodule "patches/platform-info"] - path = patches/platform-info - url = https://gitlab.redox-os.org/redox-os/platform-info.git - branch = redox-unix -[submodule "patches/tar-rs"] - path = patches/tar-rs - url = https://gitlab.redox-os.org/redox-os/tar-rs.git - branch = redox-unix -[submodule "patches/liblibc"] - path = patches/liblibc - url = https://gitlab.redox-os.org/redox-os/liblibc.git - branch = redox-unix -[submodule "patches/mio"] - path = patches/mio - url = https://gitlab.redox-os.org/redox-os/mio.git - branch = redox-unix -[submodule "patches/tokio"] - path = patches/tokio - url = https://gitlab.redox-os.org/redox-os/tokio.git -[submodule "patches/libc"] - path = patches/libc - url = https://github.com/AdminXVII/libc - branch = extra-traits-redox -[submodule "patches/nix"] - path = patches/nix - url = https://github.com/AdminXVII/nix - branch = add-redox-support -[submodule "patches/jobserver-rs"] - path = patches/jobserver-rs - url = https://gitlab.redox-os.org/redox-os/jobserver-rs.git - branch = redox [submodule "pkgar"] path = pkgar url = https://gitlab.redox-os.org/redox-os/pkgar.git branch = master +[submodule "pkgutils"] + path = pkgutils + url = https://gitlab.redox-os.org/redox-os/pkgutils.git + branch = master diff --git a/patches/jobserver-rs b/patches/jobserver-rs deleted file mode 160000 index 54508e47f..000000000 --- a/patches/jobserver-rs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 54508e47f2349cbd0cef9fcf6e6f0cd4bd12d91d diff --git a/patches/mio b/patches/mio deleted file mode 160000 index c9a70849c..000000000 --- a/patches/mio +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c9a70849ced97387e2607c9c466d23b130ec8901 diff --git a/patches/net2-rs b/patches/net2-rs deleted file mode 160000 index be7b85598..000000000 --- a/patches/net2-rs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit be7b855982e63770753a81ffc4bedf66d7f66506 diff --git a/patches/nix b/patches/nix deleted file mode 160000 index 64b3ea0fb..000000000 --- a/patches/nix +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 64b3ea0fb108b9933766fd7e049e2c320636b972 diff --git a/patches/pb b/patches/pb deleted file mode 160000 index 743300cf9..000000000 --- a/patches/pb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 743300cf9566f77962a5b550db1ba27cc922b6a5 diff --git a/patches/platform-info b/patches/platform-info deleted file mode 160000 index ff3e9789a..000000000 --- a/patches/platform-info +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ff3e9789a7478d614a9e26d7016fe893ffea7713 diff --git a/patches/ring b/patches/ring deleted file mode 160000 index e10e9b891..000000000 --- a/patches/ring +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e10e9b891589b1d4bf5a5e83e999000734f04d68 diff --git a/patches/tar-rs b/patches/tar-rs deleted file mode 160000 index 5e19d818c..000000000 --- a/patches/tar-rs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5e19d818c3e67fe6215b8c244ec86d445ab4d515 diff --git a/patches/termsize b/patches/termsize deleted file mode 160000 index a63940dc8..000000000 --- a/patches/termsize +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a63940dc8608bb1a8c27a06302bd8674fd25f874 diff --git a/patches/time b/patches/time deleted file mode 160000 index 0c24c8c14..000000000 --- a/patches/time +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0c24c8c1483e17b4c7974c68dbb29d609d9c699b diff --git a/patches/tokio b/patches/tokio deleted file mode 160000 index 75f296e4b..000000000 --- a/patches/tokio +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 75f296e4b48f5d2966f2bd1cc6b04111a58bd4fd From 47d04ef7ac51ddcf24334547b0d3475b32e08208 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 13:50:19 -0600 Subject: [PATCH 19/45] Improve speed of repo.sh --- repo.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repo.sh b/repo.sh index a2792d0b9..b9e3e6b42 100755 --- a/repo.sh +++ b/repo.sh @@ -20,11 +20,13 @@ then recipes="$(ls -1 recipes)" fi +cargo build --release + for recipe in $recipes do if [ -e "recipes/$recipe/recipe.toml" ] then - cargo run --release -- "$recipe" + target/release/cook "$recipe" continue fi From 00e62b35f8e10bfdee3643b9fc2211beaa4f5bd8 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 14:24:58 -0600 Subject: [PATCH 20/45] Add findutils recipe --- recipes/findutils/recipe.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 recipes/findutils/recipe.toml diff --git a/recipes/findutils/recipe.toml b/recipes/findutils/recipe.toml new file mode 100644 index 000000000..65ec7db45 --- /dev/null +++ b/recipes/findutils/recipe.toml @@ -0,0 +1,11 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/findutils.git" + +[build] +template = "custom" +script = """ +COOKBOOK_CARGO_FLAGS+=( + --bin find +) +cookbook_cargo +""" From bc44cb9ef560f9ed0ee06f7c1ced4246127fca41 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 15:09:30 -0600 Subject: [PATCH 21/45] Add strace recipe --- recipes/strace/recipe.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 recipes/strace/recipe.toml diff --git a/recipes/strace/recipe.toml b/recipes/strace/recipe.toml new file mode 100644 index 000000000..e7c610041 --- /dev/null +++ b/recipes/strace/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/strace-redox.git" + +[build] +template = "cargo" From 09e1d9848d35d44b05768f8563f5b3eee2c65eb1 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 15:09:36 -0600 Subject: [PATCH 22/45] Update dependencies --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72a25cf97..a2ff97781 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -423,7 +423,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -457,7 +457,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -602,7 +602,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum sodalite 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67643084c740297bac275b1d97901ec27ca5984be4e8f75d86a33498e0e3e61c" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" -"checksum syn 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)" = "1425de3c33b0941002740a420b1a906a350b88d08b82b2c8a01035a3f9447bac" +"checksum syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)" = "95b5f192649e48a5302a13f2feb224df883b98933222369e4b3b0fe2a5447269" "checksum termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" From f2298c4de341b8f80fd55849091580d20d58c054 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 15:14:58 -0600 Subject: [PATCH 23/45] Add netdb recipe --- recipes/netdb/recipe.toml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 recipes/netdb/recipe.toml diff --git a/recipes/netdb/recipe.toml b/recipes/netdb/recipe.toml new file mode 100644 index 000000000..efff10a23 --- /dev/null +++ b/recipes/netdb/recipe.toml @@ -0,0 +1,8 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/netdb.git" + +[build] +template = "custom" +script = """ +cp -rv "${COOKBOOK_SOURCE}/"* "${COOKBOOK_STAGE}" +""" From 98521e6f69e7aaa6e2e405d6a8346f4889f43296 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 15:31:17 -0600 Subject: [PATCH 24/45] Add ca-certificates and orbdata recipe --- recipes/ca-certificates/make-ca.sh | 732 ---------------------------- recipes/ca-certificates/recipe.toml | 13 + recipes/orbdata/recipe.toml | 9 + 3 files changed, 22 insertions(+), 732 deletions(-) delete mode 100644 recipes/ca-certificates/make-ca.sh create mode 100644 recipes/ca-certificates/recipe.toml create mode 100644 recipes/orbdata/recipe.toml diff --git a/recipes/ca-certificates/make-ca.sh b/recipes/ca-certificates/make-ca.sh deleted file mode 100644 index 5150fc0ce..000000000 --- a/recipes/ca-certificates/make-ca.sh +++ /dev/null @@ -1,732 +0,0 @@ -#!/usr/bin/env bash -# Begin /usr/sbin/make-ca.sh -# -# Script to create OpenSSL certs directory, GnuTLS certificate bundle, NSS -# shared DB, and Java cacerts from upstream certdata.txt and local sources -# -# Authors: DJ Lucas -# Bruce Dubbs -# -# Changes: -# -# 20170425 - Use p11-kit format anchors -# - Add CKA_NSS_MOZILLA_CA_POLICY attribute for p11-kit anchors -# - Add clientAuth OpenSSL attribute and (currently unused) NSS -# CKA_TRUST_CLIENT_AUTH -# 20170119 - Show trust bits on local certs -# - Add version output for help2man -# 20161210 - Add note about --force swich when same version -# 20161126 - Add -D/--destdir switch -# 20161124 - Add -f/--force switch to bypass version check -# - Add multiple switches to allow for alternate localtions -# - Add help text -# 20161118 - Drop make-cert.pl script -# - Add support for Java and NSSDB - -# Set defaults -VERSION="20170425" -CERTDATA="certdata.txt" -PKIDIR="/etc/pki" -SSLDIR="/etc/ssl" -CERTUTIL="certutil" -KEYTOOL="keytool" -OPENSSL="openssl" -ANCHORDIR="${PKIDIR}/anchors" -CABUNDLE="${SSLDIR}/ca-bundle.crt" -CERTDIR="${SSLDIR}/certs" -KEYSTORE="${SSLDIR}/java/cacerts" -NSSDB="${PKIDIR}/nssdb" -LOCALDIR="${SSLDIR}/local" -DESTDIR="" - -# Some data in the certs have UTF-8 characters -export LANG=en_US.utf8 - -TEMPDIR=$(mktemp -d) -WORKDIR="${TEMPDIR}/work" -WITH_NSS=1 -WITH_JAVA=1 -FORCE=0 - -function get_args(){ - while test -n "${1}" ; do - case "${1}" in - -C | --certdata) - check_arg $1 $2 - CERTDATA="${2}" - shift 2 - ;; - -D | --destdir) - check_arg $1 $2 - DESTDIR="${2}" - shift 2 - ;; - -P | --pkidir) - check_arg $1 $2 - PKIDIR="${2}" - ANCHORDIR="${PKIDIR}/anchors" - NSSDB="${PKIDIR}/nssdb" - echo "${@}" | grep -e "-a " -e "--anchordir" \ - -e "-n " -e "--nssdb" > /dev/null - if test "${?}" == "0"; then - echo "Error! ${1} cannot be used with the -a/--anchordir or -n/--nssdb switches." - echo "" - exit 3 - fi - shift 2 - ;; - -S | --ssldir) - check_arg $1 $2 - SSLDIR="${2}" - CABUNDLE="${SSLDIR}/ca-bundle.crt" - CERTDIR="${SSLDIR}/certs" - KEYSTORE="${SSLDIR}/java/cacerts" - LOCALDIR="${SSLDIR}/local" - echo "${@}" | grep -e "-c " -e "--cafile" \ - -e "-d " -e "--cadir" \ - -e "-j " -e "--javacerts" > /dev/null - if test "${?}" == "0"; then - echo "Error! ${1} cannot be used with the -c/--cafile, -d/--cadir, or" - echo "-j/--javacerts switches." - echo "" - exit 3 - fi - - shift 2 - ;; - -a | --anchordir) - check_arg $1 $2 - ANCHORDIR="${2}" - echo "${@}" | grep -e "-P " -e "--pkidir" > /dev/null - if test "${?}" == "0"; then - echo "Error! ${1} cannot be used with the -P/--pkidir switch." - echo "" - exit 3 - fi - shift 2 - ;; - -c | --cafile) - check_arg $1 $2 - CABUNDLE="${2}" - echo "${@}" | grep -e "-S " -e "--ssldir" > /dev/null - if test "${?}" == "0"; then - echo "Error! ${1} cannot be used with the -S/--ssldir switch." - echo "" - exit 3 - fi - shift 2 - ;; - -d | --cadir) - check_arg $1 $2 - CADIR="${2}" - if test "${?}" == "0"; then - echo "Error! ${1} cannot be used with the -S/--ssldir switch." - echo "" - exit 3 - fi - shift 2 - ;; - -j | --javacerts) - check_arg $1 $2 - KEYSTORE="${2}" - if test "${?}" == "0"; then - echo "Error! ${1} cannot be used with the -S/--ssldir switch." - echo "" - exit 3 - fi - shift 2 - ;; - -l | --localdir) - check_arg $1 $2 - LOCALDIR="${2}" - shift 2 - ;; - -n | --nssdb) - check_arg $1 $2 - NSSDB="${2}" - echo "${@}" | grep -e "-P " -e "--pkidir" > /dev/null - if test "${?}" == "0"; then - echo "Error! ${1} cannot be used with the -P/--pkidir switch." - echo "" - exit 3 - fi - shift 2 - ;; - -k | --keytool) - check_arg $1 $2 - KEYTOOL="${2}" - shift 2 - ;; - -s | --openssl) - check_arg $1 $2 - OPENSSL="${2}" - shift 2 - ;; - -t | --certutil) - check_arg $1 $2 - CERTUTIL="${2}" - shift 2 - ;; - -f | --force) - FORCE="1" - shift 1 - ;; - -h | --help) - showhelp - exit 0 - ;; - -v | --version) - echo -e "$(basename ${0}) ${VERSION}\n" - exit 0 - ;; - *) - showhelp - exit 1 - ;; - esac - done -} - -function check_arg(){ - echo "${2}" | grep -v "^-" > /dev/null - if [ -z "$?" -o ! -n "$2" ]; then - echo "Error: $1 requires a valid argument." - exit 1 - fi -} - -function showhelp(){ - echo "" - echo "`basename ${0}` converts certdata.txt (provided by the Mozilla Foundation)" - echo "into a complete PKI distribution for use with LFS or like distributions." - echo "" - echo " -C --certdata The certdata.txt file (provided by Mozilla)" - echo " Default: ./certdata.txt" - echo "" - echo " -D --destdir Change the output directory and use relative" - echo " paths for all other values." - echo " Default: unset" - echo "" - echo " -P --pkidir The output PKI directory - Cannot be used with" - echo " the -a/--anchordir or -n/--nssdb switches" - echo " Default: /etc/pki" - echo "" - echo " -S --ssldir The output SSL root direcotry - Cannot be used" - echo " with the -c/--cafile, -d/--cadir, or" - echo " -j/--javacerts switches" - echo " Defualt: /etc/ssl" - echo "" - echo " -a --anchordir The output directory for OpenSSL trusted" - echo " CA certificates used as trust anchors." - echo " Default: \$PKIDIR/anchors" - echo "" - echo " -c --cafile The output filename for the PEM formated bundle" - echo " Default: \$SSLDIR/ca-bundle.crt" - echo "" - echo " -d --cadir The output directory for the OpenSSL trusted" - echo " CA certificates" - echo " Deault: \$SSLDIR/certs/" - echo "" - echo " -j --javacerts The output path for the Java cacerts file" - echo " Default: \$SSLDIR/java/cacerts" - echo "" - echo " -l --localdir The path to a local set of OpenSSL trusted" - echo " certificates to include in the output" - echo " Default: \$SSLDIR/local" - echo "" - echo " -n --nssdb The output path for the shared NSS DB" - echo " Default: \$PKIDIR/nssdb" - echo "" - echo " -k --keytool The path to the java keytool utility" - echo "" - echo " -s --openssl The path to the openssl utility" - echo "" - echo " -t --certutil The path the certutil utility" - echo "" - echo " -f --force Force run, even if source is not newer" - echo "" - echo " -h --help Show this help message and exit" - echo "" - echo " -v --version Show version information and exit" - echo "" - echo "Example: `basename ${0}` -f -C ~/certdata.txt" - echo "" -} - -# Convert CKA_TRUST values to trust flags for certutil -function convert_trust(){ - case $1 in - CKT_NSS_TRUSTED_DELEGATOR) - echo "C" - ;; - CKT_NSS_NOT_TRUSTED) - echo "p" - ;; - CKT_NSS_MUST_VERIFY_TRUST) - echo "" - ;; - esac -} - -function convert_trust_arg(){ - case $1 in - C) - case $2 in - sa) - echo "-addtrust serverAuth" - ;; - sm) - echo "-addtrust emailProtection" - ;; - cs) - echo "-addtrust codeSigning" - ;; - ca) - echo "-addtrust clientAuth" - ;; - esac - ;; - p) - case $2 in - sa) - echo "-addreject serverAuth" - ;; - sm) - echo "-addreject emailProtection" - ;; - cs) - echo "-addreject codeSigning" - ;; - ca) - echo "-addreject clientAuth" - ;; - esac - ;; - *) - echo "" - ;; - esac -} - -# Define p11-kit ext value constants (see p11-kit API documentation) -get-p11-val() { - case $1 in - p11sasmcs) - p11value="0%2a%06%03U%1d%25%01%01%ff%04 0%1e%06%08%2b%06%01%05%05%07%03%04%06%08%2b%06%01%05%05%07%03%01%06%08%2b%06%01%05%05%07%03%03" - ;; - - p11sasm) - p11value="0 %06%03U%1d%25%01%01%ff%04%160%14%06%08%2b%06%01%05%05%07%03%04%06%08%2b%06%01%05%05%07%03%01" - ;; - - p11sacs) - p11value="0 %06%03U%1d%25%01%01%ff%04%160%14%06%08%2b%06%01%05%05%07%03%01%06%08%2b%06%01%05%05%07%03%03" - ;; - - p11sa) - p11value="0%16%06%03U%1d%25%01%01%ff%04%0c0%0a%06%08%2b%06%01%05%05%07%03%01" - ;; - - p11smcs) - p11value="0 %06%03U%1d%25%01%01%ff%04%160%14%06%08%2b%06%01%05%05%07%03%04%06%08%2b%06%01%05%05%07%03%03" - ;; - - p11sm) - p11value="0%16%06%03U%1d%25%01%01%ff%04%0c0%0a%06%08%2b%06%01%05%05%07%03%04" - ;; - - p11cs) - p11value="0%16%06%03U%1d%25%01%01%ff%04%0c0%0a%06%08%2b%06%01%05%05%07%03%03" - ;; - - p11) - p11value="0%18%06%03U%1d%25%01%01%ff%04%0e0%0c%06%0a%2b%06%01%04%01%99w%06%0a%10" - ;; - esac -} - -# Process command line arguments -get_args $@ - -if test ! -r "${CERTDATA}"; then - echo "${CERTDATA} was not found. The certdata.txt file must be in the local" - echo "directory, or speficied with the --certdata switch." - exit 1 -fi - -test -f "${CERTUTIL}" || WITH_NSS=0 -test -f "${KEYTOOL}" || WITH_JAVA=0 - -VERSION=$(grep CVS_ID "${CERTDATA}" | cut -d " " -f 8) - -if test "${VERSION}x" == "x"; then - echo "WARNING! ${CERTDATA} has no 'Revision' in CVS_ID" - echo "Will run conversion unconditionally." - sleep 2 - VERSION="$(date -u +%Y%m%d-%H%M)" -else - if test "${FORCE}" == "1"; then - echo "Output forced. Will run conversion unconditionally." - sleep 2 - elif test "${DESTDIR}x" == "x"; then - test -f "${CABUNDLE}" && - OLDVERSION=$(grep "^VERSION:" "${CABUNDLE}" | cut -d ":" -f 2) - fi -fi - -if test "${OLDVERSION}x" == "${VERSION}x"; then - echo "No update required! Use --force to update anyway." - exit 0 -fi - -mkdir -p "${TEMPDIR}"/{certs,ssl/{certs,java},pki/{nssdb,anchors},work} -cp "${CERTDATA}" "${WORKDIR}/certdata.txt" -pushd "${WORKDIR}" > /dev/null - -if test "${WITH_NSS}" == "1"; then - # Create a blank NSS DB - "${CERTUTIL}" -N --empty-password -d "sql:${TEMPDIR}/pki/nssdb" -fi - -# Get a list of starting lines for each cert -CERTBEGINLIST=`grep -n "^# Certificate" "${WORKDIR}/certdata.txt" | \ - cut -d ":" -f1` - -# Dump individual certs to temp file -for certbegin in ${CERTBEGINLIST}; do - awk "NR==$certbegin,/^CKA_TRUST_STEP_UP_APPROVED/" "${WORKDIR}/certdata.txt" \ - > "${TEMPDIR}/certs/${certbegin}.tmp" -done - -unset CERTBEGINLIST certbegin - -for tempfile in ${TEMPDIR}/certs/*.tmp; do - # Get a name for the cert - certname="$(grep "^# Certificate" "${tempfile}" | cut -d '"' -f 2)" - - # Determine certificate trust values for SSL/TLS, S/MIME, and Code Signing - satrust="$(convert_trust `grep '^CKA_TRUST_SERVER_AUTH' ${tempfile} | \ - cut -d " " -f 3`)" - smtrust="$(convert_trust `grep '^CKA_TRUST_EMAIL_PROTECTION' ${tempfile} | \ - cut -d " " -f 3`)" - cstrust="$(convert_trust `grep '^CKA_TRUST_CODE_SIGNING' ${tempfile} | \ - cut -d " " -f 3`)" - # Not currently included in NSS certdata.txt - #catrust="$(convert_trust `grep '^CKA_TRUST_CLIENT_AUTH' ${tempfile} | \ - # cut -d " " -f 3`)" - - # Get args for OpenSSL trust settings - saarg="$(convert_trust_arg "${satrust}" sa)" - smarg="$(convert_trust_arg "${smtrust}" sm)" - csarg="$(convert_trust_arg "${cstrust}" cs)" - # Not currently included in NSS certdata.txt - #caarg="$(convert_trust_arg "${catrust}" ca)" - - # Convert to a PEM formated certificate - printf $(awk '/^CKA_VALUE/{flag=1;next}/^END/{flag=0}flag{printf $0}' \ - "${tempfile}") | "${OPENSSL}" x509 -text -inform DER -fingerprint \ - > tempfile.crt - - # Get individual values for certificates - certkey="$(${OPENSSL} x509 -in tempfile.crt -noout -pubkey)" - certcer="$(${OPENSSL} x509 -in tempfile.crt)" - certtxt="$(${OPENSSL} x509 -in tempfile.crt -noout -text)" - - # Get p11-kit label, oid, and values - p11label="$(grep -m1 "Issuer" ${tempfile} | grep -o CN=.*$ | \ - cut -d ',' -f 1 | sed 's@CN=@@')" - - # if distrusted at all, x-distrusted - if test "${satrust}" == "p" -o "${smtrust}" == "p" -o "${cstrust}" == "p" - then - # if any distrusted, x-distrusted - p11trust="x-distrusted: true" - p11oid="1.3.6.1.4.1.3319.6.10.1" - p11value="0.%06%0a%2b%06%01%04%01%99w%06%0a%01%04 0%1e%06%08%2b%06%01%05%05%07%03%04%06%08%2b%06%01%05%05%07%03%01%06%08%2b%06%01%05%05%07%03%03" - else - p11trust="trusted: true" - p11oid="2.5.29.37" - trustp11="p11" - if test "${satrust}" == "C"; then - trustp11="${trustp11}sa" - fi - if test "${smtrust}" == "C"; then - trustp11="${trustp11}sm" - fi - if test "${cstrust}" == "C"; then - trustp11="${trustp11}cs" - fi - get-p11-val "${trustp11}" - fi - - # Get a hash for the cert - keyhash=$("${OPENSSL}" x509 -noout -in tempfile.crt -hash) - - # Print information about cert - echo "Certificate: ${certname}" - echo "Keyhash: ${keyhash}" - - # Place certificate into trust anchors dir - anchorfile="${TEMPDIR}/pki/anchors/${keyhash}.pem" - echo "[p11-kit-object-v1]" >> "${anchorfile}" - echo "label: \"${p11label}\"" >> "${anchorfile}" - echo "class: x-certificate-extension" >> "${anchorfile}" - echo "object-id: ${p11oid}" >> "${anchorfile}" - echo "value: \"${p11value}\"" >> "${anchorfile}" - echo "modifiable: false" >> "${anchorfile}" - echo "${certkey}" >> "${anchorfile}" - echo "" >> "${anchorfile}" - echo "[p11-kit-object-v1]" >> "${anchorfile}" - echo "label: \"${p11label}\"" >> "${anchorfile}" - echo "${p11trust}" >> "${anchorfile}" - echo "nss-mozilla-ca-policy: true" >> "${anchorfile}" - echo "modifiable: false" >> "${anchorfile}" - echo "${certcer}" >> "${anchorfile}" - echo "${certtxt}" | sed 's@^@#@' >> "${anchorfile}" - echo "Added to p11-kit anchor directory with trust '${satrust},${smtrust},${cstrust}'." - - - # Import certificates trusted for SSL/TLS into the Java keystore and - # GnuTLS certificate bundle - if test "${satrust}x" == "Cx"; then - # Java keystore - if test "${WITH_JAVA}" == "1"; then - "${KEYTOOL}" -import -noprompt -alias "${certname}" \ - -keystore "${TEMPDIR}/ssl/java/cacerts" \ - -storepass 'changeit' -file tempfile.crt \ - 2>&1> /dev/null | \ - sed -e 's@Certificate was a@A@' -e 's@keystore@Java keystore.@' - fi - - # GnuTLS certificate bundle - cat tempfile.crt >> "${TEMPDIR}/ssl/ca-bundle.crt.tmp" - echo "Added to GnuTLS ceritificate bundle." - fi - - # Import certificate into the temporary certificate directory with - # trust arguments - "${OPENSSL}" x509 -in tempfile.crt -text -fingerprint \ - -setalias "${certname}" ${saarg} ${smarg} ${csarg} \ - > "${TEMPDIR}/ssl/certs/${keyhash}.pem" - echo "Added to OpenSSL certificate directory with trust '${satrust},${smtrust},${cstrust}'." - - # Import all certificates with trust args to the temporary NSS DB - if test "${WITH_NSS}" == "1"; then - "${CERTUTIL}" -d "sql:${TEMPDIR}/pki/nssdb" -A \ - -t "${satrust},${smtrust},${cstrust}" \ - -n "${certname}" -i tempfile.crt - echo "Added to NSS shared DB with trust '${satrust},${smtrust},${cstrust}'." - fi - - # Clean up the directory and environment as we go - rm -f tempfile.crt - unset keyhash subject certname - unset satrust smtrust cstrust catrust sarg smarg csarg caarg - unset p11trust p11oid p11value trustp11 certkey certcer certtxt - echo -e "\n" -done -unset tempfile - -# Sanity check -count=$(ls "${TEMPDIR}"/ssl/certs/*.pem | wc -l) -# Historically there have been between 152 and 165 certs -# A minimum of 140 should be safe for a rudimentry sanity check -if test "${count}" -lt "140" ; then - echo "Error! Only ${count} certificates were generated!" - echo "Exiting without update!" - echo "" - echo "${TEMPDIR} is the temporary working directory" - exit 2 -fi -unset count - -# Generate the bundle -bundlefile=`basename "${CABUNDLE}"` -bundledir=`echo "${CABUNDLE}" | sed "s@/${bundlefile}@@"` -install -vdm755 "${DESTDIR}${bundledir}" 2>&1>/dev/null -test -f "${DESTDIR}${CABUNDLE}" && mv "${DESTDIR}${CABUNDLE}" \ - "${DESTDIR}${CABUNDLE}.old" -echo "VERSION:${VERSION}" > "${DESTDIR}${CABUNDLE}" -cat "${TEMPDIR}/ssl/ca-bundle.crt.tmp" >> "${DESTDIR}${CABUNDLE}" && -rm -f "${DESTDIR}${CABUNDLE}.old" -unset bundlefile bundledir - -# Install Java Cacerts -if test "${WITH_JAVA}" == "1"; then - javafile=`basename "${KEYSTORE}"` - javadir=`echo "${KEYSTORE}" | sed "s@/${javafile}@@"` - install -vdm755 "${DESTDIR}${javadir}" 2>&1>/dev/null - test -f "${DESTDIR}${KEYSTORE}" && mv "${DESTDIR}${KEYSTORE}" \ - "${DESTDIR}${KEYSTORE}.old" - install -m644 "${TEMPDIR}/ssl/java/cacerts" "${DESTDIR}${KEYSTORE}" && - rm -f "${DESTDIR}${KEYSTORE}.old" - unset javafile javadir -fi - -# Install NSS Shared DB -if test "${WITH_NSS}" == "1"; then - sed -e "s@${TEMPDIR}/pki/nssdb@${NSSDB}@" \ - -e 's/library=/library=libnsssysinit.so/' \ - -e 's/Flags=internal/Flags=internal,moduleDBOnly/' \ - -i "${TEMPDIR}/pki/nssdb/pkcs11.txt" - test -d "${DESTDIR}${NSSDB}" && mv "${DESTDIR}${NSSDB}" \ - "${DESTDIR}${NSSDB}.old" - install -dm755 "${DESTDIR}${NSSDB}" 2>&1>/dev/null - install -m644 "${TEMPDIR}"/pki/nssdb/{cert9.db,key4.db,pkcs11.txt} \ - "${DESTDIR}${NSSDB}" && - rm -rf "${DESTDIR}${NSSDB}.old" -fi - -# Install anchors in $ANCHORDIR -test -d "${DESTDIR}${ANCHORDIR}" && mv "${DESTDIR}${ANCHORDIR}"\ - "${DESTDIR}${ANCHORDIR}.old" -install -dm755 "${DESTDIR}${ANCHORDIR}" 2>&1>/dev/null -install -m644 "${TEMPDIR}"/pki/anchors/*.pem "${DESTDIR}${ANCHORDIR}" && -rm -rf "${DESTDIR}${ANCHORDIR}.old" - -# Install certificates in $CERTDIR -test -d "${DESTDIR}${CERTDIR}" && mv "${DESTDIR}${CERTDIR}" \ - "${DESTDIR}${CERTDIR}.old" -install -dm755 "${DESTDIR}${CERTDIR}" 2>&1>/dev/null -install -m644 "${TEMPDIR}"/ssl/certs/*.pem "${DESTDIR}${CERTDIR}" && -rm -rf "${DESTDIR}${CERTDIR}.old" - -# Import any certs in $LOCALDIR -# Don't do any checking, just trust the admin -if test -d "${LOCALDIR}"; then - for cert in `find "${LOCALDIR}" -name "*.pem"`; do - # Get some information about the certificate - keyhash=$("${OPENSSL}" x509 -noout -in "${cert}" -hash) - subject=$("${OPENSSL}" x509 -noout -in "${cert}" -subject) - count=1 - while test "${count}" -lt 10; do - echo "${subject}" | cut -d "/" -f "${count}" | grep "CN=" >/dev/null \ - && break - let count++ - done - certname=$(echo "${subject}" | cut -d "/" -f "${count}" | sed 's@CN=@@') - - echo "Certificate: ${certname}" - echo "Keyhash: ${keyhash}" - - # Get trust information - trustlist=$("${OPENSSL}" x509 -in "${cert}" -text -trustout | \ - grep -A1 "Trusted Uses") - satrust="" - smtrust="" - cstrust="" - catrust="" - satrust=$(echo "${trustlist}" | \ - grep "TLS Web Server" 2>&1> /dev/null && echo "C") - smtrust=$(echo "${trustlist}" | \ - grep "E-mail Protection" 2>&1 >/dev/null && echo "C") - cstrust=$(echo "${trustlist}" | \ - grep "Code Signing" 2>&1 >/dev/null && echo "C") - catrust=$(echo "${trustlist}" | \ - grep "Client Auth" 2>&1 >/dev/null && echo "C") - - # Get reject information - rejectlist=$("${OPENSSL}" x509 -in "${cert}" -text -trustout | \ - grep -A1 "Rejected Uses") - if test "${satrust}" == ""; then satrust=$(echo "${rejectlist}" | \ - grep "TLS Web Server" 2>&1> /dev/null && echo "p"); fi - if test "${smtrust}" == ""; then smtrust=$(echo "${rejectlist}" | \ - grep "E-mail Protection" 2>&1> /dev/null && echo "p"); fi - if test "${cstrust}" == ""; then cstrust=$(echo "${rejectlist}" | \ - grep "Code Signing" 2>&1> /dev/null && echo "p"); fi - if test "${catrust}" == ""; then catrust=$(echo "${rejectlist}" | \ - grep "Client Auth" 2>&1> /dev/null && echo "p"); fi - - - # Place certificate into trust anchors dir - p11label="$(grep -m1 "Issuer" ${cert} | grep -o CN=.*$ | \ - cut -d ',' -f 1 | sed 's@CN=@@')" - - # if distrusted at all, x-distrusted - if test "${satrust}" == "p" -o "${smtrust}" == "p" -o "${cstrust}" == "p" - then - # if any distrusted, x-distrusted - p11trust="x-distrusted: true" - p11oid="1.3.6.1.4.1.3319.6.10.1" - p11value="0.%06%0a%2b%06%01%04%01%99w%06%0a%01%04 0%1e%06%08%2b%06%01%05%05%07%03%04%06%08%2b%06%01%05%05%07%03%01%06%08%2b%06%01%05%05%07%03%03" - else - p11trust="trusted: true" - p11oid="2.5.29.37" - trustp11="p11" - if test "${satrust}" == "C"; then - trustp11="${trustp11}sa" - fi - if test "${smtrust}" == "C"; then - trustp11="${trustp11}sm" - fi - if test "${cstrust}" == "C"; then - trustp11="${trustp11}cs" - fi - get-p11-val "${trustp11}" - fi - - anchorfile="${DESTDIR}${ANCHORDIR}/${keyhash}.pem" - - echo "[p11-kit-object-v1]" >> "${anchorfile}" - echo "label: \"${p11label}\"" >> "${anchorfile}" - echo "class: x-certificate-extension" >> "${anchorfile}" - echo "object-id: ${p11oid}" >> "${anchorfile}" - echo "value: \"${p11value}\"" >> "${anchorfile}" - echo "modifiable: false" >> "${anchorfile}" - echo "${certkey}" >> "${anchorfile}" - echo "" >> "${anchorfile}" - echo "[p11-kit-object-v1]" >> "${anchorfile}" - echo "label: \"${p11label}\"" >> "${anchorfile}" - echo "${p11trust}" >> "${anchorfile}" - echo "modifiable: false" >> "${anchorfile}" - echo "${certcer}" >> "${anchorfile}" - echo "${certtxt}" | sed 's@^@#@' >> "${anchorfile}" - echo "Added to p11-kit anchor directory with trust '${satrust},${smtrust},${cstrust}'." - - # Install in Java keystore - if test "${WITH_JAVA}" == "1" -a "${satrust}x" == "Cx"; then - "${KEYTOOL}" -import -noprompt -alias "${certname}" \ - -keystore "${DESTDIR}${KEYSTORE}" \ - -storepass 'changeit' -file "${cert}" 2>&1> /dev/null | \ - sed -e 's@Certificate was a@A@' -e 's@keystore@Java keystore.@' - fi - - # Append to the bundle - source should have trust info, process with - # openssl x509 to strip - if test "${satrust}x" == "Cx"; then - "${OPENSSL}" x509 -in "${cert}" -text -fingerprint \ - >> "${DESTDIR}${CABUNDLE}" - echo "Added to GnuTLS certificate bundle." - fi - - # Install into OpenSSL certificate store - "${OPENSSL}" x509 -in "${cert}" -text -fingerprint \ - -setalias "${certname}" \ - >> "${DESTDIR}${CERTDIR}/${keyhash}.pem" - echo "Added to OpenSSL certificate directory with trust '${satrust},${smtrust},${cstrust},${catrust}'." - - # Add to Shared NSS DB - if test "${WITH_NSS}" == "1"; then - "${OPENSSL}" x509 -in "${cert}" -text -fingerprint | \ - "${CERTUTIL}" -d "sql:${DESTDIR}${NSSDB}" -A \ - -t "${satrust},${smtrust},${cstrust}" \ - -n "${certname}" - echo "Added to NSS shared DB with trust '${satrust},${smtrust},${cstrust}'." - fi - - unset keyhash subject count certname - unset trustlist rejectlist satrust smtrust cstrust catrust - unset p11trust p11oid p11value trustp11 certkey certcer certtxt - echo "" - - done - unset cert -fi - -c_rehash "${DESTDIR}${CERTDIR}" 2>&1>/dev/null -popd > /dev/null - -# Clean up the mess -rm -rf "${TEMPDIR}" - -# End /usr/sbin/make-ca.sh diff --git a/recipes/ca-certificates/recipe.toml b/recipes/ca-certificates/recipe.toml new file mode 100644 index 000000000..bff2aab4e --- /dev/null +++ b/recipes/ca-certificates/recipe.toml @@ -0,0 +1,13 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/ca-certificates.git" + +[build] +template = "custom" +script = """ +curl \ + -o certdata.txt \ + --time-cond certdata.txt \ + https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt +"${COOKBOOK_SOURCE}/make-ca.sh" -D "${COOKBOOK_BUILD}" +cp -rv "${COOKBOOK_BUILD}/etc/ssl/certs" "${COOKBOOK_STAGE}/ssl" +""" diff --git a/recipes/orbdata/recipe.toml b/recipes/orbdata/recipe.toml new file mode 100644 index 000000000..efe969adc --- /dev/null +++ b/recipes/orbdata/recipe.toml @@ -0,0 +1,9 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/orbdata.git" + +[build] +template = "custom" +script = """ +mkdir -pv "${COOKBOOK_STAGE}/ui" +cp -rv "${COOKBOOK_SOURCE}/"* "${COOKBOOK_STAGE}/ui" +""" From a8d2cc47e31719902ffe279236de7658c3ab66d6 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 15:36:59 -0600 Subject: [PATCH 25/45] Add orbterm recipe, fix missing repo dir --- recipes/orbterm/recipe.toml | 12 ++++++++++++ repo.sh | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 recipes/orbterm/recipe.toml diff --git a/recipes/orbterm/recipe.toml b/recipes/orbterm/recipe.toml new file mode 100644 index 000000000..0caa665dd --- /dev/null +++ b/recipes/orbterm/recipe.toml @@ -0,0 +1,12 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/orbterm.git" + +[build] +template = "custom" +script = """ +COOKBOOK_CARGO_FLAGS=( + --path "${COOKBOOK_SOURCE}" + --root "${COOKBOOK_STAGE}/ui" +) +cookbook_cargo +""" diff --git a/repo.sh b/repo.sh index b9e3e6b42..b661f0cda 100755 --- a/repo.sh +++ b/repo.sh @@ -82,6 +82,8 @@ do fi done +mkdir -p "$REPO" + for recipe in $recipes do if [ "recipes/$recipe/stage.tar.gz" -nt "$REPO/$recipe.tar.gz" ] From 88101b4a88a7264225d568bdf51e66c589028502 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 15:41:10 -0600 Subject: [PATCH 26/45] Add orbital recipe --- recipes/orbital/recipe.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 recipes/orbital/recipe.toml diff --git a/recipes/orbital/recipe.toml b/recipes/orbital/recipe.toml new file mode 100644 index 000000000..0ae660fd4 --- /dev/null +++ b/recipes/orbital/recipe.toml @@ -0,0 +1,10 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/orbital.git" + +[build] +template = "cargo" + +[package] +dependencies = [ + "orbdata" +] From b62f5a2fc52dc006f2cb6957a66c0c3c1d6763ad Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 15:44:28 -0600 Subject: [PATCH 27/45] Add orbutils recipe and add depends to orbterm recipe --- recipes/orbterm/recipe.toml | 5 +++++ recipes/orbutils/recipe.toml | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 recipes/orbutils/recipe.toml diff --git a/recipes/orbterm/recipe.toml b/recipes/orbterm/recipe.toml index 0caa665dd..16c3cdfb5 100644 --- a/recipes/orbterm/recipe.toml +++ b/recipes/orbterm/recipe.toml @@ -10,3 +10,8 @@ COOKBOOK_CARGO_FLAGS=( ) cookbook_cargo """ + +[package] +depends = [ + "orbital" +] diff --git a/recipes/orbutils/recipe.toml b/recipes/orbutils/recipe.toml new file mode 100644 index 000000000..135a66ec2 --- /dev/null +++ b/recipes/orbutils/recipe.toml @@ -0,0 +1,17 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/orbutils.git" + +[build] +template = "custom" +script = """ +COOKBOOK_CARGO_FLAGS=( + --path "${COOKBOOK_SOURCE}" + --root "${COOKBOOK_STAGE}/ui" +) +cookbook_cargo +""" + +[package] +depends = [ + "orbital" +] From be3b553cf429ac4de45788f63a7172b93c7f4d6c Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 15:49:07 -0600 Subject: [PATCH 28/45] Add userutils recipe --- recipes/userutils/recipe.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 recipes/userutils/recipe.toml diff --git a/recipes/userutils/recipe.toml b/recipes/userutils/recipe.toml new file mode 100644 index 000000000..ec1920b8c --- /dev/null +++ b/recipes/userutils/recipe.toml @@ -0,0 +1,13 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/userutils.git" + +[build] +template = "custom" +script = """ +cookbook_cargo +cp -rv "${COOKBOOK_SOURCE}/res" "${COOKBOOK_STAGE}/etc" +ln -s id "${COOKBOOK_STAGE}/bin/whoami" +chmod +s "${COOKBOOK_STAGE}/bin/passwd" +chmod +s "${COOKBOOK_STAGE}/bin/sudo" +chmod +s "${COOKBOOK_STAGE}/bin/su" +""" From f8f3718f39237ac8a2a5b08cb3ef04edfcdf23b0 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 20:07:11 -0600 Subject: [PATCH 29/45] Add ripgrep recipe --- recipes/ripgrep/recipe.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 recipes/ripgrep/recipe.toml diff --git a/recipes/ripgrep/recipe.toml b/recipes/ripgrep/recipe.toml new file mode 100644 index 000000000..b2e0cd6a3 --- /dev/null +++ b/recipes/ripgrep/recipe.toml @@ -0,0 +1,5 @@ +[source] +git = "https://github.com/jackpot51/ripgrep.git" + +[build] +template = "cargo" From 397cf47ad240ae1c2be6d3379ed5463917823255 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 20:16:30 -0600 Subject: [PATCH 30/45] Add expat recipe --- recipes/expat/recipe.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 recipes/expat/recipe.toml diff --git a/recipes/expat/recipe.toml b/recipes/expat/recipe.toml new file mode 100644 index 000000000..47a5bd5ac --- /dev/null +++ b/recipes/expat/recipe.toml @@ -0,0 +1,5 @@ +[source] +tar = "https://github.com/libexpat/libexpat/releases/download/R_2_2_6/expat-2.2.6.tar.bz2" + +[build] +template = "configure" From 275e5dbae6e1f5bfc8e2d43b9341136eb27c7ee3 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 20:37:18 -0600 Subject: [PATCH 31/45] Repo will now re-prepare when sysroot is deleted --- repo.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repo.sh b/repo.sh index b661f0cda..35052bb21 100755 --- a/repo.sh +++ b/repo.sh @@ -40,6 +40,10 @@ do then echo -e "\033[01;38;5;155mrepo - preparing $recipe\033[0m" >&2 ./cook.sh "$recipe" prepare + elif [ ! -d "recipes/$recipe/sysroot/" ] + then + echo -e "\033[01;38;5;155mrepo - repreparing $recipe\033[0m" >&2 + ./cook.sh "$recipe" unprepare prepare else TIME_SOURCE="$($FIND recipes/$recipe/source/ -type f -not -path '*/.git*' -printf "%Ts\n" | sort -nr | head -n 1)" TIME_BUILD="$($FIND recipes/$recipe/build/ -type f -not -path '*/.git*' -printf "%Ts\n" | sort -nr | head -n 1)" From f8edf05e54a6b771e3bc352677a4c9e60a5d4eeb Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 20:37:47 -0600 Subject: [PATCH 32/45] Add freetype and nghttp2 recipe --- recipes/freetype/recipe.toml | 9 +++++++++ recipes/nghttp2/recipe.toml | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 recipes/freetype/recipe.toml create mode 100644 recipes/nghttp2/recipe.toml diff --git a/recipes/freetype/recipe.toml b/recipes/freetype/recipe.toml new file mode 100644 index 000000000..ce535b7cc --- /dev/null +++ b/recipes/freetype/recipe.toml @@ -0,0 +1,9 @@ +[source] +tar = "https://download.savannah.gnu.org/releases/freetype/freetype-2.9.1.tar.gz" + +[build] +template = "configure" +dependencies = [ + "libpng", + "zlib" +] diff --git a/recipes/nghttp2/recipe.toml b/recipes/nghttp2/recipe.toml new file mode 100644 index 000000000..85d288618 --- /dev/null +++ b/recipes/nghttp2/recipe.toml @@ -0,0 +1,11 @@ +[source] +tar = "https://github.com/nghttp2/nghttp2/releases/download/v1.37.0/nghttp2-1.37.0.tar.xz" + +[build] +template = "custom" +script = """ +COOKBOOK_CONFIGURE_ARGS+=( + --enable-lib-only +) +cookbook_configure +""" From e754bc2184f070763c0dde8ecded1832c249e7b9 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 20:48:29 -0600 Subject: [PATCH 33/45] Add openssl recipe and fix nghttp2 recipe --- recipes/nghttp2/recipe.toml | 2 +- recipes/openssl/recipe.toml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 recipes/openssl/recipe.toml diff --git a/recipes/nghttp2/recipe.toml b/recipes/nghttp2/recipe.toml index 85d288618..f44d6bb76 100644 --- a/recipes/nghttp2/recipe.toml +++ b/recipes/nghttp2/recipe.toml @@ -4,7 +4,7 @@ tar = "https://github.com/nghttp2/nghttp2/releases/download/v1.37.0/nghttp2-1.37 [build] template = "custom" script = """ -COOKBOOK_CONFIGURE_ARGS+=( +COOKBOOK_CONFIGURE_FLAGS+=( --enable-lib-only ) cookbook_configure diff --git a/recipes/openssl/recipe.toml b/recipes/openssl/recipe.toml new file mode 100644 index 000000000..5b59968af --- /dev/null +++ b/recipes/openssl/recipe.toml @@ -0,0 +1,18 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/openssl.git" +branch = "redox" + +[build] +template = "custom" +script = """ +ARCH="${TARGET%%-*}" +COOKBOOK_CONFIGURE="${COOKBOOK_SOURCE}/Configure" +COOKBOOK_CONFIGURE_FLAGS=( + no-shared + no-dgram + "redox-${ARCH}" + --prefix="/" +) +cookbook_configure +rm -rfv "${COOKBOOK_STAGE}/"{share,ssl} +""" From decf39197dfed0a1ee314d5e4cdb4afd54cb6e41 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 20:59:20 -0600 Subject: [PATCH 34/45] Add patch for sed --- recipes/sed/recipe.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/sed/recipe.toml b/recipes/sed/recipe.toml index 37f5f2fb6..ffb29795c 100644 --- a/recipes/sed/recipe.toml +++ b/recipes/sed/recipe.toml @@ -1,5 +1,8 @@ [source] tar = "http://ftp.gnu.org/gnu/sed/sed-4.4.tar.xz" +patches = [ + "sed.patch" +] [build] template = "configure" From db9f4e40bfa393f3a879c20be9f40a9dec6f69ec Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 May 2020 21:13:39 -0600 Subject: [PATCH 35/45] Add curl recipe --- recipes/curl/recipe.toml | 39 +++++++++++++++++++++++++++++++++++++++ src/bin/cook.rs | 5 +++++ 2 files changed, 44 insertions(+) create mode 100644 recipes/curl/recipe.toml diff --git a/recipes/curl/recipe.toml b/recipes/curl/recipe.toml new file mode 100644 index 000000000..39af949ff --- /dev/null +++ b/recipes/curl/recipe.toml @@ -0,0 +1,39 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/curl.git" +branch = "redox" + +[build] +template = "custom" +dependencies = [ + "nghttp2", + "openssl", + "zlib" +] +script = """ +rsync -av --delete "${COOKBOOK_SOURCE}/" ./ +wget -O config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub +autoreconf -i +COOKBOOK_CONFIGURE="./configure" +COOKBOOK_CONFIGURE_FLAGS=( + --build="$(cc -dumpmachine)" + --host="${TARGET}" + --prefix="" + --disable-ftp + --disable-ipv6 + --disable-ntlm-wb + --disable-shared + --disable-tftp + --disable-threaded-resolver + --enable-static + --with-ca-path=/ssl/certs + --with-nghttp2="${COOKBOOK_SYSROOT}" + --with-ssl="${COOKBOOK_SYSROOT}" + --with-zlib="${COOKBOOK_SYSROOT}" +) +cookbook_configure +""" + +[package] +dependencies = [ + "ca-certificates" +] diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 303579421..585d1b811 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -339,6 +339,9 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result Date: Fri, 22 May 2020 08:22:09 -0600 Subject: [PATCH 36/45] Add sdl recipe --- recipes/sdl/recipe.toml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 recipes/sdl/recipe.toml diff --git a/recipes/sdl/recipe.toml b/recipes/sdl/recipe.toml new file mode 100644 index 000000000..cd55f3934 --- /dev/null +++ b/recipes/sdl/recipe.toml @@ -0,0 +1,23 @@ +[source] +tar = "https://www.libsdl.org/release/SDL-1.2.15.tar.gz" +patches = [ + "redox.patch" +] +script = "./autogen.sh" + +[build] +template = "custom" +dependencies = [ + "liborbital" +] +script = """ +COOKBOOK_CONFIGURE_FLAGS+=( + --disable-pulseaudio + --disable-video-x11 + --disable-loadso + --enable-redoxaudio + --enable-clock_gettime + --enable-video-orbital +) +cookbook_configure +""" From 93402359fedd3dbc0e25bf0c9657572e4980f2e1 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 22 May 2020 08:28:17 -0600 Subject: [PATCH 37/45] Add dash recipe --- recipes/dash/recipe.toml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 recipes/dash/recipe.toml diff --git a/recipes/dash/recipe.toml b/recipes/dash/recipe.toml new file mode 100644 index 000000000..c4bc57515 --- /dev/null +++ b/recipes/dash/recipe.toml @@ -0,0 +1,21 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/dash.git" +branch = "redox" + +[build] +template = "custom" +script = """ +rsync -av --delete "${COOKBOOK_SOURCE}/" ./ +./autogen.sh +./configure \ + --host="${TARGET}" \ + --prefix="" \ + --enable-static \ + cross_compiling=yes +# See https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux. +sed -i'' -e 's|#define HAVE_GETRLIMIT 1|/* #undef HAVE_GETRLIMIT */|g' config.h +# Skip configure +COOKBOOK_CONFIGURE="true" +COOKBOOK_CONFIGURE_FLAGS=() +cookbook_configure +""" From 9fefdef37fb884913e87d92edb91685b5cee0940 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 22 May 2020 08:37:02 -0600 Subject: [PATCH 38/45] Add uutils recipe --- recipes/uutils/recipe.toml | 98 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 recipes/uutils/recipe.toml diff --git a/recipes/uutils/recipe.toml b/recipes/uutils/recipe.toml new file mode 100644 index 000000000..c2f4f921f --- /dev/null +++ b/recipes/uutils/recipe.toml @@ -0,0 +1,98 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/uutils.git" +branch = "redox-unix" + +[build] +template = "custom" +script = """ +COOKBOOK_CARGO_FLAGS+=( + --no-default-features + --features redox + --bin uutils +) +cookbook_cargo + +BINS=( + base32 + base64 + basename + cat + chmod + cksum + comm + cp + cut + date + dircolors + dirname + echo + env + expand + expr + factor + false + fmt + fold + hashsum + head + install + join + link + ln + ls + md5sum + mkdir + mktemp + more + mv + nl + od + paste + printenv + printf + ptx + pwd + readlink + realpath + relpath + rm + rmdir + seq + sha1sum + sha224sum + sha256sum + sha3-224sum + sha3-256sum + sha3-384sum + sha3-512sum + sha384sum + sha3sum + sha512sum + shake128sum + shake256sum + shred + shuf + sleep + sort + split + sum + tac + tail + tee + test + tr + true + truncate + tsort + uname + unexpand + uniq + wc + yes +) + +for bin in "${BINS[@]}" +do + ln -sv uutils "${COOKBOOK_STAGE}/bin/$bin" +done +""" From 364867de5ba7420ea81a758232ff41c4370b4bd1 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 22 May 2020 10:03:26 -0600 Subject: [PATCH 39/45] Add cookbook_redoxer, a wrapper to make it simpler to user redoxer --- Cargo.lock | 830 ++++++++++++++++++++++++++++++++++++ Cargo.toml | 6 + src/bin/cook.rs | 11 +- src/bin/cookbook_redoxer.rs | 10 + 4 files changed, 855 insertions(+), 2 deletions(-) create mode 100644 src/bin/cookbook_redoxer.rs diff --git a/Cargo.lock b/Cargo.lock index a2ff97781..0f30f53fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,18 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "addr2line" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gimli 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "adler32" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ansi_term" version = "0.11.0" @@ -8,6 +21,11 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "arg_parser" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "arrayref" version = "0.3.6" @@ -33,11 +51,57 @@ name = "autocfg" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "backtrace" +version = "0.3.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "addr2line 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "object 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "base64" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bidir-map" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "blake2b_simd" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "blake3" version = "0.2.3" @@ -91,6 +155,11 @@ name = "byte-tools" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bytecount" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "byteorder" version = "1.3.4" @@ -125,6 +194,14 @@ name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "crc32fast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam-deque" version = "0.7.3" @@ -185,16 +262,102 @@ dependencies = [ "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "dirs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dirs-sys" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "either" version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "err-derive" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-error 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.48 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fake-simd" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "filetime" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fixedbitset" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuse" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "thread-scoped 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "generic-array" version = "0.12.3" @@ -213,6 +376,11 @@ dependencies = [ "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "gimli" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "hermit-abi" version = "0.1.13" @@ -221,11 +389,73 @@ dependencies = [ "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hyper" +version = "0.10.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper-rustls" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "index-fixed" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "keccak" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "language-tags" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "lazy_static" version = "1.4.0" @@ -236,6 +466,38 @@ name = "libc" version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "libflate" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rle-decode-fast 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "maybe-uninit" version = "2.0.0" @@ -249,6 +511,14 @@ dependencies = [ "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mime" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "num_cpus" version = "1.13.0" @@ -263,11 +533,34 @@ name = "numtoa" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "object" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "opaque-debug" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "ordermap" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ordermap" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "partition-identity" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "err-derive 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pbr" version = "1.0.2" @@ -279,6 +572,25 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "petgraph" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pkg-config" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "pkgar" version = "0.1.6" @@ -302,6 +614,30 @@ name = "ppv-lite86" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "proc-macro-error" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-error-attr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "proc-macro2" version = "1.0.13" @@ -310,6 +646,15 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "proc-mounts" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "partition-identity 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "quote" version = "1.0.6" @@ -318,6 +663,27 @@ dependencies = [ "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rand" version = "0.7.3" @@ -339,6 +705,19 @@ dependencies = [ "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rand_core" version = "0.5.1" @@ -377,6 +756,14 @@ dependencies = [ "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "redox_cookbook" version = "0.1.0" @@ -384,12 +771,66 @@ dependencies = [ "blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "pkgar 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "redoxer 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "redox_installer" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arg_parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "pkgar 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_liner 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_pkgutils 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "redoxfs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-argon2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_liner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytecount 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_pkgutils" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bidir-map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-rustls 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libflate 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "ordermap 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_liner 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", + "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "version-compare 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "redox_syscall" version = "0.1.56" @@ -403,11 +844,135 @@ dependencies = [ "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "redox_users" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redoxer" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-mounts 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_installer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "redoxfs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redoxfs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuse 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "remove_dir_all" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ring" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rle-decode-fast" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rust-argon2" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rust-argon2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustls" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)", + "sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustversion" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "sct" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "serde" version = "1.0.110" @@ -437,6 +1002,23 @@ dependencies = [ "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "sha3" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "smallvec" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "sodalite" version = "0.3.0" @@ -465,6 +1047,56 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "syn-mid" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "synstructure" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "tar" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "filetime 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "termion" version = "1.5.5" @@ -484,6 +1116,11 @@ dependencies = [ "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "thread-scoped" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "time" version = "0.1.43" @@ -493,6 +1130,14 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "toml" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "toml" version = "0.5.6" @@ -501,11 +1146,45 @@ dependencies = [ "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "traitobject" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "typeable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "typenum" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicase" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "smallvec 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "unicode-width" version = "0.1.7" @@ -516,16 +1195,72 @@ name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "untrusted" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "uuid" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "vec_map" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "version-compare" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "webpki" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "webpki-roots" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi" version = "0.3.8" @@ -545,73 +1280,168 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "xattr" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", +] + [metadata] +"checksum addr2line 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a49806b9dadc843c61e7c97e72490ad7f7220ae249012fbda9ad0609457c0543" +"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum arg_parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e9bcdf9185a4ea0d8afa7c8ad387cc3a93c3ecfa918125e000a57a42e71268d7" "checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum backtrace 0.3.48 (registry+https://github.com/rust-lang/crates.io-index)" = "0df2f85c8a2abbe3b7d7e748052fdd9b76a0458fdeb16ad4223f5eca78c7c130" +"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +"checksum base64 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" +"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" +"checksum bidir-map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6c3d05037e57974413eef55a8505df19de3cb4dc7a8f8389e1588ec492ae9c73" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" "checksum blake3 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "667d945f23cefed0b5f973af35c4bc3319caa6776fbda270e4897d8504afa8e4" "checksum blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "68df31bdf2bbb567e5adf8f21ac125dc0e897b1381e7b841f181521f06fc3134" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +"checksum bytecount 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0017894339f586ccb943b01b9555de56770c11cda818e7e3d8bd93f4ed7f46e" "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" "checksum cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)" = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" "checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" "checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" "checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" "checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" "checksum crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" +"checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +"checksum err-derive 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22deed3a8124cff5fa835713fa105621e43bbdc46690c3a6b68328a012d350d4" +"checksum failure 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +"checksum failure_derive 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +"checksum filetime 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "affc17579b132fc2461adf7c575cc6e8b134ebca52c51f5411388965227dc695" +"checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum fuse 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80e57070510966bfef93662a81cb8aa2b1c7db0964354fa9921434f04b9e8660" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum gimli 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" "checksum hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71" +"checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +"checksum hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" +"checksum hyper-rustls 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "71f7b2e5858ab9e19771dc361159f09ee5031734a6f7471fe0947db0238d92b7" +"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum index-fixed 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63adf4f50cae82ddb03b088a55172f5044e73c8f02d029e69780717f764bbfa" +"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +"checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)" = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" +"checksum libflate 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)" = "d9135df43b1f5d0e333385cb6e7897ecd1a43d7d11b91ac003f4d2c2d2401fdd" +"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" "checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" "checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" +"checksum object 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" "checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +"checksum ordermap 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "b81cf3b8cb96aa0e73bbedfcdc9708d09fec2854ba8d474be4e6f666d7379e8b" +"checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" +"checksum partition-identity 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ec13ba9a0eec5c10a89f6ec1b6e9e2ef7d29b810d771355abbd1c43cae003ed6" "checksum pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4403eb718d70c03ee279e51737782902c68cca01e870a33b6a2f9dfb50b9cd83" +"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" +"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" "checksum pkgar 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74003f2ac9baa8600352a677bd8763088cc35498a4364abe9ae5898832015bb9" "checksum plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" "checksum ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +"checksum proc-macro-error 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98e9e4b82e0ef281812565ea4751049f1bdcdfccda7d3f459f2e138a40c08678" +"checksum proc-macro-error-attr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4f5444ead4e9935abd7f27dc51f7e852a0569ac888096d5ec2499470794e2e53" "checksum proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "53f5ffe53a6b28e37c9c1ce74893477864d64f74778a93a4beb43c8fa167f639" +"checksum proc-mounts 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad7e9c8d1b8c20f16a84d61d7c4c0325a5837c1307a2491b509cd92fb4e4442" "checksum quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" "checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" "checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" "checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_installer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "98346851d42e2f357b3c023b27b75da14a774c226f9636a0ed42535b72d62bde" +"checksum redox_liner 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f014f6b014591f45bdd86377ab2f01b840ddd9e33421222b84d06e244b111327" +"checksum redox_pkgutils 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf753c67a43031ca0aa5661c1808edc4f94118f1daa368df38b641de8d74a91" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +"checksum redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" +"checksum redoxer 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "32c6983b8e5e20567168c6f0f0abd300d3870ea658ac88483d658ba6b83a34c8" +"checksum redoxfs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d2cf914a0e128dfd60c462d07ae347449959af11acf84fd9cd684bd8b89e1965" +"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2c4db68a2e35f3497146b7e4563df7d4773a2433230c5e4b448328e31740458a" +"checksum rle-decode-fast 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" +"checksum rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" +"checksum rust-argon2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19" +"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +"checksum rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "942b71057b31981152970d57399c25f72e27a6ee0d207a669d8304cabf44705b" +"checksum rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bba175698996010c4f6dce5e7f173b6eb781fce25d2cfc45e27091ce0b79f6" +"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" "checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +"checksum sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cb8f61f9e6eadd062a71c380043d28036304a4706b3c4dd001ff3387ed00745a" "checksum serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c" "checksum serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" "checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +"checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" +"checksum smallvec 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" "checksum sodalite 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67643084c740297bac275b1d97901ec27ca5984be4e8f75d86a33498e0e3e61c" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)" = "95b5f192649e48a5302a13f2feb224df883b98933222369e4b3b0fe2a5447269" +"checksum syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" +"checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +"checksum tar 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "7160add8f178ecef9c22e9d8f8ed28bc9a39660e98b1c28d93cc026ad9619f09" +"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thread-scoped 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bcbb6aa301e5d3b0b5ef639c9a9c7e2f1c944f177b460c04dc24c69b1fa2bd99" "checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +"checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" "checksum toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" "checksum typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" "checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" +"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +"checksum uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc7e3b898aa6f6c08e5295b6c89258d1331e9ac578cc992fb818759951bdc22" "checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +"checksum version-compare 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" +"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +"checksum webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "17d7967316d8411ca3b01821ee6c332bde138ba4363becdb492f12e514daa17f" +"checksum webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85d1f408918fd590908a70d36b7ac388db2edc221470333e4d6e5b598e44cabf" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" diff --git a/Cargo.toml b/Cargo.toml index 34ce71a28..cef0065b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "redox_cookbook" version = "0.1.0" authors = ["Jeremy Soller "] edition = "2018" +default-run = "cook" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -10,6 +11,10 @@ edition = "2018" name = "cook" path = "src/bin/cook.rs" +[[bin]] +name = "cookbook_redoxer" +path = "src/bin/cookbook_redoxer.rs" + [lib] name = "cookbook" path = "src/lib.rs" @@ -18,6 +23,7 @@ path = "src/lib.rs" blake3 = "0.3.3" pbr = "1.0.2" pkgar = "0.1.6" +redoxer = "0.2.18" serde = { version = "1.0", features = ["derive"] } sha2 = "0.8.1" termion = "1.5.5" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 585d1b811..d99b3f82a 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -361,7 +361,7 @@ export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig" export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}" # cargo template -COOKBOOK_CARGO="redoxer" +COOKBOOK_CARGO="target/release/cookbook_redoxer" COOKBOOK_CARGO_FLAGS=( --path "${COOKBOOK_SOURCE}" --root "${COOKBOOK_STAGE}" @@ -410,7 +410,7 @@ fi }; let command = { - let mut command = Command::new("redoxer"); + let mut command = Command::new("target/release/cookbook_redoxer"); command.arg("env"); command.arg("bash").arg("-ex"); @@ -447,6 +447,13 @@ fn package(recipe_dir: &Path, stage_dir: &Path, package: &PackageRecipe) -> Resu let secret_path = "build/secret.key"; let public_path = "build/public.key"; if ! Path::new(secret_path).is_file() || ! Path::new(public_path).is_file() { + if ! Path::new("build").is_dir() { + fs::create_dir("build").map_err(|err| format!( + "failed to create 'build': {}\n{:?}", + err, + err + ))?; + } pkgar::bin::keygen(secret_path, public_path).map_err(|err| format!( "failed to generate pkgar keys: {:?}", err diff --git a/src/bin/cookbook_redoxer.rs b/src/bin/cookbook_redoxer.rs new file mode 100644 index 000000000..0a9303900 --- /dev/null +++ b/src/bin/cookbook_redoxer.rs @@ -0,0 +1,10 @@ +use std::env; + +fn main() { + let mut args: Vec = env::args().collect(); + // Ensure all flags go to cargo + if args.len() >= 2 { + args.insert(2, "--".to_string()); + } + redoxer::main(&args); +} From c39511fac9b0e22aabbdd27920c4bbfb804bfbed Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 22 May 2020 10:18:36 -0600 Subject: [PATCH 40/45] Do not build cookbook crate from repo.sh --- repo.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/repo.sh b/repo.sh index 35052bb21..9cc912a4a 100755 --- a/repo.sh +++ b/repo.sh @@ -20,8 +20,6 @@ then recipes="$(ls -1 recipes)" fi -cargo build --release - for recipe in $recipes do if [ -e "recipes/$recipe/recipe.toml" ] From 0b55c5d7ac1eab94d3e022e6bff93944a03c60e9 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 22 May 2020 10:21:25 -0600 Subject: [PATCH 41/45] Use absolute path to cookbook_redoxer --- src/bin/cook.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/cook.rs b/src/bin/cook.rs index d99b3f82a..2fa341d4a 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -361,7 +361,7 @@ export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig" export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}" # cargo template -COOKBOOK_CARGO="target/release/cookbook_redoxer" +COOKBOOK_CARGO="${COOKBOOK_ROOT}/target/release/cookbook_redoxer" COOKBOOK_CARGO_FLAGS=( --path "${COOKBOOK_SOURCE}" --root "${COOKBOOK_STAGE}" From 73c074a08de91c37cecf2a1055552603c41297c6 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 22 May 2020 10:23:35 -0600 Subject: [PATCH 42/45] Define path to cookbook_redoxer once --- src/bin/cook.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 2fa341d4a..4f0584378 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -361,7 +361,7 @@ export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig" export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}" # cargo template -COOKBOOK_CARGO="${COOKBOOK_ROOT}/target/release/cookbook_redoxer" +COOKBOOK_CARGO="${COOKBOOK_REDOXER}" COOKBOOK_CARGO_FLAGS=( --path "${COOKBOOK_SOURCE}" --root "${COOKBOOK_STAGE}" @@ -410,20 +410,22 @@ fi }; let command = { - let mut command = Command::new("target/release/cookbook_redoxer"); - command.arg("env"); - command.arg("bash").arg("-ex"); - //TODO: remove unwraps let cookbook_build = build_dir.canonicalize().unwrap(); let cookbook_recipe = recipe_dir.canonicalize().unwrap(); + let cookbook_redoxer = Path::new("target/release/cookbook_redoxer").canonicalize().unwrap(); let cookbook_root = Path::new(".").canonicalize().unwrap(); let cookbook_stage = stage_dir_tmp.canonicalize().unwrap(); let cookbook_source = source_dir.canonicalize().unwrap(); let cookbook_sysroot = sysroot_dir.canonicalize().unwrap(); + + let mut command = Command::new(&cookbook_redoxer); + command.arg("env"); + command.arg("bash").arg("-ex"); command.current_dir(&cookbook_build); command.env("COOKBOOK_BUILD", &cookbook_build); command.env("COOKBOOK_RECIPE", &cookbook_recipe); + command.env("COOKBOOK_REDOXER", &cookbook_redoxer); command.env("COOKBOOK_ROOT", &cookbook_root); command.env("COOKBOOK_STAGE", &cookbook_stage); command.env("COOKBOOK_SOURCE", &cookbook_source); From d478a1c18dbdcb5423935c0cd5bab74a7b176f38 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 22 May 2020 10:31:19 -0600 Subject: [PATCH 43/45] Update redoxer to 0.2.19 --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f30f53fb..5cc44ab63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -771,7 +771,7 @@ dependencies = [ "blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "pkgar 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "redoxer 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "redoxer 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -856,7 +856,7 @@ dependencies = [ [[package]] name = "redoxer" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1390,7 +1390,7 @@ dependencies = [ "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" -"checksum redoxer 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "32c6983b8e5e20567168c6f0f0abd300d3870ea658ac88483d658ba6b83a34c8" +"checksum redoxer 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "9641f270dd15b5835a8e7f8d61c80fada81f4242bdc670dd48e4f7183fef97f0" "checksum redoxfs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d2cf914a0e128dfd60c462d07ae347449959af11acf84fd9cd684bd8b89e1965" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2c4db68a2e35f3497146b7e4563df7d4773a2433230c5e4b448328e31740458a" diff --git a/Cargo.toml b/Cargo.toml index cef0065b5..a6d2a37a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ path = "src/lib.rs" blake3 = "0.3.3" pbr = "1.0.2" pkgar = "0.1.6" -redoxer = "0.2.18" +redoxer = "0.2.19" serde = { version = "1.0", features = ["derive"] } sha2 = "0.8.1" termion = "1.5.5" From 5fdb1b84384732168bf61496cf6e491a505b7e38 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 25 May 2020 21:51:57 -0600 Subject: [PATCH 44/45] Use modified date to rebuild packages --- Cargo.lock | 100 ++++++++++++++++++++++------------ Cargo.toml | 7 +-- src/bin/cook.rs | 139 +++++++++++++++++++++++++++++++++++------------- 3 files changed, 171 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5cc44ab63..f18a2b052 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,7 +119,7 @@ dependencies = [ [[package]] name = "blake3" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -293,10 +293,10 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-error 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -314,9 +314,9 @@ name = "failure_derive" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -620,10 +620,10 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-error-attr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", - "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -631,16 +631,16 @@ name = "proc-macro-error-attr" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "proc-macro2" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -660,7 +660,7 @@ name = "quote" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -768,14 +768,15 @@ dependencies = [ name = "redox_cookbook" version = "0.1.0" dependencies = [ - "blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "blake3 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "pkgar 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "redoxer 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", - "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -826,7 +827,7 @@ dependencies = [ "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "version-compare 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -949,9 +950,9 @@ name = "rustversion" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -959,6 +960,14 @@ name = "safemem" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -986,14 +995,14 @@ name = "serde_derive" version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sha2" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1039,10 +1048,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1052,9 +1061,9 @@ name = "syn-mid" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1062,9 +1071,9 @@ name = "synstructure" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1075,7 +1084,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tar" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "filetime 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1235,9 +1244,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "version_check" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -1275,6 +1294,14 @@ name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -1305,7 +1332,7 @@ dependencies = [ "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" "checksum blake3 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "667d945f23cefed0b5f973af35c4bc3319caa6776fbda270e4897d8504afa8e4" -"checksum blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "68df31bdf2bbb567e5adf8f21ac125dc0e897b1381e7b841f181521f06fc3134" +"checksum blake3 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "423897d97e11b810c9da22458400b28ec866991c711409073662eb34dc44bfff" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" @@ -1370,7 +1397,7 @@ dependencies = [ "checksum ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" "checksum proc-macro-error 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98e9e4b82e0ef281812565ea4751049f1bdcdfccda7d3f459f2e138a40c08678" "checksum proc-macro-error-attr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4f5444ead4e9935abd7f27dc51f7e852a0569ac888096d5ec2499470794e2e53" -"checksum proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "53f5ffe53a6b28e37c9c1ce74893477864d64f74778a93a4beb43c8fa167f639" +"checksum proc-macro2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "1502d12e458c49a4c9cbff560d0fe0060c252bc29799ed94ca2ed4bb665a0101" "checksum proc-mounts 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad7e9c8d1b8c20f16a84d61d7c4c0325a5837c1307a2491b509cd92fb4e4442" "checksum quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" "checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" @@ -1401,21 +1428,22 @@ dependencies = [ "checksum rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "942b71057b31981152970d57399c25f72e27a6ee0d207a669d8304cabf44705b" "checksum rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bba175698996010c4f6dce5e7f173b6eb781fce25d2cfc45e27091ce0b79f6" "checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" "checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" "checksum sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cb8f61f9e6eadd062a71c380043d28036304a4706b3c4dd001ff3387ed00745a" "checksum serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c" "checksum serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" -"checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +"checksum sha2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" "checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" "checksum smallvec 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" "checksum sodalite 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67643084c740297bac275b1d97901ec27ca5984be4e8f75d86a33498e0e3e61c" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" -"checksum syn 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)" = "95b5f192649e48a5302a13f2feb224df883b98933222369e4b3b0fe2a5447269" +"checksum syn 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f14a640819f79b72a710c0be059dce779f9339ae046c8bef12c361d56702146f" "checksum syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" -"checksum tar 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "7160add8f178ecef9c22e9d8f8ed28bc9a39660e98b1c28d93cc026ad9619f09" +"checksum tar 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)" = "5c058ad0bd6ccb84faa24cc44d4fc99bee8a5d7ba9ff33aa4d993122d1aeeac2" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" @@ -1437,11 +1465,13 @@ dependencies = [ "checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" "checksum version-compare 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" +"checksum version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "17d7967316d8411ca3b01821ee6c332bde138ba4363becdb492f12e514daa17f" "checksum webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85d1f408918fd590908a70d36b7ac388db2edc221470333e4d6e5b598e44cabf" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" diff --git a/Cargo.toml b/Cargo.toml index a6d2a37a3..3d118d197 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,11 +20,12 @@ name = "cookbook" path = "src/lib.rs" [dependencies] -blake3 = "0.3.3" +blake3 = "0.3.4" pbr = "1.0.2" pkgar = "0.1.6" redoxer = "0.2.19" -serde = { version = "1.0", features = ["derive"] } -sha2 = "0.8.1" +serde = { version = "1.0.110", features = ["derive"] } +sha2 = "0.8.2" termion = "1.5.5" toml = "0.5.6" +walkdir = "2.3.1" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 4f0584378..ceda38095 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -4,25 +4,73 @@ use cookbook::sha256::sha256_progress; use std::{ env, fs, - io::Write, + io::{self, Write}, path::{Path, PathBuf}, process::{self, Command, Stdio}, + time::SystemTime, }; use termion::{color, style}; +use walkdir::WalkDir; + +fn remove_all(path: &Path) -> Result<(), String> { + if path.is_dir() { + fs::remove_dir_all(path) + } else { + fs::remove_file(path) + }.map_err(|err| format!( + "failed to remove '{}': {}\n{:?}", + path.display(), + err, + err + )) +} + +fn create_dir(dir: &Path) -> Result<(), String> { + fs::create_dir(&dir).map_err(|err| format!( + "failed to create '{}': {}\n{:?}", + dir.display(), + err, + err + )) +} fn create_dir_clean(dir: &Path) -> Result<(), String> { if dir.is_dir() { - // Remove previous directory - fs::remove_dir_all(&dir).map_err(|err| format!( - "failed to remove '{}': {}\n{:?}", - dir.display(), - err, - err - ))?; + remove_all(dir)?; } - // directory - fs::create_dir(&dir).map_err(|err| format!( - "failed to create '{}': {}\n{:?}", + create_dir(dir) +} + +fn modified(path: &Path) -> Result { + let metadata = fs::metadata(path).map_err(|err| format!( + "failed to get metadata of '{}': {}\n{:#?}", + path.display(), + err, + err + ))?; + metadata.modified().map_err(|err| format!( + "failed to get modified time of '{}': {}\n{:#?}", + path.display(), + err, + err + )) +} + +fn modified_dir(dir: &Path) -> Result { + fn modified_dir_io(dir: &Path) -> io::Result { + let mut newest = fs::metadata(dir)?.modified()?; + for entry_res in WalkDir::new(dir) { + let entry = entry_res?; + let modified = entry.metadata()?.modified()?; + if modified > newest { + newest = modified; + } + } + Ok(newest) + } + + modified_dir_io(&dir).map_err(|err| format!( + "failed to get modified time of '{}': {}\n{:#?}", dir.display(), err, err @@ -104,6 +152,7 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { let source_dir = recipe_dir.join("source"); match source { SourceRecipe::Git { git, upstream, branch, rev } => { + //TODO: use libgit? if ! source_dir.is_dir() { // Create source.tmp let source_dir_tmp = recipe_dir.join("source.tmp"); @@ -190,16 +239,14 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { rename(&source_tar_tmp, &source_tar)?; } + // Calculate blake3 + let source_tar_blake3 = blake3_progress(&source_tar).map_err(|err| format!( + "failed to calculate blake3 of '{}': {}\n{:?}", + source_tar.display(), + err, + err + ))?; if let Some(blake3) = blake3 { - //TODO - // Calculate blake3 - let source_tar_blake3 = blake3_progress(&source_tar).map_err(|err| format!( - "failed to calculate blake3 of '{}': {}\n{:?}", - source_tar.display(), - err, - err - ))?; - // Check if it matches recipe if &source_tar_blake3 != blake3 { return Err(format!( @@ -208,8 +255,16 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { blake3 )); } + } else { + //TODO: set blake3 hash on the recipe with something like "cook fix" + eprintln!( + "WARNING: set blake3 for '{}' to '{}'", + source_tar.display(), + source_tar_blake3 + ); } + //TODO: if blake3 is set, remove sha256 if let Some(sha256) = sha256 { // Calculate sha256 let source_tar_sha256 = sha256_progress(&source_tar).map_err(|err| format!( @@ -284,26 +339,25 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { } fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result { + let source_modified = modified_dir(&source_dir)?; + let sysroot_dir = recipe_dir.join("sysroot"); + // Rebuild sysroot if source is newer + //TODO: rebuild on recipe changes + if sysroot_dir.is_dir() { + if modified_dir(&sysroot_dir)? < source_modified { + remove_all(&sysroot_dir)?; + } + } if ! sysroot_dir.is_dir() { // Create sysroot.tmp let sysroot_dir_tmp = recipe_dir.join("sysroot.tmp"); create_dir_clean(&sysroot_dir_tmp)?; // Make sure sysroot/include exists - fs::create_dir(sysroot_dir_tmp.join("include")).map_err(|err| format!( - "failed to create '{}/include': {}\n{:#?}", - sysroot_dir_tmp.display(), - err, - err - ))?; + create_dir(&sysroot_dir_tmp.join("include"))?; // Make sure sysroot/lib exists - fs::create_dir(sysroot_dir_tmp.join("lib")).map_err(|err| format!( - "failed to create '{}/lib': {}\n{:#?}", - sysroot_dir_tmp.display(), - err, - err - ))?; + create_dir(&sysroot_dir_tmp.join("lib"))?; for dependency in build.dependencies.iter() { let public_path = "build/public.key"; @@ -326,6 +380,13 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result Resu let public_path = "build/public.key"; if ! Path::new(secret_path).is_file() || ! Path::new(public_path).is_file() { if ! Path::new("build").is_dir() { - fs::create_dir("build").map_err(|err| format!( - "failed to create 'build': {}\n{:?}", - err, - err - ))?; + create_dir(Path::new("build"))?; } pkgar::bin::keygen(secret_path, public_path).map_err(|err| format!( "failed to generate pkgar keys: {:?}", @@ -463,6 +520,14 @@ fn package(recipe_dir: &Path, stage_dir: &Path, package: &PackageRecipe) -> Resu } let package_file = recipe_dir.join("stage.pkgar"); + // Rebuild package if stage is newer + //TODO: rebuild on recipe changes + if package_file.is_file() { + let stage_modified = modified_dir(&stage_dir)?; + if modified(&package_file)? < stage_modified { + remove_all(&package_file)?; + } + } if ! package_file.is_file() { pkgar::bin::create( secret_path, From cf7cd7d1b53e16e59e680baf5ee3db2cb6790f87 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 25 May 2020 21:52:13 -0600 Subject: [PATCH 45/45] Add zlib blake3 --- recipes/zlib/recipe.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/zlib/recipe.toml b/recipes/zlib/recipe.toml index 11b97874f..e33f2affa 100644 --- a/recipes/zlib/recipe.toml +++ b/recipes/zlib/recipe.toml @@ -1,5 +1,6 @@ [source] tar = "http://zlib.net/zlib-1.2.11.tar.gz" +blake3 = "20db628054c3c09edea193700ca39d3c033655529cbdc5d88f3c5da7514ad949" [build] template = "custom"