1{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config, which
2, libxslt, libxml2, docbook_xml_dtd_412, docbook_xsl, glib, imagemagick
3, Foundation
4}:
5
6stdenv.mkDerivation rec {
7 version = "1.12.5";
8 pname = "chafa";
9
10 src = fetchFromGitHub {
11 owner = "hpjansson";
12 repo = "chafa";
13 rev = version;
14 sha256 = "sha256-2li2Vp+W4Q2/8WY8FJ519BuVR9KzddIJ1j/GY/hLMZo=";
15 };
16
17 nativeBuildInputs = [ autoconf
18 automake
19 libtool
20 pkg-config
21 which
22 libxslt
23 libxml2
24 docbook_xml_dtd_412
25 docbook_xsl
26 ];
27
28 buildInputs = [ glib imagemagick ]
29 ++ lib.optional stdenv.isDarwin Foundation;
30
31 patches = [ ./xmlcatalog_patch.patch ];
32
33 preConfigure = ''
34 substituteInPlace ./autogen.sh --replace pkg-config '$PKG_CONFIG'
35 NOCONFIGURE=1 ./autogen.sh
36 '';
37
38 configureFlags = [ "--enable-man"
39 "--with-xml-catalog=${docbook_xml_dtd_412}/xml/dtd/docbook/catalog.xml"
40 ];
41
42 meta = with lib; {
43 description = "Terminal graphics for the 21st century";
44 homepage = "https://hpjansson.org/chafa/";
45 license = licenses.lgpl3Plus;
46 platforms = platforms.all;
47 maintainers = [ maintainers.mog ];
48 };
49}