about summary refs log tree commit diff
path: root/pkgs/kde/gear/kdegraphics-thumbnailers
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/kde/gear/kdegraphics-thumbnailers')
-rw-r--r--pkgs/kde/gear/kdegraphics-thumbnailers/default.nix17
-rw-r--r--pkgs/kde/gear/kdegraphics-thumbnailers/gs-paths.patch22
2 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/kde/gear/kdegraphics-thumbnailers/default.nix b/pkgs/kde/gear/kdegraphics-thumbnailers/default.nix
new file mode 100644
index 000000000000..bfb3ba1fc850
--- /dev/null
+++ b/pkgs/kde/gear/kdegraphics-thumbnailers/default.nix
@@ -0,0 +1,17 @@
+{
+  mkKdeDerivation,
+  substituteAll,
+  ghostscript,
+}:
+mkKdeDerivation {
+  pname = "kdegraphics-thumbnailers";
+
+  patches = [
+    # Hardcode patches to Ghostscript so PDF thumbnails work OOTB.
+    # Intentionally not doing the same for dvips because TeX is big.
+    (substituteAll {
+      gs = "${ghostscript}/bin/gs";
+      src = ./gs-paths.patch;
+    })
+  ];
+}
diff --git a/pkgs/kde/gear/kdegraphics-thumbnailers/gs-paths.patch b/pkgs/kde/gear/kdegraphics-thumbnailers/gs-paths.patch
new file mode 100644
index 000000000000..5aa4a8d7444c
--- /dev/null
+++ b/pkgs/kde/gear/kdegraphics-thumbnailers/gs-paths.patch
@@ -0,0 +1,22 @@
+diff --git a/ps/gscreator.cpp b/ps/gscreator.cpp
+index 5b84e49..cbb7c25 100644
+--- a/ps/gscreator.cpp
++++ b/ps/gscreator.cpp
+@@ -101,7 +101,7 @@ static const char *epsprolog =
+     "[ ] 0 setdash newpath false setoverprint false setstrokeadjust\n";
+ 
+ static const char * gsargs_ps[] = {
+-    "gs",
++    "@gs@",
+     "-sDEVICE=png16m",
+     "-sOutputFile=-",
+     "-dSAFER",
+@@ -120,7 +120,7 @@ static const char * gsargs_ps[] = {
+ };
+ 
+ static const char * gsargs_eps[] = {
+-    "gs",
++    "@gs@",
+     "-sDEVICE=png16m",
+     "-sOutputFile=-",
+     "-dSAFER",