···
195
-
sed -i 's|"/bin/ls"|"${lib.getExe' coreutils "ls"}"|' src/builtins/tests/test_tests.rs
196
-
sed -i 's|"/bin/echo"|"${lib.getExe' coreutils "echo"}"|' src/tests/highlight.rs
197
-
sed -i 's|"/bin/c"|"${lib.getExe' coreutils "c"}"|' src/tests/highlight.rs
198
-
sed -i 's|"/bin/ca"|"${lib.getExe' coreutils "ca"}"|' src/tests/highlight.rs
195
+
substituteInPlace src/builtins/tests/test_tests.rs \
196
+
--replace-fail '"/bin/ls"' '"${lib.getExe' coreutils "ls"}"'
200
-
sed -i 's|/usr|/|' src/tests/highlight.rs
198
+
substituteInPlace src/tests/highlight.rs \
199
+
--replace-fail '"/bin/echo"' '"${lib.getExe' coreutils "echo"}"' \
200
+
--replace-fail '"/bin/c"' '"${lib.getExe' coreutils "c"}"' \
201
+
--replace-fail '"/bin/ca"' '"${lib.getExe' coreutils "ca"}"' \
202
+
--replace-fail '/usr' '/'
202
-
# tests/checks/cd.fish
203
-
sed -i 's|/bin/pwd|${lib.getExe' coreutils "pwd"}|' tests/checks/cd.fish
204
+
substituteInPlace tests/checks/cd.fish \
205
+
--replace-fail '/bin/pwd' '${lib.getExe' coreutils "pwd"}'
205
-
# tests/checks/redirect.fish
206
-
sed -i 's|/bin/echo|${lib.getExe' coreutils "echo"}|' tests/checks/redirect.fish
207
+
substituteInPlace tests/checks/redirect.fish \
208
+
--replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}'
208
-
# tests/checks/vars_as_commands.fish
209
-
sed -i 's|/usr/bin|${coreutils}/bin|' tests/checks/vars_as_commands.fish
210
+
substituteInPlace tests/checks/vars_as_commands.fish \
211
+
--replace-fail '/usr/bin' '${coreutils}/bin'
211
-
# tests/checks/jobs.fish
212
-
sed -i 's|ps -o stat|${lib.getExe' procps "ps"} -o stat|' tests/checks/jobs.fish
213
-
sed -i 's|/bin/echo|${lib.getExe' coreutils "echo"}|' tests/checks/jobs.fish
213
+
substituteInPlace tests/checks/jobs.fish \
214
+
--replace-fail 'ps -o' '${lib.getExe' procps "ps"} -o' \
215
+
--replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}'
215
-
# tests/checks/job-control-noninteractive.fish
216
-
sed -i 's|/bin/echo|${lib.getExe' coreutils "echo"}|' tests/checks/job-control-noninteractive.fish
217
+
substituteInPlace tests/checks/job-control-noninteractive.fish \
218
+
--replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}'
218
-
# tests/checks/complete.fish
219
-
sed -i 's|/bin/ls|${lib.getExe' coreutils "ls"}|' tests/checks/complete.fish
220
+
substituteInPlace tests/checks/complete.fish \
221
+
--replace-fail '/bin/ls' '${lib.getExe' coreutils "ls"}'
221
-
# pexpect tests are flaky
223
+
# Several pexpect tests are flaky
# See https://github.com/fish-shell/fish-shell/issues/8789
rm tests/pexpects/exit_handlers.py
rm tests/pexpects/private_mode.py
···
339
-
sed -r "s|command grep|command ${lib.getExe gnugrep}|" \
340
-
-i "$out/share/fish/functions/grep.fish"
341
-
sed -e "s|\|cut|\|${lib.getExe' coreutils "cut"}|" \
342
-
-i "$out/share/fish/functions/fish_prompt.fish"
343
-
sed -e "s|uname|${lib.getExe' coreutils "uname"}|" \
344
-
-i "$out/share/fish/functions/__fish_pwd.fish" \
345
-
"$out/share/fish/functions/prompt_pwd.fish"
346
-
sed -e "s|sed |${lib.getExe gnused} |" \
347
-
-i "$out/share/fish/functions/alias.fish" \
348
-
"$out/share/fish/functions/prompt_pwd.fish"
349
-
sed -i "s|nroff|${lib.getExe' groff "nroff"}|" \
350
-
"$out/share/fish/functions/__fish_print_help.fish"
351
-
sed -i "s|/usr/local/sbin /sbin /usr/sbin||" \
352
-
$out/share/fish/completions/{sudo.fish,doas.fish}
353
-
sed -e "s| awk | ${lib.getExe' gawk "awk"} |" \
354
-
-i $out/share/fish/functions/{__fish_print_packages.fish,__fish_print_addresses.fish,__fish_describe_command.fish,__fish_complete_man.fish,__fish_complete_convert_options.fish} \
355
-
$out/share/fish/completions/{cwebp,adb,ezjail-admin,grunt,helm,heroku,lsusb,make,p4,psql,rmmod,vim-addons}.fish
341
+
substituteInPlace "$out/share/fish/functions/grep.fish" \
342
+
--replace-fail "command grep" "command ${lib.getExe gnugrep}"
344
+
substituteInPlace "$out/share/fish/functions/__fish_print_help.fish" \
345
+
--replace-fail "nroff" "${lib.getExe' groff "nroff"}"
347
+
substituteInPlace $out/share/fish/completions/{sudo.fish,doas.fish} \
348
+
--replace-fail "/usr/local/sbin /sbin /usr/sbin" ""
+ lib.optionalString usePython ''
cat > $out/share/fish/functions/__fish_anypython.fish <<EOF
···
+ lib.optionalString stdenv.hostPlatform.isLinux ''
for cur in $out/share/fish/functions/*.fish; do
369
-
sed -e "s|/usr/bin/getent|${lib.getExe getent}|" \
360
+
substituteInPlace "$cur" \
361
+
--replace-quiet '/usr/bin/getent' '${lib.getExe getent}' \
362
+
--replace-quiet 'awk' '${lib.getExe' gawk "awk"}'
374
-
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
375
-
sed -i "s|Popen(\['manpath'|Popen(\['${lib.getExe' man-db "manpath"}'|" \
376
-
"$out/share/fish/tools/create_manpage_completions.py"
377
-
sed -i "s|command manpath|command ${lib.getExe' man-db "manpath"}|" \
378
-
"$out/share/fish/functions/man.fish"
364
+
for cur in $out/share/fish/completions/*.fish; do
365
+
substituteInPlace "$cur" \
366
+
--replace-quiet 'awk' '${lib.getExe' gawk "awk"}'
+ lib.optionalString useOperatingSystemEtc ''
tee -a $out/etc/fish/config.fish < ${etcConfigAppendix}