about summary refs log tree commit diff
path: root/pkgs/applications/misc/evince/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/misc/evince/default.nix')
-rw-r--r--pkgs/applications/misc/evince/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/applications/misc/evince/default.nix b/pkgs/applications/misc/evince/default.nix
index f516e4fa337b..837930738e85 100644
--- a/pkgs/applications/misc/evince/default.nix
+++ b/pkgs/applications/misc/evince/default.nix
@@ -3,7 +3,9 @@
 , libgnome, libgnomeui, scrollkeeper, libxslt
 , libglade, dbus, dbus_glib
 , poppler, libspectre, djvulibre, shared_mime_info
-, makeWrapper, which }:
+, makeWrapper, which
+, recentListSize ? null # 5 is not enough, allow passing a different number
+}:
 
 stdenv.mkDerivation rec {
   name = "evince-2.26.0";
@@ -28,6 +30,11 @@ stdenv.mkDerivation rec {
     # Do not update Scrollkeeper's database (GNOME's help system).
     + "--disable-scrollkeeper";
 
+  postUnpack = if recentListSize != null then ''
+    sed -i 's/\(gtk_recent_chooser_set_limit .*\)5)/\1${builtins.toString recentListSize})/' */shell/ev-open-recent-action.c
+    sed -i 's/\(if (++n_items == \)5\(.*\)/\1${builtins.toString recentListSize}\2/' */shell/ev-window.c
+  '' else "";
+
   postInstall = ''
     # Tell Glib/GIO about the MIME info directory, which is used
     # by `g_file_info_get_content_type ()'.