diff options
author | Dan Theisen <djt@hxx.in> | 2018-10-05 03:31:54 -0700 |
---|---|---|
committer | Dan Theisen <djt@hxx.in> | 2018-10-05 03:31:54 -0700 |
commit | a44eef15707f9574118c93bca1bf87ae0ae0f150 (patch) | |
tree | 3711c2a443b8cb8479092eadb28b0c0e2074be2a /user | |
parent | 2ba6865311296c8ed0aa7ffde55c12737ef0abf4 (diff) | |
download | packages-a44eef15707f9574118c93bca1bf87ae0ae0f150.tar.gz packages-a44eef15707f9574118c93bca1bf87ae0ae0f150.tar.bz2 packages-a44eef15707f9574118c93bca1bf87ae0ae0f150.tar.xz packages-a44eef15707f9574118c93bca1bf87ae0ae0f150.zip |
user/mosh: new package
Diffstat (limited to 'user')
-rw-r--r-- | user/mosh/APKBUILD | 78 | ||||
-rw-r--r-- | user/mosh/fix-ppc64le-build-with-musl.patch | 53 |
2 files changed, 131 insertions, 0 deletions
diff --git a/user/mosh/APKBUILD b/user/mosh/APKBUILD new file mode 100644 index 000000000..323891e69 --- /dev/null +++ b/user/mosh/APKBUILD @@ -0,0 +1,78 @@ +# Contributor: Francesco Colista <fcolista@alpinelinux.org> +# Maintainer: Dan Theisen <djt@hxx.in> +pkgname=mosh +pkgver=1.3.2 +pkgrel=0 +pkgdesc="Mobile shell surviving disconnects with local echo and line editing" +url="https://mosh.org" +arch="all" +license="GPL-3.0+" +depends="$pkgname-client $pkgname-server" +checkdepends="tmux perl" +makedepends="ncurses-dev zlib-dev openssl-dev perl-dev perl-io-tty + protobuf-dev automake autoconf libtool gzip" +subpackages="$pkgname-doc $pkgname-client $pkgname-server + $pkgname-bash-completion:bashcomp:noarch" +source="https://mosh.org/$pkgname-$pkgver.tar.gz + fix-ppc64le-build-with-musl.patch" + +prepare() { + default_prepare + # Test unicode-later-combining is failing. Ideally we want to fix it. + sed -i '/unicode-later-combining.test/d' "$builddir"/src/tests/Makefile.am + cd "$builddir" + ./autogen.sh +} + +build() { + cd "$builddir" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --enable-examples + make +} + +check() { + cd "$builddir" + make check VERBOSE=1 V=1 +} + +package() { + cd "$builddir" + make DESTDIR="$pkgdir" install +} + +bashcomp() { + depends="" + pkgdesc="Bash completions for $pkgname" + install_if="$pkgname=$pkgver-r$pkgrel bash-completion" + + install -Dm644 "$builddir"/conf/bash-completion/completions/mosh \ + "$subpkgdir"/usr/share/bash-completion/completions/$pkgname +} + +server() { + replaces="mosh" + pkgdesc="Mosh server" + depends="" + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/mosh-server \ + "$subpkgdir"/usr/bin/ +} + +client() { + replaces="mosh" + pkgdesc="Mosh client" + depends="openssh-client perl-io-tty" + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/mosh-client \ + "$subpkgdir"/usr/bin/ +} + +sha512sums="f400e8fe7ba2ab7362311fc12a00ec69587505f901988aeee500fc68d38a388218500a3f602111c883ff23a9d43572114fcf0a8bf505df203691e5b597615769 mosh-1.3.2.tar.gz +a276dde98a2dab63ad9c9c05468c55983a95f482878c5694713810b561eae1ea5618efc72431a17ee5b5014b12ee9709c6a8cbf582620294e7888cc837cd073c fix-ppc64le-build-with-musl.patch" diff --git a/user/mosh/fix-ppc64le-build-with-musl.patch b/user/mosh/fix-ppc64le-build-with-musl.patch new file mode 100644 index 000000000..8d918a963 --- /dev/null +++ b/user/mosh/fix-ppc64le-build-with-musl.patch @@ -0,0 +1,53 @@ +From: Roberto Oliveira <robertoguimaraes8@gmail.com> +Date: Tue, 4 Apr 2017 16:46:50 +0000 +Subject: [PATCH] Fix build with musl on ppc64le + +mosh was breaking when building in ppc64le using musl, because ioctl() is defined +as ioctl(int, int) in musl and mosh is using TIOCSWINSZ macro as parameter. This was +triggering a gcc warning and make the build fail. + +This patch does an explicit integer conversion in TIOCSWINSZ, as no bits get +lost. + +--- a/src/frontend/mosh-server.cc ++++ b/src/frontend/mosh-server.cc +@@ -714,7 +714,12 @@ + } + window_size.ws_col = res->width; + window_size.ws_row = res->height; +- if ( ioctl( host_fd, TIOCSWINSZ, &window_size ) < 0 ) { ++ ++ #if defined(__powerpc64__) && (!defined(__GLIBC__) && !defined(__UCLIBC__)) ++ if ( ioctl( host_fd, (int) TIOCSWINSZ, &window_size ) < 0 ) { ++ #else ++ if ( ioctl( host_fd, TIOCSWINSZ, &window_size ) < 0 ) { ++ #endif + perror( "ioctl TIOCSWINSZ" ); + network.start_shutdown(); + } +--- a/src/examples/termemu.cc ++++ a/src/examples/termemu.cc +@@ -226,7 +226,11 @@ + } + + /* tell child process */ ++ #if defined(__powerpc64__) && (!defined(__GLIBC__) && !defined(__UCLIBC__)) ++ if ( ioctl( fd, (int) TIOCSWINSZ, &window_size ) < 0 ) { ++ #else + if ( ioctl( fd, TIOCSWINSZ, &window_size ) < 0 ) { ++ #endif + perror( "ioctl TIOCSWINSZ" ); + return; + } +@@ -306,7 +310,11 @@ + complete.act( &r ); + + /* tell child process */ ++ #if defined(__powerpc64__) && (!defined(__GLIBC__) && !defined(__UCLIBC__)) ++ if ( ioctl( fd, (int) TIOCSWINSZ, &window_size ) < 0 ) { ++ #else + if ( ioctl( fd, TIOCSWINSZ, &window_size ) < 0 ) { ++ #endif + perror( "ioctl TIOCSWINSZ" ); + return; + } |