summaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authortnn <tnn@pkgsrc.org>2015-09-27 11:21:41 +0000
committertnn <tnn@pkgsrc.org>2015-09-27 11:21:41 +0000
commit076371a6fc76ea919c179153f1874134ac914717 (patch)
tree9e1f1f0423e28676eee14d52e00452d8940aa7f0 /x11
parentce22776f01dfa8bb9cd59f8a2ddd688685e7d1d7 (diff)
downloadpkgsrc-076371a6fc76ea919c179153f1874134ac914717.tar.gz
Import xtrace-1.3.1 as x11/xtrace.
(from pkgsrc-wip, originally packaged by reed@) Xtrace fakes an X server and forwards all connections to a real X server, displaying the communication between clients. It prints the requests going from client to server and the replies, events and errors going the other way.
Diffstat (limited to 'x11')
-rw-r--r--x11/xtrace/DESCR4
-rw-r--r--x11/xtrace/Makefile19
-rw-r--r--x11/xtrace/PLIST29
-rw-r--r--x11/xtrace/distinfo6
-rw-r--r--x11/xtrace/files/tdestroy.c99
-rw-r--r--x11/xtrace/patches/patch-Makefile.in24
6 files changed, 181 insertions, 0 deletions
diff --git a/x11/xtrace/DESCR b/x11/xtrace/DESCR
new file mode 100644
index 00000000000..2a201ca6610
--- /dev/null
+++ b/x11/xtrace/DESCR
@@ -0,0 +1,4 @@
+Xtrace fakes an X server and forwards all connections to a real X
+server, displaying the communication between clients. It prints
+the requests going from client to server and the replies, events
+and errors going the other way.
diff --git a/x11/xtrace/Makefile b/x11/xtrace/Makefile
new file mode 100644
index 00000000000..9a193fa2e48
--- /dev/null
+++ b/x11/xtrace/Makefile
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile,v 1.1 2015/09/27 11:21:41 tnn Exp $
+
+DISTNAME= xtrace_1.3.1.orig
+PKGNAME= ${DISTNAME:S/_/-/:S/.orig//}
+CATEGORIES= x11
+MASTER_SITES= ${MASTER_SITE_DEBIAN:=pool/main/x/xtrace/}
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://packages.qa.debian.org/x/xtrace.html
+COMMENT= Trace communication between X11 client and server
+LICENSE= gnu-gpl-v2
+
+GNU_CONFIGURE= yes
+WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
+
+post-extract:
+ ${CP} ${FILESDIR}/tdestroy.c ${WRKSRC}
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/x11/xtrace/PLIST b/x11/xtrace/PLIST
new file mode 100644
index 00000000000..61eef51bdab
--- /dev/null
+++ b/x11/xtrace/PLIST
@@ -0,0 +1,29 @@
+@comment $NetBSD: PLIST,v 1.1 2015/09/27 11:21:41 tnn Exp $
+bin/xtrace
+man/man1/xtrace.1
+share/xtrace/all.proto
+share/xtrace/bigfont.proto
+share/xtrace/bigrequest.proto
+share/xtrace/composite.proto
+share/xtrace/damage.proto
+share/xtrace/dga.proto
+share/xtrace/dpms.proto
+share/xtrace/dri2.proto
+share/xtrace/errors.proto
+share/xtrace/events.proto
+share/xtrace/fixes.proto
+share/xtrace/genericevents.proto
+share/xtrace/glx.proto
+share/xtrace/mitshm.proto
+share/xtrace/randr.proto
+share/xtrace/render.proto
+share/xtrace/requests.proto
+share/xtrace/saver.proto
+share/xtrace/setup.proto
+share/xtrace/shape.proto
+share/xtrace/sync.proto
+share/xtrace/vidmode.proto
+share/xtrace/xinerama.proto
+share/xtrace/xinput.proto
+share/xtrace/xkb.proto
+share/xtrace/xvideo.proto
diff --git a/x11/xtrace/distinfo b/x11/xtrace/distinfo
new file mode 100644
index 00000000000..9bfc414c622
--- /dev/null
+++ b/x11/xtrace/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2015/09/27 11:21:41 tnn Exp $
+
+SHA1 (xtrace_1.3.1.orig.tar.gz) = a28069a0cc7f364350cee5e972dac26c9be0cf6e
+RMD160 (xtrace_1.3.1.orig.tar.gz) = ee576ce4251ad28c298be19f753db004185af453
+Size (xtrace_1.3.1.orig.tar.gz) = 185308 bytes
+SHA1 (patch-Makefile.in) = 4a592285a74b19f9e8e747ca2c75d15c79a5e84e
diff --git a/x11/xtrace/files/tdestroy.c b/x11/xtrace/files/tdestroy.c
new file mode 100644
index 00000000000..7568e7d9d8d
--- /dev/null
+++ b/x11/xtrace/files/tdestroy.c
@@ -0,0 +1,99 @@
+/* modified version of the file below, from vlc */
+/**
+ * @file tdestroy.c
+ * @brief replacement for GNU tdestroy()
+ */
+/*****************************************************************************
+ * Copyright (C) 2009 RĂ©mi Denis-Courmont
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <assert.h>
+
+#include <search.h>
+
+static struct
+{
+ const void **tab;
+ size_t count;
+} list = { NULL, 0 };
+
+static void list_nodes (const void *node, const VISIT which, const int depth)
+{
+ (void) depth;
+
+ if (which != postorder && which != leaf)
+ return;
+
+ const void **tab = realloc (list.tab, sizeof (*tab) * (list.count + 1));
+ if (tab == NULL)
+ abort ();
+
+ tab[list.count] = *(const void **)node;
+ list.tab = tab;
+ list.count++;
+}
+
+static struct
+{
+ const void *node;
+} smallest = { NULL };
+
+static int cmp_smallest (const void *a, const void *b)
+{
+ if (a == b)
+ return 0;
+ if (a == smallest.node)
+ return -1;
+ if (b == smallest.node)
+ return +1;
+ abort ();
+}
+
+void tdestroy (void *root, void (*freenode) (void *))
+{
+ const void **tab;
+ size_t count;
+
+ assert (freenode != NULL);
+
+ /* Enumerate nodes in order */
+ assert (list.count == 0);
+ twalk (root, list_nodes);
+ tab = list.tab;
+ count = list.count;
+ list.tab = NULL;
+ list.count = 0;
+
+ /* Destroy the tree */
+ for (size_t i = 0; i < count; i++)
+ {
+ smallest.node = tab[i];
+ if (tdelete (smallest.node, &root, cmp_smallest) == NULL)
+ abort ();
+ }
+ assert (root == NULL);
+
+ /* Destroy the nodes */
+ for (size_t i = 0; i < count; i++)
+ freenode ((void *)(tab[i]));
+ free (tab);
+}
diff --git a/x11/xtrace/patches/patch-Makefile.in b/x11/xtrace/patches/patch-Makefile.in
new file mode 100644
index 00000000000..e7b67fa0ba0
--- /dev/null
+++ b/x11/xtrace/patches/patch-Makefile.in
@@ -0,0 +1,24 @@
+$NetBSD: patch-Makefile.in,v 1.1 2015/09/27 11:21:41 tnn Exp $
+
+Hook in tdestroy replacement.
+
+--- Makefile.in.orig 2012-06-11 12:57:07.000000000 +0000
++++ Makefile.in
+@@ -74,7 +74,7 @@ PROGRAMS = $(bin_PROGRAMS)
+ am_xtrace_OBJECTS = main.$(OBJEXT) x11common.$(OBJEXT) \
+ x11client.$(OBJEXT) x11server.$(OBJEXT) parse.$(OBJEXT) \
+ copyauth.$(OBJEXT) atoms.$(OBJEXT) translate.$(OBJEXT) \
+- stringlist.$(OBJEXT)
++ stringlist.$(OBJEXT) tdestroy.$(OBJEXT)
+ xtrace_OBJECTS = $(am_xtrace_OBJECTS)
+ xtrace_LDADD = $(LDADD)
+ DEFAULT_INCLUDES = -I.@am__isrc@
+@@ -229,7 +229,7 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ AM_CPPFLAGS = -DPKGDATADIR='"$(pkgdatadir)"'
+-xtrace_SOURCES = main.c x11common.c x11client.c x11server.c parse.c copyauth.c atoms.c translate.c stringlist.c
++xtrace_SOURCES = main.c x11common.c x11client.c x11server.c parse.c copyauth.c atoms.c translate.c stringlist.c tdestroy.c
+ noinst_HEADERS = xtrace.h parse.h stringlist.h translate.h
+ dist_man_MANS = xtrace.1
+ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/stamp-h.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in