yafc-ce: 2.6.0 -> 2.7.0 (#378873)
[NixPkgs.git] / pkgs / by-name / mo / mosh / package.nix
blob4777920be44d6e145547591dd56e6ad3d01100d1
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   zlib,
6   protobuf,
7   ncurses,
8   pkg-config,
9   makeWrapper,
10   perl,
11   openssl,
12   autoreconfHook,
13   openssh,
14   bash-completion,
15   fetchpatch,
16   withUtempter ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isMusl,
17   libutempter,
20 stdenv.mkDerivation rec {
21   pname = "mosh";
22   version = "1.4.0";
24   src = fetchFromGitHub {
25     owner = "mobile-shell";
26     repo = pname;
27     rev = "mosh-${version}";
28     hash = "sha256-tlSsHu7JnXO+sorVuWWubNUNdb9X0/pCaiGG5Y0X/g8=";
29   };
31   nativeBuildInputs = [
32     autoreconfHook
33     pkg-config
34     makeWrapper
35     protobuf
36     perl
37   ];
38   buildInputs = [
39     protobuf
40     ncurses
41     zlib
42     openssl
43     bash-completion
44     perl
45   ] ++ lib.optional withUtempter libutempter;
47   strictDeps = true;
49   enableParallelBuilding = true;
51   patches = [
52     ./ssh_path.patch
53     ./mosh-client_path.patch
54     # Fix build with bash-completion 2.10
55     ./bash_completion_datadir.patch
57     # Fixes build with protobuf3 23.x
58     (fetchpatch {
59       url = "https://github.com/mobile-shell/mosh/commit/eee1a8cf413051c2a9104e8158e699028ff56b26.patch";
60       hash = "sha256-CouLHWSsyfcgK3k7CvTK3FP/xjdb1pfsSXYYQj3NmCQ=";
61     })
62   ];
64   postPatch = ''
65     substituteInPlace scripts/mosh.pl \
66       --subst-var-by ssh "${openssh}/bin/ssh" \
67       --subst-var-by mosh-client "$out/bin/mosh-client"
68   '';
70   configureFlags = [ "--enable-completion" ] ++ lib.optional withUtempter "--with-utempter";
72   postInstall = ''
73     wrapProgram $out/bin/mosh --prefix PERL5LIB : $PERL5LIB
74   '';
76   meta = with lib; {
77     homepage = "https://mosh.org/";
78     description = "Mobile shell (ssh replacement)";
79     longDescription = ''
80       Remote terminal application that allows roaming, supports intermittent
81       connectivity, and provides intelligent local echo and line editing of
82       user keystrokes.
84       Mosh is a replacement for SSH. It's more robust and responsive,
85       especially over Wi-Fi, cellular, and long-distance links.
86     '';
87     license = licenses.gpl3Plus;
88     maintainers = with lib.maintainers; [ skeuchel ];
89     platforms = platforms.unix;
90   };