Subject: [alpine-aports] [PATCH] testing/tmate: new aport

From: Daniel Isaksen <[email-masked]>
Date: Wed, 27 Sep 2017 01:40:37 +0000

---
 testing/tmate/APKBUILD                    | 51 +++++++++++++++++++++++++++++++
 testing/tmate/remove-backtrace-musl.patch | 28 +++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 testing/tmate/APKBUILD
 create mode 100644 testing/tmate/remove-backtrace-musl.patch

diff --git a/testing/tmate/APKBUILD b/testing/tmate/APKBUILD
new file mode 100644
index 0000000000..82e4bdf021
--- /dev/null
+++ b/testing/tmate/APKBUILD
@@ -0,0 +1,51 @@
+# Maintainer: Daniel Isaksen <[email-masked]>
+pkgname=tmate
+pkgver=2.2.1
+pkgrel=0
+pkgdesc="Instant Terminal Sharing"
+url="https://tmate.io/"
+arch="all"
+license="ISC"
+depends="ncurses-terminfo"
+makedepends="ncurses-dev libevent-dev autoconf automake bsd-compat-headers
+	libtool zlib-dev libssh-dev msgpack-c-dev libexecinfo-dev"
+install=
+subpackages="$pkgname-doc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname-io/$pkgname/archive/$pkgver.tar.gz
+	remove-backtrace-musl.patch"
+
+builddir="$srcdir/"$pkgname-$pkgver
+
+build() {
+	cd "$builddir"
+
+	./autogen.sh || return 1
+
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man \
+		--localstatedir=/var
+	make
+}
+
+check() {
+	cd "$builddir"
+	make check
+}
+
+package() {
+	cd "$builddir"
+	make DESTDIR="$pkgdir" install
+
+	install -Dm644 example_tmux.conf \
+		"$pkgdir"/usr/share/doc/$pkgname/examples/$pkgname.conf
+	for file in CHANGES FAQ README TODO; do
+		install -m644 "$file" "$pkgdir"/usr/share/doc/$pkgname/
+	done
+}
+
+sha512sums="3d4ce7510cd8da39bc4fe63f2a64179846a813bb3560ca811d9e1e2a28b06d95a9033047a900d76bda069c249d7ebbe1143daa082b23212c5d32a50bf1819d2d  tmate-2.2.1.tar.gz
+530f17f86688980fb3e0d48adaff70cc413efafda7025be4f1dfaaf5a3d71ab21ee923a1d658d30691464e375aea73ba1b06a4b5545998c4a7df9dc19fc91561  remove-backtrace-musl.patch"
diff --git a/testing/tmate/remove-backtrace-musl.patch b/testing/tmate/remove-backtrace-musl.patch
new file mode 100644
index 0000000000..650634855b
--- /dev/null
+++ b/testing/tmate/remove-backtrace-musl.patch
@@ -0,0 +1,28 @@
+This is a quite ugly hack to make it compile.
+
+TODO: use libunwind instead.
+
+---
+--- a/tmate-debug.c
++++ b/tmate-debug.c
+@@ -60,18 +60,17 @@ void tmate_print_stack_trace(void)
+ 	char **strings;
+ 	size_t i;
+ 
++#if 0
+ 	size = backtrace (array, 20);
+ 	strings = backtrace_symbols (array, size);
+ 
+ 	tmate_info ("============ %zd stack frames ============", size);
+ 
+ 	for (i = 1; i < size; i++) {
+-#if DEBUG
+ 		if (print_resolved_stack_frame(strings[i]) < 0)
+-#endif
+ 			tmate_info("%s", strings[i]);
+ 	}
+-
++#endif
+ 	free (strings);
+ }
+ 
-- 
2.14.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Thu, 28 Sep 2017 11:50:34 +0200

On Wed, 27 Sep 2017 01:40:37 +0000

> +++ b/testing/tmate/APKBUILD

Do you need libexecinfo when you remove the use of backtrace?

-nc

---

---

From: Daniel Isaksen <[email-masked]>
Date: Thu, 28 Sep 2017 12:01:34 +0200

I forgot to remove the dependency. I will fix it ASAP - or you can, if you
have the time.

- Daniel

On Sep 28, 2017 11:50 AM, "Natanael Copa" <[email-masked]> wrote:

> > +source="$pkgname-$pkgver.tar.gz::https://github.com/$
> pkgname-io/$pkgname/archive/$pkgver.tar.gz
> > +sha512sums="3d4ce7510cd8da39bc4fe63f2a6417
> 9846a813bb3560ca811d9e1e2a28b06d95a9033047a900d76bda069c249d
> 7ebbe1143daa082b23212c5d32a50bf1819d2d  tmate-2.2.1.tar.gz
> > +530f17f86688980fb3e0d48adaff70cc413efafda7025be4f1dfaaf5a3d7
> 1ab21ee923a1d658d30691464e375aea73ba1b06a4b5545998c4a7df9dc19fc91561
> remove-backtrace-musl.patch"
> > diff --git a/testing/tmate/remove-backtrace-musl.patch
> b/testing/tmate/remove-backtrace-musl.patch
> > new file mode 100644