Merge pull request #198715 from SuperSandro2000/onefetch

authored by Sandro and committed by GitHub ea193702 76d5ecd0

+34 -26
+24 -11
pkgs/tools/misc/onefetch/default.nix
··· 1 - { fetchFromGitHub 2 , rustPlatform 3 - , lib 4 - , stdenv 5 , pkg-config 6 , zstd 7 , CoreFoundation 8 - , libiconv 9 , libresolv 10 , Security 11 }: 12 13 rustPlatform.buildRustPackage rec { 14 pname = "onefetch"; 15 - version = "2.12.0"; 16 17 src = fetchFromGitHub { 18 owner = "o2sh"; 19 repo = pname; 20 rev = "v${version}"; 21 - sha256 = "sha256-nSvqAXzA/4CSnOMCZri2ks58bW+9v+SoyIIzb+K5S88="; 22 }; 23 24 cargoPatches = [ 25 # enable pkg-config feature of zstd 26 ./zstd-pkg-config.patch 27 ]; 28 29 - cargoSha256 = "sha256-uSef6x5QkXKwajglbwyoIsUFGbz0zntVM1ko0FZqnck="; 30 31 - nativeBuildInputs = [ pkg-config ]; 32 33 - buildInputs = [ zstd ] 34 - ++ lib.optionals stdenv.isDarwin [ CoreFoundation libiconv libresolv Security ]; 35 36 meta = with lib; { 37 description = "Git repository summary on your terminal"; 38 homepage = "https://github.com/o2sh/onefetch"; 39 license = licenses.mit; 40 - maintainers = with maintainers; [ Br1ght0ne kloenk SuperSandro2000 ]; 41 }; 42 }
··· 1 + { lib 2 , rustPlatform 3 + , fetchFromGitHub 4 + , cmake 5 , pkg-config 6 , zstd 7 + , stdenv 8 , CoreFoundation 9 , libresolv 10 , Security 11 + , git 12 }: 13 14 rustPlatform.buildRustPackage rec { 15 pname = "onefetch"; 16 + version = "2.13.2"; 17 18 src = fetchFromGitHub { 19 owner = "o2sh"; 20 repo = pname; 21 rev = "v${version}"; 22 + sha256 = "sha256-ydRdnzOI9syfF2ox9vHA9Q0j8C7ZNb0b7CJfqUprPA0="; 23 }; 24 25 + cargoSha256 = "sha256-IprUSNxoojagXUO/I7WDGJMG0U541ioe4qgLT4hqmbY="; 26 + 27 cargoPatches = [ 28 # enable pkg-config feature of zstd 29 ./zstd-pkg-config.patch 30 ]; 31 32 + nativeBuildInputs = [ cmake pkg-config ]; 33 + 34 + buildInputs = [ zstd ] 35 + ++ lib.optionals stdenv.isDarwin [ CoreFoundation libresolv Security ]; 36 37 + checkInputs = [ 38 + git 39 + ]; 40 41 + preCheck = '' 42 + git init 43 + git config user.email nixbld@example.com 44 + git add . 45 + git commit -m test 46 + ''; 47 48 meta = with lib; { 49 description = "Git repository summary on your terminal"; 50 homepage = "https://github.com/o2sh/onefetch"; 51 + changelog = "https://github.com/o2sh/onefetch/blob/v${version}/CHANGELOG.md"; 52 license = licenses.mit; 53 + maintainers = with maintainers; [ Br1ght0ne figsoda kloenk SuperSandro2000 ]; 54 }; 55 }
+10 -15
pkgs/tools/misc/onefetch/zstd-pkg-config.patch
··· 1 - diff --git a/Cargo.lock b/Cargo.lock 2 - index 202cda0..bc864cc 100644 3 --- a/Cargo.lock 4 +++ b/Cargo.lock 5 - @@ -872,6 +872,7 @@ dependencies = [ 6 "tokei", 7 "toml", 8 "yaml-rust", 9 - + "zstd-sys", 10 ] 11 12 [[package]] 13 - @@ -1678,4 +1679,5 @@ checksum = "2141bed8922b427761470e6bbfeff255da94fa20b0bbeab0d9297fcaf71e3aa7" 14 dependencies = [ 15 "cc", 16 "libc", 17 + "pkg-config", 18 ] 19 - diff --git a/Cargo.toml b/Cargo.toml 20 - index 8e0b5ff..48959b4 100644 21 --- a/Cargo.toml 22 +++ b/Cargo.toml 23 - @@ -57,6 +57,8 @@ libc = "0.2.112" 24 - [dev-dependencies] 25 - more-asserts = "0.2" 26 - paste = "1.0.7" 27 - +# Specify that the indirect dependency ztsd-sys should pick up the system zstd C library 28 - +zstd-sys = { version = "1", features = [ "pkg-config" ] } 29 30 - [features] 31 - fail-on-deprecated = []
··· 1 --- a/Cargo.lock 2 +++ b/Cargo.lock 3 + @@ -2039,6 +2039,7 @@ dependencies = [ 4 "tokei", 5 "toml", 6 "yaml-rust", 7 + + "zstd", 8 ] 9 10 [[package]] 11 + @@ -3286,4 +3287,5 @@ checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" 12 dependencies = [ 13 "cc", 14 "libc", 15 + "pkg-config", 16 ] 17 --- a/Cargo.toml 18 +++ b/Cargo.toml 19 + @@ -58,6 +58,7 @@ time-humanize = { version = "0.1.3", features = ["time"] } 20 + tokei = "12.1.2" 21 + toml = "0.5.9" 22 + yaml-rust = "0.4.5" 23 + +zstd = { version = "*", features = ["pkg-config"] } 24 25 + [target.'cfg(windows)'.dependencies] 26 + enable-ansi-support = "0.1.2"