Reduce amount of mosh rebuilds

This commit is contained in:
Charlotte 🦝 Delenk 2022-04-14 09:06:43 +01:00
parent 096219467f
commit 45c86461ad
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
5 changed files with 72 additions and 4 deletions

View file

@ -74,10 +74,10 @@ in
plover.dev = plover;
mosh = prev.mosh.overrideAttrs (old: {
patches = [
"${nixpkgs}/pkgs/tools/networking/mosh/ssh_path.patch"
"${nixpkgs}/pkgs/tools/networking/mosh/mosh-client_path.patch"
"${nixpkgs}/pkgs/tools/networking/mosh/utempter_path.patch"
"${nixpkgs}/pkgs/tools/networking/mosh/bash_completion_datadir.patch"
./mosh/ssh_path.patch
./mosh/mosh-client_path.patch
./mosh/utempter_path.patch
./mosh/bash_completion_datadir.patch
];
postPatch = ''
substituteInPlace scripts/mosh.pl \

View file

@ -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([

View file

@ -0,0 +1,22 @@
diff --git a/scripts/mosh.pl b/scripts/mosh.pl
index 56e96d7..2a2177e 100755
--- a/scripts/mosh.pl
+++ b/scripts/mosh.pl
@@ -61,7 +61,7 @@ my $have_ipv6 = eval {
$|=1;
-my $client = 'mosh-client';
+my $client = '@mosh-client@';
my $server = 'mosh-server';
my $predict = undef;
@@ -91,7 +91,7 @@ my @cmdline = @ARGV;
my $usage =
qq{Usage: $0 [options] [--] [user@]host [command...]
--client=PATH mosh client on local machine
- (default: "mosh-client")
+ (default: "@mosh-client@")
--server=COMMAND mosh server on remote machine
(default: "mosh-server")

View file

@ -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;

View file

@ -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 ) {