native build produces binaries with `#!${bash}/bin/sh` as shebang.
seems to be a consequence of nixpkgs using bash in the builder, and
`patchShebangs` sees that. OTOH cross builds would get `#!/bin/sh` because
the builder's bash isn't eligible as a runtime shebang. i can't say
which is most "correct" in the context of this tool, but shipping bash
in `buildInputs` where `patchShebangs` can see it at least gets us *consistency*.
Prevent xdg-open from silently failing to call mimeopen and falling back to
the browser whenever the mimetype doesn't have an explicitly set default
application.
- Add coreutils to PATH, because the xdg scripts use other not yet
provided coreutils like head.
This makes the custom 'cut' and 'sort' functions obsolete.
Remove double quotes around $out because $out contains no Bash field separators.
- Replace all instances of 'which' with 'type -P'.
The previous sed command only replaced instances with a leading space.
Before this change, xdg-open would impurely look up mimetype in the PATH. While
it would fall back to file if not found, mimetype gives decidedly better output
(e.g. text/csv instead of just text/plain).
Or else `xdg-screensaver suspend <WINDOW_ID>` fails with errors like:
Can't locate Net/DBus.pm in @INC [...]
This increases the closure of xdg-utils from 53 MiB to 119 MiB.
(The issue was found when testing retroarch.)
Fix#13904, close#13908.
Previously many messages got clobbered. Now it should be better.
The solution is still relatively hacky, but I don't see how to improve
it without doing lots of work.
Fixes regression introduced by 16406e63b3.
Not replacing "egrep" with a negated character class on [^e] needs to be
put back into the replacement, because if we have something like:
foo="$(grep xxx)"
The replacement would be something like this:
foo="$/nix/store/.../bin/grep xxx)"
Which will lead to wrong behavior and in cases of for example
"xdg-screensaver", even directly to a syntax error:
xdg-screensaver: line 178: syntax error near unexpected token `('
xdg-screensaver: line 178: `command="/nix/store/.../bin/grep -E
"^Exec(\[[^]=]*])?=" "$file" |
/nix/store/.../bin/cut -d= -f 2- |
first_word`"'
Signed-off-by: aszlig <aszlig@redmoonstudios.org>