Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/fonts.mk
Show All 35 Lines | |||||
# This is because other ports using @fcfontsdir or @fontsdir | # This is because other ports using @fcfontsdir or @fontsdir | ||||
# update fonts.dir in these font directories upon installation | # update fonts.dir in these font directories upon installation | ||||
# and deinstallation. mkfontdir will overwrite manually-added entries. | # and deinstallation. mkfontdir will overwrite manually-added entries. | ||||
.if !defined(_INCLUDE_USES_FONTS_MK) | .if !defined(_INCLUDE_USES_FONTS_MK) | ||||
_INCLUDE_USES_FONTS_MK= yes | _INCLUDE_USES_FONTS_MK= yes | ||||
.if empty(fonts_ARGS) | .if empty(fonts_ARGS) | ||||
fonts_ARGS= fcfontsdir | fonts_ARGS= fontsdir | ||||
.endif | .endif | ||||
.if !empty(fonts_ARGS:Nfc:Nfontsdir:Nfcfontsdir:Nnone) | .if !empty(fonts_ARGS:Nfc:Nfontsdir:Nnone) | ||||
IGNORE= USES=fonts - invalid ARGS (${fonts_ARGS}) | IGNORE= USES=fonts - invalid ARGS (${fonts_ARGS}) | ||||
.endif | .endif | ||||
.if !empty(fonts_ARGS:Mfc) || !empty(fonts_ARGS:Mfcfontsdir) | .if !empty(fonts_ARGS:Mfc) || !empty(fonts_ARGS:Mfontsdir) | ||||
RUN_DEPENDS+= fc-cache:x11-fonts/fontconfig | RUN_DEPENDS+= fc-cache:x11-fonts/fontconfig | ||||
.endif | .endif | ||||
.if !empty(fonts_ARGS:Mfontsdir) || !empty(fonts_ARGS:Mfcfontsdir) | .if !empty(fonts_ARGS:Mfontsdir) | ||||
RUN_DEPENDS+= mkfontscale:x11-fonts/mkfontscale | RUN_DEPENDS+= mkfontscale:x11-fonts/mkfontscale | ||||
.endif | .endif | ||||
FONTNAME?= ${PORTNAME} | FONTNAME?= ${PORTNAME} | ||||
FONTSDIR?= ${PREFIX}/share/fonts/${FONTNAME} | FONTSDIR?= ${PREFIX}/share/fonts/${FONTNAME} | ||||
.if !empty(fonts_ARGS:Nnone) | .if !empty(fonts_ARGS:Mfontsdir) | ||||
PLIST_FILES+= "@${fonts_ARGS} ${FONTSDIR}" | PLIST_FILES+= "@${fonts_ARGS} ${FONTSDIR}" | ||||
.endif | .endif | ||||
.if defined(FONTPATHSPEC) && !empty(FONTPATHSPEC) | .if defined(FONTPATHSPEC) && !empty(FONTPATHSPEC) | ||||
FONTPATHD?= ${LOCALBASE}/etc/X11/fontpath.d | FONTPATHD?= ${LOCALBASE}/etc/X11/fontpath.d | ||||
PLIST_FILES+= "${FONTPATHD}/${FONTPATHSPEC}" | PLIST_FILES+= "${FONTPATHD}/${FONTPATHSPEC}" | ||||
_USES_install+= 690:fonts-install-fontpathd | _USES_install+= 690:fonts-install-fontpathd | ||||
fonts-install-fontpathd: | fonts-install-fontpathd: | ||||
@${MKDIR} ${STAGEDIR}${FONTPATHD} | @${MKDIR} ${STAGEDIR}${FONTPATHD} | ||||
${RLN} ${STAGEDIR}${FONTSDIR} ${STAGEDIR}${FONTPATHD}/${FONTPATHSPEC} | ${RLN} ${STAGEDIR}${FONTSDIR} ${STAGEDIR}${FONTPATHD}/${FONTPATHSPEC} | ||||
.endif | .endif | ||||
SUB_LIST+= FONTSDIR="${FONTSDIR}" | SUB_LIST+= FONTSDIR="${FONTSDIR}" | ||||
PLIST_SUB+= FONTSDIR="${FONTSDIR:S,^${PREFIX}/,,}" | PLIST_SUB+= FONTSDIR="${FONTSDIR:S,^${PREFIX}/,,}" | ||||
.endif | .endif | ||||