From e1b4c1f7bdf9a568c034839998a2dd37671ded5d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 7 Dec 2022 12:19:51 +0100 Subject: [PATCH 1/3] ghostscript_headless: init --- pkgs/top-level/all-packages.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 734cb670af49a..e9b4d188a1da5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -36639,6 +36639,11 @@ with pkgs; x11Support = true; }; + ghostscript_headless = ghostscript.override { + cupsSupport = false; + x11Support = false; + }; + glava = callPackage ../applications/misc/glava {}; gnuk = callPackage ../misc/gnuk { From d896fa5370e423b5d7dd5b51ffb12620c5da813e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 7 Dec 2022 12:19:39 +0100 Subject: [PATCH 2/3] texlive: Use ghostscriptX -> ghostscript_headless The code and typical use case suggest that ghostscript is not used graphically. Removing this dependency reduces the build closure of many tools that use texlive for documentation. If this needs to be reverted, please state the graphical use case in a comment, so we don't make this mistake again. --- pkgs/tools/typesetting/tex/texlive/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index e58bdde501a62..180897e0bce26 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -3,7 +3,7 @@ - current html: https://nixos.org/nixpkgs/manual/#sec-language-texlive */ { stdenv, lib, fetchurl, runCommand, writeText, buildEnv -, callPackage, ghostscriptX, harfbuzz +, callPackage, ghostscript_headless, harfbuzz , makeWrapper, python3, ruby, perl, gnused, gnugrep, coreutils , libfaketime , useFixedHashes ? true @@ -12,7 +12,7 @@ let # various binaries (compiled) bin = callPackage ./bin.nix { - ghostscript = ghostscriptX; + ghostscript = ghostscript_headless; harfbuzz = harfbuzz.override { withIcu = true; withGraphite2 = true; }; @@ -25,7 +25,7 @@ let combine = import ./combine.nix { inherit bin combinePkgs buildEnv lib makeWrapper writeText stdenv python3 ruby perl gnused gnugrep coreutils libfaketime; - ghostscript = ghostscriptX; # could be without X, probably, but we use X above + ghostscript = ghostscript_headless; }; # the set of TeX Live packages, collections, and schemes; using upstream naming From 64c6e21de5a3eb05303912eec356d9e1b6727119 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 7 Dec 2022 12:20:09 +0100 Subject: [PATCH 3/3] matplotlib: Use ghostscript_headless matplotlib does not seem to use ghostscript in its graphical / interactive capacity, based on quick scan through the docs and github code search. If this needs to be reverted, please state the graphical use case in a comment, so we don't make this mistake again. --- pkgs/top-level/python-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 99221acb73b18..705d12f26414d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5594,6 +5594,7 @@ self: super: with self; { matplotlib = callPackage ../development/python-modules/matplotlib { stdenv = if stdenv.isDarwin then pkgs.clangStdenv else pkgs.stdenv; inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa; + ghostscript = pkgs.ghostscript_headless; }; matplotlib-inline = callPackage ../development/python-modules/matplotlib-inline { };