diff options
author | Andreas Fuchs <asf@boinkor.net> | 2020-12-14 00:45:26 -0500 |
---|---|---|
committer | Andreas Fuchs <asf@boinkor.net> | 2020-12-14 00:45:26 -0500 |
commit | 9b18a0f353e7048fb0bf4cc60822a6da696b3821 (patch) | |
tree | 99ff9746e626a76b693f77755216c178b299af58 /pkgs/tools/networking/mosh | |
parent | 1e8ca69151d384b17c3e4490ae2dc1e06b50bae3 (diff) |
mosh: Hermeticize mosh-client path reference from mosh.pl
Do the same thing as we do for the "ssh" binary, except with mosh-client: Patch the perl source to substitute mosh-client with @mosh-client@, then substituteInPlace the variable out for the compilation output path.
Diffstat (limited to 'pkgs/tools/networking/mosh')
-rw-r--r-- | pkgs/tools/networking/mosh/default.nix | 3 | ||||
-rw-r--r-- | pkgs/tools/networking/mosh/mosh-client_path.patch | 22 |
2 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/tools/networking/mosh/default.nix b/pkgs/tools/networking/mosh/default.nix index dba75400f6fa8..24702d290aafb 100644 --- a/pkgs/tools/networking/mosh/default.nix +++ b/pkgs/tools/networking/mosh/default.nix @@ -20,6 +20,7 @@ stdenv.mkDerivation rec { patches = [ ./ssh_path.patch + ./mosh-client_path.patch ./utempter_path.patch # Fix w/c++17, ::bind vs std::bind (fetchpatch { @@ -32,6 +33,8 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace scripts/mosh.pl \ --subst-var-by ssh "${openssh}/bin/ssh" + substituteInPlace scripts/mosh.pl \ + --subst-var-by mosh-client "$out/bin/mosh-client" ''; configureFlags = [ "--enable-completion" ] ++ lib.optional withUtempter "--with-utempter"; diff --git a/pkgs/tools/networking/mosh/mosh-client_path.patch b/pkgs/tools/networking/mosh/mosh-client_path.patch new file mode 100644 index 0000000000000..327fb7af92604 --- /dev/null +++ b/pkgs/tools/networking/mosh/mosh-client_path.patch @@ -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") + |