Add etc/X11/fontpath.d as a catalogue fontpath by default.

This allows a port/package to install a symlink pointing
the real font directory managed by core XLFD (aka fonts.dir).
Adding a new entry of "FontPath" into the system-wide
xorg.conf or "xset fp" by users manually is no longer needed.

When both USES=fonts and ${FONTPATHSPEC} are defined,
the post-install target will install ${FONTPATHSPEC} into
${FONTPATHD} directory as a symlink to ${FONTSDIR}.
The symlink name has the following syntax:

  <identifier>:[attribute:]pri=<priority>

Details can be found in xorg.conf(5).  A typical example
for a bitmap font is as follows:

  FONTPATHSPEC=	${PORTNAME}:unscaled:pri=60

No objection on:	x11
This commit is contained in:
Hiroki Sato 2019-12-30 00:11:05 +00:00
parent 26875d06af
commit 3593478fde
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=521430
3 changed files with 26 additions and 1 deletions

View File

@ -62,6 +62,15 @@ FONTSDIR?= ${PREFIX}/share/fonts/${FONTNAME}
.if !empty(fonts_ARGS:Nnone)
PLIST_FILES+= "@${fonts_ARGS} ${FONTSDIR}"
.endif
.if defined(FONTPATHSPEC) && !empty(FONTPATHSPEC)
FONTPATHD?= ${LOCALBASE}/etc/X11/fontpath.d
PLIST_FILES+= "${FONTPATHD}/${FONTPATHSPEC}"
post-install-fontpathd:
@${MKDIR} ${STAGEDIR}${FONTPATHD}
${LN} -s -f ../../../${FONTSDIR:S,^${PREFIX}/,,} \
${STAGEDIR}${FONTPATHD}/${FONTPATHSPEC}
post-install: post-install-fontpathd
.endif
SUB_LIST+= FONTSDIR="${FONTSDIR}"
PLIST_SUB+= FONTSDIR="${FONTSDIR:S,^${PREFIX}/,,}"
.endif

View File

@ -3,7 +3,7 @@
PORTNAME?= xorg-server
PORTVERSION?= 1.18.4
PORTREVISION?= 12
PORTREVISION?= 13
PORTEPOCH?= 1
CATEGORIES= x11-servers
MASTER_SITES= XORG/individual/xserver
@ -32,11 +32,25 @@ OPTIONS_EXCLUDE_sparc64= HAL
.include <bsd.port.options.mk>
FONTPATH_ROOT?= ${LOCALBASE}/share/fonts
FONTPATHD?= ${PREFIX}/etc/X11/fontpath.d
DEFAULT_FONTPATH_LIST= \
${FONTPATH_ROOT}/misc/ \
${FONTPATH_ROOT}/TTF/ \
${FONTPATH_ROOT}/OTF/ \
${FONTPATH_ROOT}/Type1/ \
${FONTPATH_ROOT}/100dpi/ \
${FONTPATH_ROOT}/75dpi/ \
catalogue:${FONTPATHD}
DEFAULT_FONTPATH_CMD=${ECHO_CMD} ${DEFAULT_FONTPATH_LIST} | ${TR} ' ' ,
PLIST_SUB+= FONTPATHD="${FONTPATHD:S,^${PREFIX}/,,}"
USES= gmake gl libtool perl5 ssl tar:bzip2 xorg xorg-cat:xserver
USE_PERL5= build
USE_GL+= gl
USE_XORG+= pixman xau xdmcp xfont xkbfile xorgproto xshmfence xtrans
CONFIGURE_ARGS+=--without-doxygen --without-xmlto --without-fop \
--with-default-font-path="$$(${DEFAULT_FONTPATH_CMD})" \
--localstatedir=/var --with-shared-memory-dir=/tmp \
--disable-config-udev --disable-config-udev-kms \
--without-dtrace --enable-glamor
@ -126,6 +140,7 @@ post-install:
${INSTALL_LIB} ${WRKSRC}/hw/xfree86/dixmods/.libs/libglx.so \
${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
@${MKDIR} ${STAGEDIR}${FONTPATHD}
.endif # ! SLAVE_PORT
.include <bsd.port.post.mk>

View File

@ -187,3 +187,4 @@ man/man5/xorg.conf.5.gz
man/man5/xorg.conf.d.5.gz
share/aclocal/xorg-server.m4
@dir etc/X11/xorg.conf.d
@dir %%FONTPATHD%%