base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / ev / evince / package.nix
blob065613a6d7af77f3c785b24c76f0881966e66498
1 { lib
2 , stdenv
3 , fetchurl
4 , meson
5 , ninja
6 , pkg-config
7 , gettext
8 , libxml2
9 , appstream
10 , desktop-file-utils
11 , glib
12 , gtk3
13 , pango
14 , atk
15 , gdk-pixbuf
16 , shared-mime-info
17 , itstool
18 , gnome
19 , poppler
20 , ghostscriptX
21 , djvulibre
22 , libspectre
23 , libarchive
24 , libgxps
25 , libhandy
26 , libsecret
27 , wrapGAppsHook3
28 , librsvg
29 , gobject-introspection
30 , yelp-tools
31 , gspell
32 , gsettings-desktop-schemas
33 , gnome-desktop
34 , dbus
35 , texlive
36 , gst_all_1
37 , gi-docgen
38 , supportMultimedia ? true # PDF multimedia
39 , withLibsecret ? true
42 stdenv.mkDerivation (finalAttrs: {
43   pname = "evince";
44   version = "46.3.1";
46   outputs = [ "out" "dev" "devdoc" ];
48   src = fetchurl {
49     url = "mirror://gnome/sources/evince/${lib.versions.major finalAttrs.version}/evince-${finalAttrs.version}.tar.xz";
50     hash = "sha256-lFwgpvI4ObDVMycpFxRY6QaA2oJk6Zxvn0HCGcfu7nw=";
51   };
53   depsBuildBuild = [
54     pkg-config
55   ];
57   nativeBuildInputs = [
58     appstream
59     desktop-file-utils
60     gettext
61     gobject-introspection
62     gi-docgen
63     itstool
64     meson
65     ninja
66     pkg-config
67     wrapGAppsHook3
68     yelp-tools
69   ];
71   buildInputs = [
72     atk
73     dbus # only needed to find the service directory
74     djvulibre
75     gdk-pixbuf
76     ghostscriptX
77     glib
78     gnome-desktop
79     gsettings-desktop-schemas
80     gspell
81     gtk3
82     libarchive
83     libgxps
84     libhandy
85     librsvg
86     libspectre
87     libxml2
88     pango
89     poppler
90     texlive.bin.core # kpathsea for DVI support
91   ] ++ lib.optionals withLibsecret [
92     libsecret
93   ] ++ lib.optionals supportMultimedia (with gst_all_1; [
94     gstreamer
95     gst-plugins-base
96     gst-plugins-good
97     gst-plugins-bad
98     gst-plugins-ugly
99     gst-libav
100   ]);
102   mesonFlags = [
103     "-Dnautilus=false"
104     "-Dps=enabled"
105   ] ++ lib.optionals (!withLibsecret) [
106     "-Dkeyring=disabled"
107   ] ++ lib.optionals (!supportMultimedia) [
108     "-Dmultimedia=disabled"
109   ];
111   preFixup = ''
112     gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${shared-mime-info}/share")
113   '';
115   postFixup = ''
116     # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
117     moveToOutput "share/doc" "$devdoc"
118   '';
120   passthru = {
121     updateScript = gnome.updateScript {
122       packageName = "evince";
123     };
124   };
126   meta = with lib; {
127     homepage = "https://apps.gnome.org/Evince/";
128     description = "GNOME's document viewer";
130     longDescription = ''
131       Evince is a document viewer for multiple document formats.  It
132       currently supports PDF, PostScript, DjVu, TIFF and DVI.  The goal
133       of Evince is to replace the multiple document viewers that exist
134       on the GNOME Desktop with a single simple application.
135     '';
137     license = licenses.gpl2Plus;
138     platforms = platforms.unix;
139     mainProgram = "evince";
140     maintainers = teams.gnome.members ++ teams.pantheon.members;
141   };