2013-06-14 14:47:19 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Feature: display
|
|
|
|
# Usage: USES=display or USES=display:ARGS
|
2013-07-08 15:43:38 +02:00
|
|
|
# Valid ARGS: install (default, implicit), any target
|
2013-06-14 14:47:19 +02:00
|
|
|
#
|
|
|
|
# Except the target where the DISPLAY is needed
|
|
|
|
#
|
2014-03-15 11:31:54 +01:00
|
|
|
# MAINTAINER: x11@FreeBSD.org
|
2013-06-14 14:47:19 +02:00
|
|
|
|
|
|
|
.if !defined(_INCLUDE_USES_DISPLAY_MK)
|
|
|
|
_INCLUDE_USES_DISPLAY_MK= yes
|
|
|
|
|
2014-09-28 18:36:31 +02:00
|
|
|
.if empty(display_ARGS)
|
|
|
|
display_ARGS= install
|
|
|
|
.endif
|
2013-06-14 14:47:19 +02:00
|
|
|
|
|
|
|
.if !defined(DISPLAY)
|
|
|
|
BUILD_DEPENDS+= Xvfb:${PORTSDIR}/x11-servers/xorg-vfbserver \
|
2015-03-22 00:05:19 +01:00
|
|
|
${LOCALBASE}/share/fonts/misc/8x13O.pcf.gz:${PORTSDIR}/x11-fonts/xorg-fonts-miscbitmaps \
|
|
|
|
${LOCALBASE}/share/fonts/misc/fonts.alias:${PORTSDIR}/x11-fonts/font-alias \
|
2013-06-14 14:47:19 +02:00
|
|
|
${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}"
|
|
|
|
|
2013-11-20 08:29:08 +01:00
|
|
|
.PHONY: start-display stop-display
|
2013-06-14 14:47:19 +02:00
|
|
|
pre-${display_ARGS}: start-display
|
|
|
|
|
|
|
|
post-${display_ARGS}: stop-display
|
|
|
|
|
|
|
|
start-display:
|
|
|
|
daemon -p ${XVFBPIDFILE} Xvfb :${XVFBPORT}
|
|
|
|
|
|
|
|
stop-display:
|
2013-06-27 12:39:43 +02:00
|
|
|
pkill -15 -F ${XVFBPIDFILE}
|
2013-06-14 14:47:19 +02:00
|
|
|
|
|
|
|
.endif
|
|
|
|
.endif
|