From 3f6a1a107f818579c63976147c37050c2b722997 Mon Sep 17 00:00:00 2001 From: whispers Date: Mon, 28 Sep 2026 19:45:57 -0400 Subject: [PATCH] mosh: use macros from autoconf-archive mosh vendors many macros from autoconf-archive and one from pkg-config. these are old and, for example, do not allow selecting new C++ standard versions (as is necessary for C++20 with gcc 16). instead, we remove the m4 directory and include autoconf-archive, which lets these macros be selected at build time. --- pkgs/by-name/mo/mosh/package.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/mo/mosh/package.nix b/pkgs/by-name/mo/mosh/package.nix index 11c6b1c66e62..3f97099ccea1 100644 --- a/pkgs/by-name/mo/mosh/package.nix +++ b/pkgs/by-name/mo/mosh/package.nix @@ -9,10 +9,10 @@ makeWrapper, perl, openssl, + autoconf-archive, autoreconfHook, openssh, bash-completion, - fetchpatch, withUtempter ? stdenv.hostPlatform.isLinux, libutempter, # build server binary only when set to false (useful for perlless systems) @@ -31,6 +31,7 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ + autoconf-archive autoreconfHook pkg-config makeWrapper @@ -58,15 +59,15 @@ stdenv.mkDerivation (finalAttrs: { ./mosh-client_path.patch # Fix build with bash-completion 2.10 ./bash_completion_datadir.patch - - # Fixes build with protobuf3 23.x - (fetchpatch { - url = "https://github.com/mobile-shell/mosh/commit/eee1a8cf413051c2a9104e8158e699028ff56b26.patch"; - hash = "sha256-CouLHWSsyfcgK3k7CvTK3FP/xjdb1pfsSXYYQj3NmCQ="; - }) ]; + # remove the m4 directory, as it contains only ancient versions of macros + # from autoconf-archive or pkg-config. instead, we fetch up-to-date versions + # from the packages which provide them. this allows selecting modern C++ + # standard versions, which is important with e.g. GCC 16. postPatch = '' + rm -rf m4 + substituteInPlace scripts/mosh.pl \ --subst-var-by ssh "${openssh}/bin/ssh" \ --subst-var-by mosh-client "$out/bin/mosh-client"