lol
1{ stdenv, fetchurl, ncurses, python, which, groff, gettext, man_db, bc, libiconv, coreutils }:
2
3stdenv.mkDerivation rec {
4 name = "fish-${version}";
5 version = "2.2.0";
6
7 src = fetchurl {
8 url = "http://fishshell.com/files/${version}/${name}.tar.gz";
9 sha256 = "0ympqz7llmf0hafxwglykplw6j5cz82yhlrw50lw4bnf2kykjqx7";
10 };
11
12 buildInputs = [ ncurses libiconv ];
13
14 # Required binaries during execution
15 # Python: Autocompletion generated from manpages and config editing
16 propagatedBuildInputs = [ python which groff gettext ]
17 ++ stdenv.lib.optional (!stdenv.isDarwin) man_db
18 ++ [ bc coreutils ];
19
20 postInstall = ''
21 sed -e "s|bc|${bc}/bin/bc|" \
22 -e "s|/usr/bin/seq|${coreutils}/bin/seq|" \
23 -i "$out/share/fish/functions/seq.fish"
24 sed -i "s|which |${which}/bin/which |" "$out/share/fish/functions/type.fish"
25 sed -i "s|nroff |${groff}/bin/nroff |" "$out/share/fish/functions/__fish_print_help.fish"
26 sed -e "s|gettext |${gettext}/bin/gettext |" \
27 -e "s|which |${which}/bin/which |" \
28 -i "$out/share/fish/functions/_.fish"
29 '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
30 sed -i "s|Popen(\['manpath'|Popen(\['${man_db}/bin/manpath'|" "$out/share/fish/tools/create_manpage_completions.py"
31 '' + ''
32 sed -i "s|/sbin /usr/sbin||" \
33 "$out/share/fish/functions/__fish_complete_subcommand_root.fish"
34 '';
35
36 meta = with stdenv.lib; {
37 description = "Smart and user-friendly command line shell";
38 homepage = "http://fishshell.com/";
39 license = licenses.gpl2;
40 platforms = platforms.unix;
41 maintainers = with maintainers; [ ocharles ];
42 };
43}