haskell-modules/lib: make postFixup more resilient

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.
This commit is contained in:
Profpatsch 2021-11-24 22:57:25 +01:00 committed by sterni
parent 6bfe307457
commit 5abb1856ce

View file

@ -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