From 058f8d6b905b60de100f67ec33cc567aa34cff1f Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 8 Apr 2017 08:47:46 +0200 Subject: [PATCH] mosh: patch it the proper way. We do have a forkpty, so let's just use that. --- net-misc/mosh/mosh-1.3.0.recipe | 10 ++- net-misc/mosh/patches/mosh-1.3.0.patchset | 82 ++++++++++++++++------- 2 files changed, 67 insertions(+), 25 deletions(-) diff --git a/net-misc/mosh/mosh-1.3.0.recipe b/net-misc/mosh/mosh-1.3.0.recipe index cefff89b5..075936e14 100644 --- a/net-misc/mosh/mosh-1.3.0.recipe +++ b/net-misc/mosh/mosh-1.3.0.recipe @@ -11,7 +11,7 @@ and Android." HOMEPAGE="https://mosh.org/" COPYRIGHT="2012-2017 Keith Winstein" LICENSE="GNU GPL v3" -REVISION="1" +REVISION="2" SOURCE_URI="https://mosh.org/mosh-$portVersion.tar.gz" CHECKSUM_SHA256="320e12f461e55d71566597976bd9440ba6c5265fa68fbf614c6f1c8401f93376" PATCHES="mosh-$portVersion.patchset" @@ -53,7 +53,8 @@ BUILD_PREREQUIRES=" BUILD() { - export LDFLAGS=-lnetwork + export CFLAGS=-D_BSD_SOURCE + export CXXFLAGS=-D_BSD_SOURCE ./autogen.sh runConfigure ./configure --bindir=$prefix/bin --disable-hardening make $jobArgs @@ -63,3 +64,8 @@ INSTALL() { make install } + +TEST() +{ + make check +} diff --git a/net-misc/mosh/patches/mosh-1.3.0.patchset b/net-misc/mosh/patches/mosh-1.3.0.patchset index 9b5225d8c..8443c35c7 100644 --- a/net-misc/mosh/patches/mosh-1.3.0.patchset +++ b/net-misc/mosh/patches/mosh-1.3.0.patchset @@ -1,32 +1,68 @@ -From 81cecc46972ee3a10fe7c46bdee66d16cf5fa176 Mon Sep 17 00:00:00 2001 +From dbd5bd9882bf5bfe29c3ab371bdef898827a69e0 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 26 Oct 2014 22:05:31 +0100 Subject: Fix build on Haiku. +- Look for socket in libnetwork +- Look for forkpty in libbsd -diff --git a/src/util/pty_compat.cc b/src/util/pty_compat.cc -index c723326..e3288fd 100644 ---- a/src/util/pty_compat.cc -+++ b/src/util/pty_compat.cc -@@ -39,7 +39,9 @@ - #include - #include - #include -+#ifndef __HAIKU__ - #include -+#endif - #include +diff --git a/configure.ac b/configure.ac +index a0857d3..f500a1f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -179,7 +179,7 @@ AS_IF([test x"$with_utempter" != xno], - #include "pty_compat.h" -@@ -92,7 +94,7 @@ pid_t my_forkpty( int *amaster, char *name, - return -1; - } + AC_SEARCH_LIBS([compress], [z], , [AC_MSG_ERROR([Unable to find zlib.])]) --#ifndef _AIX -+#if !defined(_AIX) && !defined(__HAIKU__) - if ( ioctl(slave, I_PUSH, "ptem") < 0 || - ioctl(slave, I_PUSH, "ldterm") < 0 ) { - perror( "ioctl(I_PUSH)" ); +-AC_SEARCH_LIBS([socket], [socket]) ++AC_SEARCH_LIBS([socket], [socket network]) + AC_SEARCH_LIBS([inet_addr], [nsl]) + + AC_SEARCH_LIBS([clock_gettime], [rt]) +@@ -352,10 +352,8 @@ AC_CHECK_DECL([forkpty], + , [[#include + #include ]]) + +-AC_CHECK_LIB([util], [forkpty], [ ++AC_SEARCH_LIBS([forkpty], [util bsd], [ + AC_DEFINE([HAVE_FORKPTY],, [Define if you have forkpty().]) +- LIBUTIL="-lutil" +- AC_SUBST([LIBUTIL]) + ]) + + AC_MSG_CHECKING([whether pipe2(..., O_CLOEXEC) is supported]) -- -2.11.0 +2.12.2 + + +From ebc890544cb943ecf7045d4dfd99bc8f5131a9f7 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sat, 8 Apr 2017 08:46:27 +0200 +Subject: Fix tests on Haiku + +The long options to locale are not standardized by POSIX, use the short +form, which is. + +diff --git a/src/tests/e2e-test-subrs b/src/tests/e2e-test-subrs +index b85938d..8ec2fad 100644 +--- a/src/tests/e2e-test-subrs ++++ b/src/tests/e2e-test-subrs +@@ -60,13 +60,13 @@ chr() + set_locale() + { + # Test for a usable locale. +- map=$(locale charmap 2>/dev/null) ++ map=$(locale -m 2>/dev/null) + if [ "$map" = "utf-8" ] || [ "$map" = "UTF-8" ]; then + return 0 + fi + # Attempt to find/set a usable locale. + for i in en_US.UTF-8 en_US.utf8 C.UTF-8; do +- map="$(env LANG=$i locale charmap 2>/dev/null)" ++ map="$(env LANG=$i locale -m 2>/dev/null)" + if [ "$map" = "utf-8" ] || [ "$map" = "UTF-8" ]; then + export LANG=$i LC_ALL='' + return 0 +-- +2.12.2