Merge pull request #86136 from cole-h/fish

fish: 3.1.0 -> 3.1.1
This commit is contained in:
adisbladis 2020-04-28 14:34:01 +02:00 committed by GitHub
commit f0fbce6673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 84 additions and 55 deletions

View File

@ -1,20 +1,27 @@
{ stdenv, fetchurl, coreutils, utillinux, { stdenv
which, gnused, gnugrep, , lib
groff, man-db, getent, libiconv, pcre2, , fetchurl
gettext, ncurses, python3, , coreutils
cmake , utillinux
, fetchpatch , which
, gnused
, writeText , gnugrep
, nixosTests , groff
, useOperatingSystemEtc ? true , man-db
, getent
, libiconv
, pcre2
, gettext
, ncurses
, python3
, cmake
, writeText
, nixosTests
, useOperatingSystemEtc ? true
}: }:
with stdenv.lib;
let let
etcConfigAppendixText = '' etcConfigAppendix = writeText "config.fish.appendix" ''
############### ↓ Nix hook for sourcing /etc/fish/config.fish ↓ ############### ############### ↓ Nix hook for sourcing /etc/fish/config.fish ↓ ###############
# # # #
# Origin: # Origin:
@ -46,7 +53,7 @@ let
############### ↑ Nix hook for sourcing /etc/fish/config.fish ↑ ############### ############### ↑ Nix hook for sourcing /etc/fish/config.fish ↑ ###############
''; '';
fishPreInitHooks = '' fishPreInitHooks = writeText "__fish_build_paths_suffix.fish" ''
# source nixos environment # source nixos environment
# note that this is required: # note that this is required:
# 1. For all shells, not just login shells (mosh needs this as do some other command-line utilities) # 1. For all shells, not just login shells (mosh needs this as do some other command-line utilities)
@ -90,40 +97,49 @@ let
fish = stdenv.mkDerivation rec { fish = stdenv.mkDerivation rec {
pname = "fish"; pname = "fish";
version = "3.1.0"; version = "3.1.1";
etcConfigAppendix = builtins.toFile "etc-config.appendix.fish" etcConfigAppendixText;
src = fetchurl { src = fetchurl {
# There are differences between the release tarball and the tarball github packages from the tag # There are differences between the release tarball and the tarball GitHub
# Hence we cannot use fetchFromGithub # packages from the tag. Specifically, it comes with a file containing its
# version, which is used in `build_tools/git_version_gen.sh` to determine
# the shell's actual version (and what it displays when running `fish
# --version`), as well as the local documentation for all builtins (and
# maybe other things).
url = "https://github.com/fish-shell/fish-shell/releases/download/${version}/${pname}-${version}.tar.gz"; url = "https://github.com/fish-shell/fish-shell/releases/download/${version}/${pname}-${version}.tar.gz";
sha256 = "0s2356mlx7fp9kgqgw91lm5ds2i9iq9hq071fbqmcp3875l1xnz5"; sha256 = "1f12c56v7n4s0f9mi9xinviwj6kpwlcjwaig1d4vsk5wlgp7ip07";
}; };
nativeBuildInputs = [ cmake ]; # We don't have access to the codesign executable, so we patch this out.
buildInputs = [ ncurses libiconv pcre2 ]; # For more information, see: https://github.com/fish-shell/fish-shell/issues/6952
patches = lib.optional stdenv.isDarwin ./dont-codesign-on-mac.diff;
nativeBuildInputs = [
cmake
];
buildInputs = [
ncurses
libiconv
pcre2
];
preConfigure = '' preConfigure = ''
patchShebangs ./build_tools/git_version_gen.sh patchShebangs ./build_tools/git_version_gen.sh
''; '';
patches = [
# Fixes compilation on old Apple SDKs
(fetchpatch {
url = "https://github.com/fish-shell/fish-shell/commit/10385d422b3e2a823faebfdaf13edd0e7f48a27f.patch";
sha256 = "0hj13kyjf5wr9j5afd4mfylcr7mz68ilbncbcf307drk1lv1lvrn";
})
];
# Required binaries during execution # Required binaries during execution
# Python: Autocompletion generated from manpages and config editing # Python: Autocompletion generated from manpages and config editing
propagatedBuildInputs = [ propagatedBuildInputs = [
coreutils gnugrep gnused coreutils
python3 groff gettext gnugrep
] ++ optional (!stdenv.isDarwin) man-db; gnused
python3
groff
gettext
] ++ lib.optional (!stdenv.isDarwin) man-db;
postInstall = '' postInstall = with lib; ''
sed -r "s|command grep|command ${gnugrep}/bin/grep|" \ sed -r "s|command grep|command ${gnugrep}/bin/grep|" \
-i "$out/share/fish/functions/grep.fish" -i "$out/share/fish/functions/grep.fish"
sed -i "s|which |${which}/bin/which |" \ sed -i "s|which |${which}/bin/which |" \
@ -169,14 +185,14 @@ let
sed -i "s|command manpath|command ${man-db}/bin/manpath|" \ sed -i "s|command manpath|command ${man-db}/bin/manpath|" \
"$out/share/fish/functions/man.fish" "$out/share/fish/functions/man.fish"
'' + optionalString useOperatingSystemEtc '' '' + optionalString useOperatingSystemEtc ''
tee -a $out/etc/fish/config.fish < ${(writeText "config.fish.appendix" etcConfigAppendixText)} tee -a $out/etc/fish/config.fish < ${etcConfigAppendix}
'' + '' '' + ''
tee -a $out/share/fish/__fish_build_paths.fish < ${(writeText "__fish_build_paths_suffix.fish" fishPreInitHooks)} tee -a $out/share/fish/__fish_build_paths.fish < ${fishPreInitHooks}
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
meta = with stdenv.lib; { meta = with lib; {
description = "Smart and user-friendly command line shell"; description = "Smart and user-friendly command line shell";
homepage = "http://fishshell.com/"; homepage = "http://fishshell.com/";
license = licenses.gpl2; license = licenses.gpl2;
@ -195,21 +211,22 @@ let
# Test the fish_config tool by checking the generated splash page. # Test the fish_config tool by checking the generated splash page.
# Since the webserver requires a port to run, it is not started. # Since the webserver requires a port to run, it is not started.
fishConfig = fishConfig =
let fishScript = writeText "test.fish" '' let
set -x __fish_bin_dir ${fish}/bin fishScript = writeText "test.fish" ''
echo $__fish_bin_dir set -x __fish_bin_dir ${fish}/bin
cp -r ${fish}/share/fish/tools/web_config/* . echo $__fish_bin_dir
chmod -R +w * cp -r ${fish}/share/fish/tools/web_config/* .
# we delete everything after the fileurl is assigned chmod -R +w *
sed -e '/fileurl =/q' -i webconfig.py # we delete everything after the fileurl is assigned
echo "print(fileurl)" >> webconfig.py sed -e '/fileurl =/q' -i webconfig.py
# and check whether the message appears on the page echo "print(fileurl)" >> webconfig.py
cat (${python3}/bin/python ./webconfig.py \ # and check whether the message appears on the page
| tail -n1 | sed -ne 's|.*\(/tmp/.*\)|\1|p' \ cat (${python3}/bin/python ./webconfig.py \
) | grep 'a href="http://localhost.*Start the Fish Web config' | tail -n1 | sed -ne 's|.*\(/tmp/.*\)|\1|p' \
) | grep 'a href="http://localhost.*Start the Fish Web config'
# cannot test the http server because it needs a localhost port # cannot test the http server because it needs a localhost port
''; '';
in '' in ''
HOME=$(mktemp -d) HOME=$(mktemp -d)
${fish}/bin/fish ${fishScript} ${fish}/bin/fish ${fishScript}
@ -217,6 +234,6 @@ let
}; };
# FIXME(Profpatsch) replace withTests stub # FIXME(Profpatsch) replace withTests stub
withTests = flip const; withTests = with lib; flip const;
in
in withTests tests fish withTests tests fish

View File

@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d220a032..786b60e6e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -183,7 +183,6 @@ ENDFUNCTION(CODESIGN_ON_MAC target)
# Define a function to link dependencies.
FUNCTION(FISH_LINK_DEPS_AND_SIGN target)
TARGET_LINK_LIBRARIES(${target} fishlib)
- CODESIGN_ON_MAC(${target})
ENDFUNCTION(FISH_LINK_DEPS_AND_SIGN)
# Define libfish.a.