aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/tools/networking/mosh')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/bash_completion_datadir.patch19
-rw-r--r--infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/default.nix60
-rw-r--r--infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/ssh_path.patch13
-rw-r--r--infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/utempter_path.patch14
4 files changed, 106 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/bash_completion_datadir.patch b/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/bash_completion_datadir.patch
new file mode 100644
index 000000000000..4b71f125d287
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/bash_completion_datadir.patch
@@ -0,0 +1,19 @@
+diff --git a/configure.ac b/configure.ac
+index 3ad983d..ff8ff96 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -476,13 +476,7 @@ AS_IF([echo "$protobuf_LIBS" | grep -q -- -pthread],
+
+ # Bash completion needs to ask where it goes if >= 2.0 is installed.
+ AS_IF([test "$install_completion" != no],
+- [PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
+- [if test "$prefix" = "NONE"; then
+- completions="`pkg-config --variable=completionsdir bash-completion`"
+- else
+- completions="`pkg-config --define-variable=prefix=$prefix --variable=completionsdir bash-completion`"
+- fi],
+- [completions="${sysconfdir}/bash_completion.d"])
++ [completions="`pkg-config --define-variable=datadir=$datadir --variable=completionsdir bash-completion`"]
+ AC_SUBST([completions])])
+
+ AC_CONFIG_FILES([
diff --git a/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/default.nix
new file mode 100644
index 000000000000..dba75400f6fa
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv, fetchurl, fetchpatch, zlib, protobuf, ncurses, pkgconfig
+, makeWrapper, perlPackages, openssl, autoreconfHook, openssh, bash-completion
+, libutempter ? null, withUtempter ? stdenv.isLinux }:
+
+stdenv.mkDerivation rec {
+ pname = "mosh";
+ version = "1.3.2";
+
+ src = fetchurl {
+ url = "https://mosh.org/mosh-${version}.tar.gz";
+ sha256 = "05hjhlp6lk8yjcy59zywpf0r6s0h0b9zxq0lw66dh9x8vxrhaq6s";
+ };
+
+ nativeBuildInputs = [ autoreconfHook pkgconfig ];
+ buildInputs = [ protobuf ncurses zlib makeWrapper openssl bash-completion ]
+ ++ (with perlPackages; [ perl IOTty ])
+ ++ lib.optional withUtempter libutempter;
+
+ enableParallelBuilding = true;
+
+ patches = [
+ ./ssh_path.patch
+ ./utempter_path.patch
+ # Fix w/c++17, ::bind vs std::bind
+ (fetchpatch {
+ url = "https://github.com/mobile-shell/mosh/commit/e5f8a826ef9ff5da4cfce3bb8151f9526ec19db0.patch";
+ sha256 = "15518rb0r5w1zn4s6981bf1sz6ins6gpn2saizfzhmr13hw4gmhm";
+ })
+ # Fix build with bash-completion 2.10
+ ./bash_completion_datadir.patch
+ ];
+ postPatch = ''
+ substituteInPlace scripts/mosh.pl \
+ --subst-var-by ssh "${openssh}/bin/ssh"
+ '';
+
+ configureFlags = [ "--enable-completion" ] ++ lib.optional withUtempter "--with-utempter";
+
+ postInstall = ''
+ wrapProgram $out/bin/mosh --prefix PERL5LIB : $PERL5LIB
+ '';
+
+ CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11";
+
+ meta = {
+ homepage = "https://mosh.org/";
+ description = "Mobile shell (ssh replacement)";
+ longDescription = ''
+ Remote terminal application that allows roaming, supports intermittent
+ connectivity, and provides intelligent local echo and line editing of
+ user keystrokes.
+
+ Mosh is a replacement for SSH. It's more robust and responsive,
+ especially over Wi-Fi, cellular, and long-distance links.
+ '';
+ license = stdenv.lib.licenses.gpl3Plus;
+ maintainers = with stdenv.lib.maintainers; [viric];
+ platforms = stdenv.lib.platforms.unix;
+ };
+}
diff --git a/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/ssh_path.patch b/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/ssh_path.patch
new file mode 100644
index 000000000000..cb2a650718ab
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/ssh_path.patch
@@ -0,0 +1,13 @@
+diff --git i/scripts/mosh.pl w/scripts/mosh.pl
+index c511482..55bf5f3 100755
+--- i/scripts/mosh.pl
++++ w/scripts/mosh.pl
+@@ -66,7 +66,7 @@ my $use_remote_ip = 'proxy';
+ my $family = 'prefer-inet';
+ my $port_request = undef;
+
+-my @ssh = ('ssh');
++my @ssh = ('@ssh@');
+
+ my $term_init = 1;
+
diff --git a/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/utempter_path.patch b/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/utempter_path.patch
new file mode 100644
index 000000000000..a981708ffadf
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/tools/networking/mosh/utempter_path.patch
@@ -0,0 +1,14 @@
+diff -ur mosh-1.3.2/src/frontend/mosh-server.cc mosh-1.3.2.patched/src/frontend/mosh-server.cc
+--- mosh-1.3.2/src/frontend/mosh-server.cc 2017-07-22 23:14:53.000000000 +0200
++++ mosh-1.3.2.patched/src/frontend/mosh-server.cc 2018-06-06 10:45:50.725352804 +0200
+@@ -351,6 +351,10 @@
+ }
+ }
+
++#ifdef HAVE_UTEMPTER
++ utempter_set_helper( "utempter" );
++#endif
++
+ try {
+ return run_server( desired_ip, desired_port, command_path, command_argv, colors, verbose, with_motd );
+ } catch ( const Network::NetworkException &e ) {