1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-26 00:55:14 +00:00
freebsd-ports/Mk/Uses/display.mk
Baptiste Daroussin 7ab85fc309 Remove target name restriction on USES=display
To allow to activate display on any targets
2013-07-08 13:43:38 +00:00

40 lines
1.0 KiB
Makefile

# $FreeBSD$
#
# MAINTAINER: x11@FreeBSD.org
#
# Feature: display
# Usage: USES=display or USES=display:ARGS
# Valid ARGS: install (default, implicit), any target
#
# Except the target where the DISPLAY is needed
#
.if !defined(_INCLUDE_USES_DISPLAY_MK)
_INCLUDE_USES_DISPLAY_MK= yes
display_ARGS?= install
.if !defined(DISPLAY)
BUILD_DEPENDS+= Xvfb:${PORTSDIR}/x11-servers/xorg-vfbserver \
${LOCALBASE}/lib/X11/fonts/misc/8x13O.pcf.gz:${PORTSDIR}/x11-fonts/xorg-fonts-miscbitmaps \
${LOCALBASE}/lib/X11/fonts/misc/fonts.alias:${PORTSDIR}/x11-fonts/font-alias \
${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 -F ${XVFBPIDFILE}
.endif
.endif