From owner-svn-ports-all@freebsd.org Thu Nov 3 06:00:55 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C047C2CCBE; Thu, 3 Nov 2016 06:00:55 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED791464; Thu, 3 Nov 2016 06:00:54 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA360snT003802; Thu, 3 Nov 2016 06:00:54 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA360sJt003800; Thu, 3 Nov 2016 06:00:54 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201611030600.uA360sJt003800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Thu, 3 Nov 2016 06:00:54 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r425189 - in head/x11/xsel-conrad: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2016 06:00:55 -0000 Author: jbeich Date: Thu Nov 3 06:00:53 2016 New Revision: 425189 URL: https://svnweb.freebsd.org/changeset/ports/425189 Log: x11/xsel-conrad: minor fixes - Plug memory leak [1] - Convert to USES=localbase - Drop unused X11 dependencies - Unsilence install commands - Convert DOCS to target helpers - Reorder some lines PR: 212261 Submitted by: Tobias Kortkamp Obtained from: OpenBSD Ports [1] Approved by: maintainer timeout (2 months) MFH: 2016Q4 Added: head/x11/xsel-conrad/files/ head/x11/xsel-conrad/files/patch-xsel.c (contents, props changed) Modified: head/x11/xsel-conrad/Makefile (contents, props changed) Modified: head/x11/xsel-conrad/Makefile ============================================================================== --- head/x11/xsel-conrad/Makefile Thu Nov 3 04:07:44 2016 (r425188) +++ head/x11/xsel-conrad/Makefile Thu Nov 3 06:00:53 2016 (r425189) @@ -3,6 +3,7 @@ PORTNAME= xsel PORTVERSION= 1.2.0 +PORTREVISION= 1 CATEGORIES= x11 MASTER_SITES= http://www.vergenet.net/~conrad/software/xsel/download/ PKGNAMESUFFIX= -conrad @@ -17,24 +18,21 @@ LICENSE_FILE= ${WRKSRC}/COPYING LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept CONFLICTS_INSTALL= xsel-[0-9]* -USE_XORG= x11 xext xt xproto ice sm -CFLAGS+= -I${LOCALBASE}/include -LDFLAGS+= -L${LOCALBASE}/lib -lXext -lX11 + +USES= autoreconf localbase +USE_XORG= x11 xt +GNU_CONFIGURE= yes PLIST_FILES= bin/${PORTNAME} man/man1/${PORTNAME}.1.gz PORTDOCS= ChangeLog README -GNU_CONFIGURE= yes OPTIONS_DEFINE= DOCS -post-patch: - @${REINPLACE_CMD} -e 's|jmp_buf|sigjmp_buf|g' ${WRKSRC}/xsel.c - @${REINPLACE_CMD} -e 's|@X_CFLAGS@|${CFLAGS}|;\ - s|@X_LIBS@|${LDFLAGS}|' ${WRKSRC}/Makefile.in - do-install: - @${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/ - @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1x ${STAGEDIR}${MAN1PREFIX}/man/man1/${PORTNAME}.1 - @${INSTALL} -d ${STAGEDIR}${DOCSDIR}/ - @cd ${WRKSRC}/&&${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/ + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/ + ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1x ${STAGEDIR}${MAN1PREFIX}/man/man1/${PORTNAME}.1 + +do-install-DOCS-on: + (cd ${WRKSRC} && ${COPYTREE_SHARE} \ + "${PORTDOCS}" ${STAGEDIR}${DOCSDIR}) .include Added: head/x11/xsel-conrad/files/patch-xsel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11/xsel-conrad/files/patch-xsel.c Thu Nov 3 06:00:53 2016 (r425189) @@ -0,0 +1,62 @@ +$OpenBSD: patch-xsel_c,v 1.2 2014/07/07 08:25:16 sthen Exp $ + +- Format "32" properties use "long", not "int", even on LP64 platforms. +- ensure NUM_TARGETS does not exceed MAX_NUM_TARGETS. +- plug a memory leak in handle_targets() +- sigsetjmp expects a sigjmp_buf type arg, not a jmp_buf type arg + +--- xsel.c.orig 2008-02-12 04:50:18 UTC ++++ xsel.c +@@ -15,6 +15,7 @@ + #include "config.h" + #endif + ++#include + #include + #include + #include +@@ -465,7 +466,7 @@ get_timestamp (void) + */ + + /* The jmp_buf to longjmp out of the signal handler */ +-static jmp_buf env_alrm; ++static sigjmp_buf env_alrm; + + /* + * alarm_handler (sig) +@@ -1300,14 +1301,16 @@ handle_targets (Display * display, Windo + Atom selection, Time time, MultTrack * mparent) + { + Atom * targets_cpy; ++ HandleResult r; + + targets_cpy = malloc (sizeof (supported_targets)); + memcpy (targets_cpy, supported_targets, sizeof (supported_targets)); + +- return +- change_property (display, requestor, property, XA_ATOM, 32, ++ r = change_property (display, requestor, property, XA_ATOM, 32, + PropModeReplace, (unsigned char *)targets_cpy, + NUM_TARGETS, selection, time, mparent); ++ free(targets_cpy); ++ return r; + } + + /* +@@ -2078,7 +2081,6 @@ main(int argc, char *argv[]) + + /* Get the NULL atom */ + null_atom = XInternAtom (display, "NULL", False); +- NUM_TARGETS++; + + /* Get the TEXT atom */ + text_atom = XInternAtom (display, "TEXT", False); +@@ -2097,6 +2099,8 @@ main(int argc, char *argv[]) + supported_targets[s++] = XA_STRING; + NUM_TARGETS++; + ++ assert(NUM_TARGETS <= MAX_NUM_TARGETS); ++ + /* Get the COMPOUND_TEXT atom. + * NB. We do not currently serve COMPOUND_TEXT; we can retrieve it but + * do not perform charset conversion.