diff --git a/pkgs/tools/typesetting/sile/default.nix b/pkgs/tools/typesetting/sile/default.nix index 8cf45ea584c0..122f4304838b 100644 --- a/pkgs/tools/typesetting/sile/default.nix +++ b/pkgs/tools/typesetting/sile/default.nix @@ -108,8 +108,14 @@ stdenv.mkDerivation rec { --replace "ASSERT(ht && ht->table && iter);" "ASSERT(ht && iter);" ''; - # Hack to avoid TMPDIR in RPATHs. - preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" ''; + # remove forbidden references to $TMPDIR + preFixup = lib.optionalString stdenv.isLinux '' + for f in "$out"/bin/*; do + if isELF "$f"; then + patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f" + fi + done + ''; outputs = [ "out" "doc" "man" "dev" ];