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