Merge pull request #257112 from K900/kdegraphics-thumbnailers-ghostscript

libsForQt5.kdegraphics-thumbnailers: hardcode Ghostscript path

K900 6f3a0992 c1a53897

Changed files
+46 -15
pkgs
applications
+1 -1
pkgs/applications/kde/default.nix
···
kdebugsettings = callPackage ./kdebugsettings.nix {};
kdeconnect-kde = callPackage ./kdeconnect-kde.nix {};
kdegraphics-mobipocket = callPackage ./kdegraphics-mobipocket.nix {};
-
kdegraphics-thumbnailers = callPackage ./kdegraphics-thumbnailers.nix {};
+
kdegraphics-thumbnailers = callPackage ./kdegraphics-thumbnailers {};
kdenetwork-filesharing = callPackage ./kdenetwork-filesharing.nix {};
kdenlive = callPackage ./kdenlive {};
kdepim-addons = callPackage ./kdepim-addons.nix {};
-14
pkgs/applications/kde/kdegraphics-thumbnailers.nix
···
-
{
-
mkDerivation, lib, fetchpatch,
-
extra-cmake-modules, karchive, kio, libkexiv2, libkdcraw, kdegraphics-mobipocket
-
}:
-
-
mkDerivation {
-
pname = "kdegraphics-thumbnailers";
-
meta = {
-
license = [ lib.licenses.lgpl21 ];
-
maintainers = [ lib.maintainers.ttuegel ];
-
};
-
nativeBuildInputs = [ extra-cmake-modules ];
-
buildInputs = [ karchive kio libkexiv2 libkdcraw kdegraphics-mobipocket ];
-
}
+23
pkgs/applications/kde/kdegraphics-thumbnailers/default.nix
···
+
{
+
mkDerivation, lib, ghostscript, substituteAll,
+
extra-cmake-modules, karchive, kio, libkexiv2, libkdcraw, kdegraphics-mobipocket
+
}:
+
+
mkDerivation {
+
pname = "kdegraphics-thumbnailers";
+
meta = {
+
license = [ lib.licenses.lgpl21 ];
+
maintainers = [ lib.maintainers.ttuegel ];
+
};
+
nativeBuildInputs = [ extra-cmake-modules ];
+
buildInputs = [ karchive kio libkexiv2 libkdcraw kdegraphics-mobipocket ];
+
+
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;
+
})
+
];
+
}
+22
pkgs/applications/kde/kdegraphics-thumbnailers/gs-paths.patch
···
+
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",