From 3db3a480cb294d7ebeb2d3161a187bdc11db96b9 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Sun, 9 Jun 2024 16:03:31 +0800 Subject: [PATCH] Add system packages to TOOLS.md --- TOOLS.md | 3 ++ tools/codegen/src/tools-markdown.rs | 80 +++++++++++++++++++++++------ 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/TOOLS.md b/TOOLS.md index 4c58031ed..53d4559e8 100644 --- a/TOOLS.md +++ b/TOOLS.md @@ -34,6 +34,7 @@ If a tool not included in the list below is specified, this action uses [cargo-b | [**cargo-valgrind**](https://github.com/jfrimmel/cargo-valgrind) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/jfrimmel/cargo-valgrind/releases) | Linux, macOS, Windows | [MIT](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-APACHE) | | [**cargo-zigbuild**](https://github.com/rust-cross/cargo-zigbuild) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-cross/cargo-zigbuild/releases) | Linux, macOS, Windows | [MIT](https://github.com/rust-cross/cargo-zigbuild/blob/main/LICENSE) | | [**cross**](https://github.com/cross-rs/cross) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cross-rs/cross/releases) | Linux, macOS, Windows | [MIT](https://github.com/cross-rs/cross/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/cross-rs/cross/blob/main/LICENSE-APACHE) | +| [**curl**](https://github.com/curl/curl) | `/usr/bin` | [distro package](https://repology.org/project/curl/versions) | Linux | [curl](https://github.com/curl/curl/blob/master/COPYING) | | [**dprint**](https://github.com/dprint/dprint) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/dprint/dprint/releases) | Linux, macOS, Windows | [MIT](https://github.com/dprint/dprint/blob/main/LICENSE) | | [**editorconfig-checker**](https://github.com/editorconfig-checker/editorconfig-checker) | `/usr/local/bin` | [GitHub Releases](https://github.com/editorconfig-checker/editorconfig-checker/releases) | Linux, macOS, Windows | [MIT](https://github.com/editorconfig-checker/editorconfig-checker/blob/main/LICENSE) | | [**espup**](https://github.com/esp-rs/espup) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/esp-rs/espup/releases) | Linux, macOS, Windows | [MIT](https://github.com/esp-rs/espup/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/esp-rs/espup/blob/main/LICENSE-APACHE) | @@ -41,6 +42,7 @@ If a tool not included in the list below is specified, this action uses [cargo-b | [**grcov**](https://github.com/mozilla/grcov) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/mozilla/grcov/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/mozilla/grcov/blob/HEAD/LICENSE-MPL-2.0) | | [**hyperfine**](https://github.com/sharkdp/hyperfine) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/sharkdp/hyperfine/releases) | Linux, macOS, Windows | [MIT](https://github.com/sharkdp/hyperfine/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/sharkdp/hyperfine/blob/master/LICENSE-APACHE) | | [**jaq**](https://github.com/01mf02/jaq) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/01mf02/jaq/releases) | Linux, macOS, Windows | [MIT](https://github.com/01mf02/jaq/blob/main/LICENSE-MIT) | +| [**jq**](https://github.com/jqlang/jq) | `/usr/bin` | [distro package](https://repology.org/project/jq/versions) | Linux, Windows | [MIT AND ICU AND CC-BY-3.0](https://github.com/jqlang/jq/blob/master/jq.spec#L9) | | [**just**](https://github.com/casey/just) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/casey/just/releases) | Linux, macOS, Windows | [CC0-1.0](https://github.com/casey/just/blob/master/LICENSE) | | [**mdbook**](https://github.com/rust-lang/mdBook) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-lang/mdBook/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/rust-lang/mdBook/blob/master/LICENSE) | | [**mdbook-linkcheck**](https://github.com/Michael-F-Bryan/mdbook-linkcheck) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases) | Linux, macOS, Windows | [MIT](https://github.com/Michael-F-Bryan/mdbook-linkcheck/blob/master/LICENSE) | @@ -52,6 +54,7 @@ If a tool not included in the list below is specified, this action uses [cargo-b | [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/koalaman/shellcheck/blob/master/LICENSE) | | [**shfmt**](https://github.com/mvdan/sh) | `/usr/local/bin` | [GitHub Releases](https://github.com/mvdan/sh/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/mvdan/sh/blob/master/LICENSE) | | [**syft**](https://github.com/anchore/syft) | `/usr/local/bin` | [GitHub Releases](https://github.com/anchore/syft/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/anchore/syft/blob/main/LICENSE) | +| [**tar**](https://www.gnu.org/software/tar/) | `/usr/bin` | [distro package](https://repology.org/project/tar/versions) | Linux | [GPL-3.0-or-later](https://git.savannah.gnu.org/cgit/tar.git/tree/COPYING) | | [**typos**](https://github.com/crate-ci/typos) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/crate-ci/typos/releases) | Linux, macOS, Windows | [MIT](https://github.com/crate-ci/typos/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/crate-ci/typos/blob/master/LICENSE-APACHE) | | [**valgrind**](https://valgrind.org/) | `/snap/bin` | [snap](https://snapcraft.io/install/valgrind/ubuntu) | Linux | [GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD) | | [**wait-for-them**](https://github.com/shenek/wait-for-them) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/shenek/wait-for-them/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/shenek/wait-for-them/blob/v0.4.0/Cargo.toml#L7) | diff --git a/tools/codegen/src/tools-markdown.rs b/tools/codegen/src/tools-markdown.rs index 850cba603..0e7c8158f 100644 --- a/tools/codegen/src/tools-markdown.rs +++ b/tools/codegen/src/tools-markdown.rs @@ -46,18 +46,55 @@ fn main() -> Result<()> { fs::read_dir(manifest_dir.clone()).unwrap().map(|r| r.unwrap()).collect(); paths.sort_by_key(fs_err::DirEntry::path); - let mut tools = vec![MarkdownEntry { - name: "valgrind".to_string(), - alias: None, - website: "https://valgrind.org/".to_string(), - installed_to: InstalledTo::Snap, - installed_from: InstalledFrom::Snap, - platforms: Platforms { linux: true, ..Default::default() }, - repository: "https://sourceware.org/git/valgrind.git".to_string(), - license_markdown: - "[GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD)" + let mut tools = vec![ + MarkdownEntry { + name: "valgrind".to_string(), + alias: None, + website: "https://valgrind.org/".to_string(), + installed_to: InstalledTo::Snap, + installed_from: InstalledFrom::Snap, + platforms: Platforms { linux: true, ..Default::default() }, + repository: "https://sourceware.org/git/valgrind.git".to_string(), + license_markdown: + "[GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD)" + .to_string(), + }, + MarkdownEntry { + name: "jq".to_string(), + alias: None, + website: "https://github.com/jqlang/jq".to_string(), + installed_to: InstalledTo::UsrBin, + installed_from: InstalledFrom::DistroPackage, + platforms: Platforms { linux: true, windows: true, macos: false }, + repository: "https://github.com/jqlang/jq".to_string(), + license_markdown: + "[MIT AND ICU AND CC-BY-3.0](https://github.com/jqlang/jq/blob/master/jq.spec#L9)" + .to_string(), + }, + MarkdownEntry { + name: "curl".to_string(), + alias: None, + website: "https://github.com/curl/curl".to_string(), + installed_to: InstalledTo::UsrBin, + installed_from: InstalledFrom::DistroPackage, + platforms: Platforms { linux: true, ..Default::default() }, + repository: "https://github.com/curl/curl".to_string(), + license_markdown: "[curl](https://github.com/curl/curl/blob/master/COPYING)" .to_string(), - }]; + }, + MarkdownEntry { + name: "tar".to_string(), + alias: None, + website: "https://www.gnu.org/software/tar/".to_string(), + installed_to: InstalledTo::UsrBin, + installed_from: InstalledFrom::DistroPackage, + platforms: Platforms { linux: true, ..Default::default() }, + repository: "https://git.savannah.gnu.org/cgit/tar.git".to_string(), + license_markdown: + "[GPL-3.0-or-later](https://git.savannah.gnu.org/cgit/tar.git/tree/COPYING)" + .to_string(), + }, + ]; for path in paths { let file_name = path.file_name(); @@ -76,8 +113,11 @@ fn main() -> Result<()> { let repository = base_info.repository; - let installed_to = - if manifests.rust_crate.is_some() { InstalledTo::Cargo } else { InstalledTo::UsrLocal }; + let installed_to = if manifests.rust_crate.is_some() { + InstalledTo::Cargo + } else { + InstalledTo::UsrLocalBin + }; let installed_from = InstalledFrom::GitHubRelease; let mut platforms = Platforms::default(); @@ -141,6 +181,7 @@ struct MarkdownEntry { enum InstalledFrom { GitHubRelease, Snap, + DistroPackage, } #[derive(Debug, Default, Eq, PartialEq)] @@ -172,7 +213,8 @@ impl fmt::Display for Platforms { enum InstalledTo { Cargo, Snap, - UsrLocal, + UsrBin, + UsrLocalBin, } impl fmt::Display for InstalledTo { @@ -180,7 +222,8 @@ impl fmt::Display for InstalledTo { match self { InstalledTo::Cargo => f.write_str("`$CARGO_HOME/bin`")?, InstalledTo::Snap => f.write_str("`/snap/bin`")?, - InstalledTo::UsrLocal => f.write_str("`/usr/local/bin`")?, + InstalledTo::UsrBin => f.write_str("`/usr/bin`")?, + InstalledTo::UsrLocalBin => f.write_str("`/usr/local/bin`")?, } Ok(()) @@ -204,6 +247,13 @@ impl fmt::Display for MarkdownEntry { let markdown = format!("| [GitHub Releases]({}/releases) ", self.repository); f.write_str(&markdown)?; } + InstalledFrom::DistroPackage => { + let markdown = format!( + "| [distro package](https://repology.org/project/{}/versions) ", + self.name + ); + f.write_str(&markdown)?; + } InstalledFrom::Snap => { let markdown = format!("| [snap](https://snapcraft.io/install/{}/ubuntu) ", self.name);