From owner-svn-ports-all@FreeBSD.ORG Fri Jun 14 12:47:20 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59506A97; Fri, 14 Jun 2013 12:47:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28E7F1D0D; Fri, 14 Jun 2013 12:47:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5EClKeh014977; Fri, 14 Jun 2013 12:47:20 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5EClJuv014975; Fri, 14 Jun 2013 12:47:19 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201306141247.r5EClJuv014975@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 14 Jun 2013 12:47:19 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r320906 - in head: . Mk/Uses 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.14 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: Fri, 14 Jun 2013 12:47:20 -0000 Author: bapt Date: Fri Jun 14 12:47:19 2013 New Revision: 320906 URL: http://svnweb.freebsd.org/changeset/ports/320906 Log: Add a USES display to replace USE_DISPLAY. as USE_DISPLAY it will handle the dependencies needed for a display. But it will also start and stop the Xfvb process during the requested phase the display it needed. it takes 'install' as an implicit argument, but may also accept 'build' Added: head/Mk/Uses/display.mk (contents, props changed) Modified: head/CHANGES Modified: head/CHANGES ============================================================================== --- head/CHANGES Fri Jun 14 12:33:14 2013 (r320905) +++ head/CHANGES Fri Jun 14 12:47:19 2013 (r320906) @@ -10,6 +10,19 @@ in the release notes and/or placed into All ports committers are allowed to commit to this file. +20130614: +AUTHOR: bapt@FreeBSD.org + + * New 'display' USES macro to handle building ports that may require a + a display to build. + + USES= display[:install] will start Xvfb and set the DISPLAY environment + variable before the installation phase and stop it at the end. (install is + the implicit value) + + USES= display:build will start Xvfb and set the DISPLAY environment variable + before the build phase and stop it at the end. + 20130607: AUTHOR: bdrewery@FreeBSD.org Added: head/Mk/Uses/display.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Mk/Uses/display.mk Fri Jun 14 12:47:19 2013 (r320906) @@ -0,0 +1,42 @@ +# $FreeBSD$ +# +# MAINTAINER: x11@FreeBSD.org +# +# Feature: display +# Usage: USES=display or USES=display:ARGS +# Valid ARGS: install (default, implicit), build +# +# Except the target where the DISPLAY is needed +# + +.if !defined(_INCLUDE_USES_DISPLAY_MK) +_INCLUDE_USES_DISPLAY_MK= yes + +display_ARGS?= install +.if ${display_ARGS} != build && ${display_ARGS} != install +IGNORE= USES=display can only take 'build', 'install' and none +.endif + +.if !defined(DISPLAY) +BUILD_DEPENDS+= Xvfb:${PORTSDIR}/x11-servers/xorg-vfbserver \ + ${LOCALBASE}/lib/X11/fonts/misc/8x13O.pcf.gz:${X_FONTS_MISC_PORT} \ + ${LOCALBASE}/lib/X11/fonts/misc/fonts.alias:${X_FONTS_ALIAS_PORT} \ + ${LOCALBASE}/share/X11/xkb/rules/base:${PORTSDIR}/x11/xkeyboard-config \ + xkbcomp:${PORTSDIR}/x11/xkbcomp + +XVFBPORT!= port=0; while test -S /tmp/.X11-unix/X$${port} ; do port=$$(( port + 1 )) ; done ; ${ECHO_CMD} $$port +XVFBPIDFILE= /tmp/.xvfb-${XVFBPORT}.pid +MAKE_ENV+= DISPLAY=":${XVFBPORT}" + +pre-${display_ARGS}: start-display + +post-${display_ARGS}: stop-display + +start-display: + daemon -p ${XVFBPIDFILE} Xvfb :${XVFBPORT} + +stop-display: + pkill -15 ${XVFBPIDFILE} + +.endif +.endif