diff --git a/packages/mosh/build.sh b/packages/mosh/build.sh
index 72689cb60..75a1021dc 100644
--- a/packages/mosh/build.sh
+++ b/packages/mosh/build.sh
@@ -19,9 +19,12 @@ termux_step_pre_configure () {
}
termux_step_post_make_install () {
- # Avoid env and specify perl directly:
- sed -i'' '1 s|^.*$|#! /bin/perl|' $TERMUX_PREFIX/bin/mosh
cd $TERMUX_PREFIX/bin
mv mosh mosh.pl
- ln -s mosh-cfront mosh
+ $CXX $CXXFLAGS $LDFLAGS \
+ -isystem $TERMUX_PREFIX/include \
+ -lutil \
+ -DPACKAGE_VERSION=\"$TERMUX_PKG_VERSION\" \
+ -std=c++11 -Wall -Wextra -Werror \
+ $TERMUX_PKG_BUILDER_DIR/mosh.cc -o mosh
}
diff --git a/packages/mosh/configure.ac.patch b/packages/mosh/configure.ac.patch
deleted file mode 100644
index db6ef32af..000000000
--- a/packages/mosh/configure.ac.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- ../mosh/configure.ac 2016-04-08 10:26:08.000000000 +1000
-+++ ./configure.ac 2016-04-29 00:39:20.295727049 +1000
-@@ -141,6 +141,12 @@
- [build_server="yes"])
- AM_CONDITIONAL([BUILD_SERVER], [test x"$build_server" != xno])
-
-+AC_ARG_ENABLE([cfront],
-+ [AS_HELP_STRING([--enable-cfront], [Build the mosh c program instead of perl @<:@yes@:])],
-+ [build_cfront="$enableval"],
-+ [build_cfront="yes"])
-+AM_CONDITIONAL([BUILD_CFRONT], [test x"$build_cfront" != xno])
-+
- AC_ARG_ENABLE([examples],
- [AS_HELP_STRING([--enable-examples], [Build the miscellaneous programs in src/examples @<:@no@:>@])],
- [build_examples="$enableval"],
diff --git a/packages/mosh/makefile.am.patch b/packages/mosh/makefile.am.patch
deleted file mode 100644
index 1a31a3cde..000000000
--- a/packages/mosh/makefile.am.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -u -r ../mosh-f30738e3256e90850e945c08624fce90b1ba78a1/src/frontend/Makefile.am ./src/frontend/Makefile.am
---- ../mosh-f30738e3256e90850e945c08624fce90b1ba78a1/src/frontend/Makefile.am 2016-04-07 20:26:08.000000000 -0400
-+++ ./src/frontend/Makefile.am 2016-05-02 01:20:09.868867123 -0400
-@@ -11,9 +11,15 @@
- bin_PROGRAMS += mosh-client
- endif
-
-+if BUILD_CFRONT
-+ bin_PROGRAMS += mosh-cfront
-+endif
-+
- if BUILD_SERVER
- bin_PROGRAMS += mosh-server
- endif
-
- mosh_client_SOURCES = mosh-client.cc stmclient.cc stmclient.h terminaloverlay.cc terminaloverlay.h
- mosh_server_SOURCES = mosh-server.cc
-+mosh_cfront_SOURCES = mosh.cc
-+mosh_cfront_LDADD = -lutil
diff --git a/packages/mosh/mosh.cc b/packages/mosh/mosh.cc
new file mode 100644
index 000000000..9f0352e68
--- /dev/null
+++ b/packages/mosh/mosh.cc
@@ -0,0 +1,467 @@
+// Mosh: the mobile shell
+// Copyright 2012 Keith Winstein
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include