From e382759c2275514bea34e40159aa1fe6af170714 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Tue, 31 Dec 2024 18:06:36 +0700 Subject: [PATCH 1/3] chafa: enable support for avif, jxl and svg image formats --- pkgs/tools/misc/chafa/default.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/misc/chafa/default.nix b/pkgs/tools/misc/chafa/default.nix index 23954dc675966..b2b4764b9708c 100644 --- a/pkgs/tools/misc/chafa/default.nix +++ b/pkgs/tools/misc/chafa/default.nix @@ -7,12 +7,14 @@ libtool, pkg-config, which, + libavif, + libjxl, + librsvg, libxslt, libxml2, docbook_xml_dtd_412, docbook_xsl, glib, - imagemagick, Foundation, }: @@ -33,16 +35,16 @@ stdenv.mkDerivation rec { libtool pkg-config which + libavif + libjxl + librsvg libxslt libxml2 docbook_xml_dtd_412 docbook_xsl ]; - buildInputs = [ - glib - imagemagick - ] ++ lib.optional stdenv.hostPlatform.isDarwin Foundation; + buildInputs = [ glib ] ++ lib.optional stdenv.hostPlatform.isDarwin Foundation; patches = [ ./xmlcatalog_patch.patch ]; @@ -56,9 +58,6 @@ stdenv.mkDerivation rec { "--with-xml-catalog=${docbook_xml_dtd_412}/xml/dtd/docbook/catalog.xml" ]; - # https://github.com/NixOS/nixpkgs/pull/240893#issuecomment-1635347507 - NIX_LDFLAGS = [ "-lwebp" ]; - meta = with lib; { description = "Terminal graphics for the 21st century"; homepage = "https://hpjansson.org/chafa/"; From 7bd5454338829c8349400cee8a5a64258203abd9 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Tue, 31 Dec 2024 18:09:51 +0700 Subject: [PATCH 2/3] chafa: install zsh completion --- pkgs/tools/misc/chafa/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/misc/chafa/default.nix b/pkgs/tools/misc/chafa/default.nix index b2b4764b9708c..31bb0f58c266d 100644 --- a/pkgs/tools/misc/chafa/default.nix +++ b/pkgs/tools/misc/chafa/default.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + installShellFiles, autoconf, automake, libtool, @@ -42,6 +43,7 @@ stdenv.mkDerivation rec { libxml2 docbook_xml_dtd_412 docbook_xsl + installShellFiles ]; buildInputs = [ glib ] ++ lib.optional stdenv.hostPlatform.isDarwin Foundation; @@ -58,6 +60,10 @@ stdenv.mkDerivation rec { "--with-xml-catalog=${docbook_xml_dtd_412}/xml/dtd/docbook/catalog.xml" ]; + postInstall = '' + installShellCompletion --cmd chafa tools/completions/zsh-completion.zsh + ''; + meta = with lib; { description = "Terminal graphics for the 21st century"; homepage = "https://hpjansson.org/chafa/"; From a2e3667ec7219c4cc1fcea333ed5cfae2da2af5a Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Tue, 31 Dec 2024 18:10:28 +0700 Subject: [PATCH 3/3] chafa: split into multiple outputs --- pkgs/tools/misc/chafa/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/tools/misc/chafa/default.nix b/pkgs/tools/misc/chafa/default.nix index 31bb0f58c266d..8904b4cb9345f 100644 --- a/pkgs/tools/misc/chafa/default.nix +++ b/pkgs/tools/misc/chafa/default.nix @@ -30,6 +30,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-9RkN0yZnHf5cx6tsp3P6jsi0/xtplWxMm3hYCPjWj0M="; }; + outputs = [ + "bin" + "dev" + "man" + "out" + ]; + nativeBuildInputs = [ autoconf automake