From f237e2b83e12a1eecc5e61c05ca3f1994469c9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 30 Oct 2022 22:01:11 +0100 Subject: [PATCH 1/2] onefetch: 2.12.0 -> 2.13.2 --- pkgs/tools/misc/onefetch/default.nix | 20 +++++++----- .../tools/misc/onefetch/zstd-pkg-config.patch | 31 ------------------- 2 files changed, 12 insertions(+), 39 deletions(-) delete mode 100644 pkgs/tools/misc/onefetch/zstd-pkg-config.patch diff --git a/pkgs/tools/misc/onefetch/default.nix b/pkgs/tools/misc/onefetch/default.nix index 18b585482026..e1d005d66431 100644 --- a/pkgs/tools/misc/onefetch/default.nix +++ b/pkgs/tools/misc/onefetch/default.nix @@ -2,6 +2,7 @@ , rustPlatform , lib , stdenv +, cmake , pkg-config , zstd , CoreFoundation @@ -12,27 +13,30 @@ rustPlatform.buildRustPackage rec { pname = "onefetch"; - version = "2.12.0"; + version = "2.13.2"; src = fetchFromGitHub { owner = "o2sh"; repo = pname; rev = "v${version}"; - sha256 = "sha256-nSvqAXzA/4CSnOMCZri2ks58bW+9v+SoyIIzb+K5S88="; + sha256 = "sha256-ydRdnzOI9syfF2ox9vHA9Q0j8C7ZNb0b7CJfqUprPA0="; }; - cargoPatches = [ - # enable pkg-config feature of zstd - ./zstd-pkg-config.patch - ]; - - cargoSha256 = "sha256-uSef6x5QkXKwajglbwyoIsUFGbz0zntVM1ko0FZqnck="; + cargoSha256 = "sha256-rZC1CAEWx8l1EQNRs1KAfVgGgBut1hxg6Ug4780O3dw="; nativeBuildInputs = [ pkg-config ]; buildInputs = [ zstd ] ++ lib.optionals stdenv.isDarwin [ CoreFoundation libiconv libresolv Security ]; + checkInputs = [ + cmake + ]; + + checkFlags = [ + "--skip=info::tests::test_style_subtitle" + ]; + meta = with lib; { description = "Git repository summary on your terminal"; homepage = "https://github.com/o2sh/onefetch"; diff --git a/pkgs/tools/misc/onefetch/zstd-pkg-config.patch b/pkgs/tools/misc/onefetch/zstd-pkg-config.patch deleted file mode 100644 index 24b95f1ca18b..000000000000 --- a/pkgs/tools/misc/onefetch/zstd-pkg-config.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/Cargo.lock b/Cargo.lock -index 202cda0..bc864cc 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -872,6 +872,7 @@ dependencies = [ - "tokei", - "toml", - "yaml-rust", -+ "zstd-sys", - ] - - [[package]] -@@ -1678,4 +1679,5 @@ checksum = "2141bed8922b427761470e6bbfeff255da94fa20b0bbeab0d9297fcaf71e3aa7" - dependencies = [ - "cc", - "libc", -+ "pkg-config", - ] -diff --git a/Cargo.toml b/Cargo.toml -index 8e0b5ff..48959b4 100644 ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -57,6 +57,8 @@ libc = "0.2.112" - [dev-dependencies] - more-asserts = "0.2" - paste = "1.0.7" -+# Specify that the indirect dependency ztsd-sys should pick up the system zstd C library -+zstd-sys = { version = "1", features = [ "pkg-config" ] } - - [features] - fail-on-deprecated = [] From 9071413f400781d7d460a7d45d3686eaa6d443ce Mon Sep 17 00:00:00 2001 From: figsoda Date: Sun, 6 Nov 2022 16:47:29 -0500 Subject: [PATCH 2/2] onefetch: minor improvements, add figsoda as a maintainer * add back the zstd-pkg-config patch * move cmake to nativeBuildInputs * fix test instead of skipping it --- pkgs/tools/misc/onefetch/default.nix | 33 ++++++++++++------- .../tools/misc/onefetch/zstd-pkg-config.patch | 26 +++++++++++++++ 2 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 pkgs/tools/misc/onefetch/zstd-pkg-config.patch diff --git a/pkgs/tools/misc/onefetch/default.nix b/pkgs/tools/misc/onefetch/default.nix index e1d005d66431..1792dd588f0e 100644 --- a/pkgs/tools/misc/onefetch/default.nix +++ b/pkgs/tools/misc/onefetch/default.nix @@ -1,14 +1,14 @@ -{ fetchFromGitHub +{ lib , rustPlatform -, lib -, stdenv +, fetchFromGitHub , cmake , pkg-config , zstd +, stdenv , CoreFoundation -, libiconv , libresolv , Security +, git }: rustPlatform.buildRustPackage rec { @@ -22,25 +22,34 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256-ydRdnzOI9syfF2ox9vHA9Q0j8C7ZNb0b7CJfqUprPA0="; }; - cargoSha256 = "sha256-rZC1CAEWx8l1EQNRs1KAfVgGgBut1hxg6Ug4780O3dw="; + cargoSha256 = "sha256-IprUSNxoojagXUO/I7WDGJMG0U541ioe4qgLT4hqmbY="; - nativeBuildInputs = [ pkg-config ]; + cargoPatches = [ + # enable pkg-config feature of zstd + ./zstd-pkg-config.patch + ]; + + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ zstd ] - ++ lib.optionals stdenv.isDarwin [ CoreFoundation libiconv libresolv Security ]; + ++ lib.optionals stdenv.isDarwin [ CoreFoundation libresolv Security ]; checkInputs = [ - cmake + git ]; - checkFlags = [ - "--skip=info::tests::test_style_subtitle" - ]; + preCheck = '' + git init + git config user.email nixbld@example.com + git add . + git commit -m test + ''; meta = with lib; { description = "Git repository summary on your terminal"; homepage = "https://github.com/o2sh/onefetch"; + changelog = "https://github.com/o2sh/onefetch/blob/v${version}/CHANGELOG.md"; license = licenses.mit; - maintainers = with maintainers; [ Br1ght0ne kloenk SuperSandro2000 ]; + maintainers = with maintainers; [ Br1ght0ne figsoda kloenk SuperSandro2000 ]; }; } diff --git a/pkgs/tools/misc/onefetch/zstd-pkg-config.patch b/pkgs/tools/misc/onefetch/zstd-pkg-config.patch new file mode 100644 index 000000000000..efe2482f9552 --- /dev/null +++ b/pkgs/tools/misc/onefetch/zstd-pkg-config.patch @@ -0,0 +1,26 @@ +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -2039,6 +2039,7 @@ dependencies = [ + "tokei", + "toml", + "yaml-rust", ++ "zstd", + ] + + [[package]] +@@ -3286,4 +3287,5 @@ checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" + dependencies = [ + "cc", + "libc", ++ "pkg-config", + ] +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -58,6 +58,7 @@ time-humanize = { version = "0.1.3", features = ["time"] } + tokei = "12.1.2" + toml = "0.5.9" + yaml-rust = "0.4.5" ++zstd = { version = "*", features = ["pkg-config"] } + + [target.'cfg(windows)'.dependencies] + enable-ansi-support = "0.1.2"