mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-22 00:35:15 +00:00
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'
This commit is contained in:
parent
662f2e724d
commit
e290dec1ca
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=320906
13
CHANGES
13
CHANGES
@ -10,6 +10,19 @@ in the release notes and/or placed into UPDATING.
|
||||
|
||||
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
|
||||
|
||||
|
42
Mk/Uses/display.mk
Normal file
42
Mk/Uses/display.mk
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user