- Loop over USES twice, once to define all *_ARGS variables and once to include Uses/*.mk. This allows all Uses/*.mk to examine arguments given to other USES entries. - Always define *_ARGS (possibly empty) and replace commas with spaces. Similar for _USES_POST. Adjust all Uses/*.mk: - defined(u_ARGS) becomes !empty(u_ARGS) - Eliminate helper variables like _*_ARGS=${*_ARGS:C/,/ /g} - Some Uses/*.mk used ":" as argument separator instead of ",", but no port used this form - Uses/cran.mk: remove unused variable VALID_ARGS and USES+=fortran which has no effect - Uses/twisted.mk: simplify handling of the case where neither "build" nor "run" arguments have been specified PR: 193931 Exp-run by: antoine Approved by: portmgr (antoine)
41 lines
1.1 KiB
Makefile
41 lines
1.1 KiB
Makefile
# $FreeBSD$
|
|
#
|
|
# Feature: display
|
|
# Usage: USES=display or USES=display:ARGS
|
|
# Valid ARGS: install (default, implicit), any target
|
|
#
|
|
# Except the target where the DISPLAY is needed
|
|
#
|
|
# MAINTAINER: x11@FreeBSD.org
|
|
|
|
.if !defined(_INCLUDE_USES_DISPLAY_MK)
|
|
_INCLUDE_USES_DISPLAY_MK= yes
|
|
|
|
.if empty(display_ARGS)
|
|
display_ARGS= install
|
|
.endif
|
|
|
|
.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}"
|
|
|
|
.PHONY: start-display stop-display
|
|
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
|