@@ -1,4 +1,25 @@
1−{ stdenv, fetchurl, pkgconfig, gettext, gtk3, glib, libxml2, libsecret, poppler, itstool, hicolor-icon-theme, texlive, mate, wrapGAppsHook }:
1+{ stdenv
2+, fetchurl
3+, pkgconfig
4+, gettext
5+, gtk3
6+, glib
7+, libxml2
8+, libsecret
9+, poppler
10+, itstool
11+, hicolor-icon-theme
12+, texlive
13+, mate
14+, wrapGAppsHook
15+, enableEpub ? true, webkitgtk
16+, enableDjvu ? true, djvulibre
17+, enablePostScript ? true, libspectre
18+, enableXps ? true, libgxps
19+, enableImages ? false
20+}:
21+
22+with stdenv.lib;
223
324stdenv.mkDerivation rec {
425 pname = "atril";
@@ -26,7 +47,19 @@ stdenv.mkDerivation rec {
2647 mate.mate-desktop
2748 hicolor-icon-theme
2849 texlive.bin.core # for synctex, used by the pdf back-end
29− ];
50+ ]
51+ ++ optionals enableDjvu [ djvulibre ]
52+ ++ optionals enableEpub [ webkitgtk ]
53+ ++ optionals enablePostScript [ libspectre ]
54+ ++ optionals enableXps [ libgxps ]
55+ ;
56+
57+ configureFlags = [ ]
58+ ++ optionals (enableDjvu) [ "--enable-djvu" ]
59+ ++ optionals (enableEpub) [ "--enable-epub" ]
60+ ++ optionals (enablePostScript) [ "--enable-ps" ]
61+ ++ optionals (enableXps) [ "--enable-xps" ]
62+ ++ optionals (enableImages) [ "--enable-pixbuf" ];
3063
3164 NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
3265