From 5abb1856ce2276d975f24586d8b3895b0eaf02df Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Wed, 24 Nov 2021 22:57:25 +0100 Subject: [PATCH] haskell-modules/lib: make postFixup more resilient MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Putting the string on one line (instead of using a multiline string) means it is not ended with \n, which means if somebody wants to append more lines, they have to start it with \n or it will get concatenated to the `postFixup` here, so add \n. 2. Previously, ignoring `drv.postFixup` would throw away any `postFixup`s set in `drv`, which is not something we want. The extra empty line is a cute trick to prevent concatenating the code with any previous `postFixup` that doesn’t end in \n. --- pkgs/development/haskell-modules/lib/compose.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/lib/compose.nix b/pkgs/development/haskell-modules/lib/compose.nix index d84c804272db..065dc2dcad86 100644 --- a/pkgs/development/haskell-modules/lib/compose.nix +++ b/pkgs/development/haskell-modules/lib/compose.nix @@ -285,7 +285,11 @@ rec { enableLibraryProfiling = false; isLibrary = false; doHaddock = false; - postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc"; + postFixup = drv.postFixup or "" + '' + + # Remove every directory which could have links to other store paths. + rm -rf $out/lib $out/nix-support $out/share/doc + ''; }); /* Build a source distribution tarball instead of using the source files