tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
fish: 3.7.1 -> 4.0
r-vdp
11 months ago
3d484715
dd33ae51
+75
-27
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
fi
fish
disable_suid_test.patch
package.nix
+17
pkgs/by-name/fi/fish/disable_suid_test.patch
···
1
1
+
diff --git a/tests/checks/path.fish b/tests/checks/path.fish
2
2
+
index 62812571a..b0eebcd91 100644
3
3
+
--- a/tests/checks/path.fish
4
4
+
+++ b/tests/checks/path.fish
5
5
+
@@ -117,12 +117,6 @@ path filter --type file,dir --perm exec,write bin/fish .
6
6
+
# So it passes.
7
7
+
# CHECK: .
8
8
+
9
9
+
-mkdir -p sbin
10
10
+
-touch sbin/setuid-exe sbin/setgid-exe
11
11
+
-chmod u+s,a+x sbin/setuid-exe
12
12
+
-path filter --perm suid sbin/*
13
13
+
-# CHECK: sbin/setuid-exe
14
14
+
-
15
15
+
# On at least FreeBSD on our CI this fails with "permission denied".
16
16
+
# So we can't test it, and we fake the output instead.
17
17
+
if chmod g+s,a+x sbin/setgid-exe 2>/dev/null
+58
-27
pkgs/by-name/fi/fish/package.nix
···
1
1
{
2
2
stdenv,
3
3
lib,
4
4
-
fetchurl,
5
5
-
fetchpatch,
4
4
+
fetchFromGitHub,
6
5
coreutils,
7
7
-
which,
6
6
+
glibcLocales,
8
7
gnused,
9
8
gnugrep,
10
9
groff,
11
10
gawk,
12
11
man-db,
12
12
+
ninja,
13
13
getent,
14
14
libiconv,
15
15
pcre2,
16
16
+
pkg-config,
16
17
gettext,
17
18
ncurses,
18
19
python3,
20
20
+
cargo,
19
21
cmake,
20
22
fishPlugins,
21
23
procps,
24
24
+
rustc,
25
25
+
rustPlatform,
26
26
+
versionCheckHook,
22
27
23
28
# used to generate autocompletions from manpages and for configuration editing in the browser
24
29
usePython ? true,
···
143
148
144
149
fish = stdenv.mkDerivation rec {
145
150
pname = "fish";
146
146
-
version = "3.7.1";
151
151
+
version = "4.0.0";
147
152
148
148
-
src = fetchurl {
149
149
-
# There are differences between the release tarball and the tarball GitHub
150
150
-
# packages from the tag. Specifically, it comes with a file containing its
151
151
-
# version, which is used in `build_tools/git_version_gen.sh` to determine
152
152
-
# the shell's actual version (and what it displays when running `fish
153
153
-
# --version`), as well as the local documentation for all builtins (and
154
154
-
# maybe other things).
155
155
-
url = "https://github.com/fish-shell/fish-shell/releases/download/${version}/${pname}-${version}.tar.xz";
156
156
-
hash = "sha256-YUyfVkPNB5nfOROV+mu8NklCe7g5cizjsRTTu8GjslA=";
153
153
+
src = fetchFromGitHub {
154
154
+
owner = "fish-shell";
155
155
+
repo = "fish-shell";
156
156
+
tag = version;
157
157
+
hash = "sha256-BLbL5Tj3FQQCOeX5TWXMaxCpvdzZtKe5dDQi66uU/BM=";
158
158
+
};
159
159
+
160
160
+
env.FISH_BUILD_VERSION = version;
161
161
+
162
162
+
cargoDeps = rustPlatform.fetchCargoVendor {
163
163
+
inherit src;
164
164
+
hash = "sha256-j1HCj1iZ5ZV8nfMmJq5ggPD4s+5V8IretDdoz+G3wWU=";
157
165
};
158
166
159
167
patches = [
168
168
+
# This test fails if the nix sandbox gets created on a filesystem that's
169
169
+
# mounted with the nosuid option.
170
170
+
./disable_suid_test.patch
171
171
+
160
172
# We don’t want to run `/usr/libexec/path_helper` on nix-darwin,
161
173
# as it pulls in paths not tracked in the system configuration
162
174
# and messes up the order of `$PATH`. Upstream are unfortunately
···
173
185
# Fix FHS paths in tests
174
186
postPatch =
175
187
''
176
176
-
# src/fish_tests.cpp
177
177
-
sed -i 's|/bin/ls|${coreutils}/bin/ls|' src/fish_tests.cpp
178
178
-
sed -i 's|is_potential_path(L"/usr"|is_potential_path(L"/nix"|' src/fish_tests.cpp
179
179
-
sed -i 's|L"/bin/echo"|L"${coreutils}/bin/echo"|' src/fish_tests.cpp
180
180
-
sed -i 's|L"/bin/c"|L"${coreutils}/bin/c"|' src/fish_tests.cpp
181
181
-
sed -i 's|L"/bin/ca"|L"${coreutils}/bin/ca"|' src/fish_tests.cpp
182
182
-
# disable flakey test
183
183
-
sed -i '/{TEST_GROUP("history_races"), history_tests_t::test_history_races},/d' src/fish_tests.cpp
188
188
+
sed -i 's|"/bin/ls"|"${lib.getExe' coreutils "ls"}"|' src/builtins/tests/test_tests.rs
189
189
+
sed -i 's|"/bin/echo"|"${lib.getExe' coreutils "echo"}"|' src/tests/highlight.rs
190
190
+
sed -i 's|"/bin/c"|"${lib.getExe' coreutils "c"}"|' src/tests/highlight.rs
191
191
+
sed -i 's|"/bin/ca"|"${lib.getExe' coreutils "ca"}"|' src/tests/highlight.rs
192
192
+
193
193
+
sed -i 's|/usr|/build|' src/tests/highlight.rs
184
194
185
195
# tests/checks/cd.fish
186
196
sed -i 's|/bin/pwd|${coreutils}/bin/pwd|' tests/checks/cd.fish
···
224
234
];
225
235
strictDeps = true;
226
236
nativeBuildInputs = [
237
237
+
cargo
227
238
cmake
228
239
gettext
240
240
+
ninja
241
241
+
pkg-config
242
242
+
rustc
243
243
+
rustPlatform.cargoSetupHook
229
244
];
230
245
231
246
buildInputs = [
232
232
-
ncurses
233
247
libiconv
234
248
pcre2
235
249
];
···
255
269
preConfigure =
256
270
''
257
271
patchShebangs ./build_tools/git_version_gen.sh
272
272
+
patchShebangs ./tests/test_driver.py
258
273
''
259
274
+ lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
260
275
export CMAKE_PREFIX_PATH=
···
273
288
274
289
nativeCheckInputs = [
275
290
coreutils
291
291
+
glibcLocales
276
292
(python3.withPackages (ps: [ ps.pexpect ]))
277
293
procps
278
294
];
279
295
280
280
-
checkPhase = ''
281
281
-
make test
296
296
+
checkTarget = "fish_run_tests";
297
297
+
preCheck = ''
298
298
+
export TERMINFO="${ncurses}/share/terminfo"
299
299
+
'';
300
300
+
301
301
+
nativeInstallCheckInputs = [
302
302
+
versionCheckHook
303
303
+
];
304
304
+
versionCheckProgramArg = [ "--version" ];
305
305
+
doInstallCheck = true;
306
306
+
307
307
+
# Ensure that we don't vendor libpcre2, but instead link against the one from nixpkgs
308
308
+
installCheckPhase = lib.optionalString (stdenv.hostPlatform.libc == "glibc") ''
309
309
+
runHook preInstallCheck
310
310
+
311
311
+
echo "Checking that we don't vendor pcre2"
312
312
+
ldd "$out/bin/fish" | grep ${lib.getLib pcre2}
313
313
+
314
314
+
runHook postInstallCheck
282
315
'';
283
316
284
317
postInstall =
···
295
328
"$out/share/fish/functions/prompt_pwd.fish"
296
329
sed -i "s|nroff|${groff}/bin/nroff|" \
297
330
"$out/share/fish/functions/__fish_print_help.fish"
298
298
-
sed -e "s|clear;|${lib.getBin ncurses}/bin/clear;|" \
299
299
-
-i "$out/share/fish/functions/fish_default_key_bindings.fish"
300
331
sed -i "s|/usr/local/sbin /sbin /usr/sbin||" \
301
332
$out/share/fish/completions/{sudo.fish,doas.fish}
302
333
sed -e "s| awk | ${gawk}/bin/awk |" \
···
366
397
# if we don't set `delete=False`, the file will get cleaned up
367
398
# automatically (leading the test to fail because there's no
368
399
# tempfile to check)
369
369
-
${lib.getExe gnused} -e 's@, mode="w"@, mode="w", delete=False@' -i webconfig.py
400
400
+
${lib.getExe gnused} -e 's@delete=True,@delete=False,@' -i webconfig.py
370
401
371
402
# we delete everything after the fileurl is assigned
372
403
${lib.getExe gnused} -e '/fileurl =/q' -i webconfig.py