From c67d54bdd4ceeb67af04601de819d41dabad46cc Mon Sep 17 00:00:00 2001 From: xenia Date: Mon, 11 Nov 2024 15:23:07 -0500 Subject: [PATCH] pkgs: add rbasefind --- overlay.nix | 2 + pkgs/rust/rbasefind/0001-Add-Cargo.lock.patch | 252 ++++++++++++++++++ pkgs/rust/rbasefind/default.nix | 24 ++ 3 files changed, 278 insertions(+) create mode 100644 pkgs/rust/rbasefind/0001-Add-Cargo.lock.patch create mode 100644 pkgs/rust/rbasefind/default.nix diff --git a/overlay.nix b/overlay.nix index 36228be..d393b55 100644 --- a/overlay.nix +++ b/overlay.nix @@ -35,4 +35,6 @@ final: prev: { outer-wilds-text-adventure = prev.callPackage ./pkgs/games/outer-wilds-text-adventure {}; mkNginxServer = prev.callPackage ./lib/dev-nginx {}; + + rbasefind = prev.callPackage ./pkgs/rust/rbasefind {}; } diff --git a/pkgs/rust/rbasefind/0001-Add-Cargo.lock.patch b/pkgs/rust/rbasefind/0001-Add-Cargo.lock.patch new file mode 100644 index 0000000..773ffe1 --- /dev/null +++ b/pkgs/rust/rbasefind/0001-Add-Cargo.lock.patch @@ -0,0 +1,252 @@ +From 5b92986cb874bcb441c9111c49c80b8135105574 Mon Sep 17 00:00:00 2001 +From: xenia +Date: Mon, 11 Nov 2024 15:20:58 -0500 +Subject: [PATCH] Add Cargo.lock + +--- + .gitignore | 4 - + Cargo.lock | 218 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 218 insertions(+), 4 deletions(-) + create mode 100644 Cargo.lock + +diff --git a/.gitignore b/.gitignore +index 50281a4..f2e972d 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -2,9 +2,5 @@ + # will have compiled files and executables + /target/ + +-# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +-# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock +-Cargo.lock +- + # These are backup files generated by rustfmt + **/*.rs.bk +diff --git a/Cargo.lock b/Cargo.lock +new file mode 100644 +index 0000000..198f18c +--- /dev/null ++++ b/Cargo.lock +@@ -0,0 +1,218 @@ ++# This file is automatically @generated by Cargo. ++# It is not intended for manual editing. ++version = 3 ++ ++[[package]] ++name = "aho-corasick" ++version = "1.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" ++dependencies = [ ++ "memchr", ++] ++ ++[[package]] ++name = "ansi_term" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" ++dependencies = [ ++ "winapi", ++] ++ ++[[package]] ++name = "atty" ++version = "0.2.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" ++dependencies = [ ++ "hermit-abi 0.1.19", ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "bitflags" ++version = "1.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" ++ ++[[package]] ++name = "byteorder" ++version = "1.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" ++ ++[[package]] ++name = "clap" ++version = "2.34.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" ++dependencies = [ ++ "ansi_term", ++ "atty", ++ "bitflags", ++ "strsim", ++ "textwrap", ++ "unicode-width", ++ "vec_map", ++] ++ ++[[package]] ++name = "crossbeam-channel" ++version = "0.5.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" ++dependencies = [ ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-utils" ++version = "0.8.20" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" ++ ++[[package]] ++name = "fnv" ++version = "1.0.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" ++ ++[[package]] ++name = "hermit-abi" ++version = "0.1.19" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "hermit-abi" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" ++ ++[[package]] ++name = "libc" ++version = "0.2.162" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" ++ ++[[package]] ++name = "memchr" ++version = "2.7.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" ++ ++[[package]] ++name = "num_cpus" ++version = "1.16.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" ++dependencies = [ ++ "hermit-abi 0.3.9", ++ "libc", ++] ++ ++[[package]] ++name = "pbr" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ed5827dfa0d69b6c92493d6c38e633bbaa5937c153d0d7c28bf12313f8c6d514" ++dependencies = [ ++ "crossbeam-channel", ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "rbasefind" ++version = "0.1.3" ++dependencies = [ ++ "byteorder", ++ "clap", ++ "fnv", ++ "num_cpus", ++ "pbr", ++ "regex", ++] ++ ++[[package]] ++name = "regex" ++version = "1.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" ++dependencies = [ ++ "aho-corasick", ++ "memchr", ++ "regex-automata", ++ "regex-syntax", ++] ++ ++[[package]] ++name = "regex-automata" ++version = "0.4.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" ++dependencies = [ ++ "aho-corasick", ++ "memchr", ++ "regex-syntax", ++] ++ ++[[package]] ++name = "regex-syntax" ++version = "0.8.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" ++ ++[[package]] ++name = "strsim" ++version = "0.8.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" ++ ++[[package]] ++name = "textwrap" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" ++dependencies = [ ++ "unicode-width", ++] ++ ++[[package]] ++name = "unicode-width" ++version = "0.1.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" ++ ++[[package]] ++name = "vec_map" ++version = "0.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" ++ ++[[package]] ++name = "winapi" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" ++dependencies = [ ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", ++] ++ ++[[package]] ++name = "winapi-i686-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" ++ ++[[package]] ++name = "winapi-x86_64-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +-- +2.44.1 + diff --git a/pkgs/rust/rbasefind/default.nix b/pkgs/rust/rbasefind/default.nix new file mode 100644 index 0000000..df552a8 --- /dev/null +++ b/pkgs/rust/rbasefind/default.nix @@ -0,0 +1,24 @@ +{ + lib, + fetchFromGitHub, + rustPlatform, +}: +rustPlatform.buildRustPackage rec { + pname = "rbasefind"; + version = "0.1.3"; + src = fetchFromGitHub { + owner = "sgayou"; + repo = pname; + rev = "v${version}"; + hash = "sha256-2eheLrnf9YWVHBGMNvmCoSclis6ThxE2ImLTZqYv8hg="; + }; + cargoPatches = [ ./0001-Add-Cargo.lock.patch ]; + cargoHash = "sha256-H8bsnJ5nDTr2fnviXoamaXOTRQiimVOKcHFHt5/RJJU="; + + meta = { + description = "A firmware base address search tool"; + homepage = "https://github.com/sgayou/rbasefind"; + license = lib.licenses.mit; + maintainers = []; + }; +}