From 87d7169f5ce581372118a387748a503b740637c8 Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova <1962985+xworld21@users.noreply.github.com> Date: Sun, 5 Nov 2023 19:46:28 +0000 Subject: [PATCH] ghostscript: pad headers at link time to prevent install_name_tool failure on Darwin (#263833) --- pkgs/misc/ghostscript/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/ghostscript/default.nix b/pkgs/misc/ghostscript/default.nix index 013a35806267..b85e162efb72 100644 --- a/pkgs/misc/ghostscript/default.nix +++ b/pkgs/misc/ghostscript/default.nix @@ -122,7 +122,10 @@ stdenv.mkDerivation rec { doCheck = false; # don't build/install statically linked bin/gs - buildFlags = [ "so" ]; + buildFlags = [ "so" ] + # without -headerpad, the following error occurs on Darwin when compiling with X11 support (as of 10.02.0) + # error: install_name_tool: changing install names or rpaths can't be redone for: [...]libgs.dylib.10 (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names) + ++ lib.optional (x11Support && stdenv.isDarwin) "LDFLAGS=-headerpad_max_install_names"; installTargets = [ "soinstall" ]; postInstall = ''