|
Lines 16-22
Link Here
|
| 16 |
Xorg_Pre_Include= bsd.xorg.mk |
16 |
Xorg_Pre_Include= bsd.xorg.mk |
| 17 |
|
17 |
|
| 18 |
# Some notes: |
18 |
# Some notes: |
| 19 |
# |
|
|
| 20 |
# app - requires pkgconfig, don't install shared libraries (I guess) |
19 |
# app - requires pkgconfig, don't install shared libraries (I guess) |
| 21 |
# data - nothing I could factorize |
20 |
# data - nothing I could factorize |
| 22 |
# doc - no particular notes |
21 |
# doc - no particular notes |
|
Lines 26-31
Link Here
|
| 26 |
# lib - various dependencies, install .pc file |
25 |
# lib - various dependencies, install .pc file |
| 27 |
# proto - install .pc file, no dependencies, needed only at build time for most of them |
26 |
# proto - install .pc file, no dependencies, needed only at build time for most of them |
| 28 |
# xserver - there's only one atm, I guess everything can fit into the port itself |
27 |
# xserver - there's only one atm, I guess everything can fit into the port itself |
|
|
28 |
# |
| 29 |
# To create a port dealing with fonts, define: |
| 30 |
# - XORG_CAT=font, if it's part of X.Org; |
| 31 |
# - INSTALLS_FONTS=yes, otherwise. |
| 32 |
# Here is a quick reference of the variables and features available to |
| 33 |
# maintainers (for extensive documentation, refer to the Porter's Handbook). |
| 34 |
# FONTDIR - Directory/ies relative to ${FONTROOTDIR} in which fonts are |
| 35 |
# installed. When there are multiple installation directories, |
| 36 |
# set it to a reverse alphabetical ordered list of these |
| 37 |
# directories (still relative to ${FONTROOTDIR}). |
| 38 |
# Default: ${PORTNAME} without some common suffixes like -ttf |
| 39 |
# or -fonts, a bit more complicated when |
| 40 |
# ${XORG_CAT} == "font". |
| 41 |
# FONTROOTDIR - Common fonts installation prefix. A relative version exists: |
| 42 |
# ${FONTROOTDIR_REL}. You don't need to change these. |
| 43 |
# Default: ${PREFIX}/lib/X11/fonts when ${XORG_CAT} == "fonts", |
| 44 |
# ${PREFIX}/share/fonts otherwise. |
| 45 |
# Remember: fonts MUST be installed in the directory/ies determined by |
| 46 |
# ${FONTROOTDIR} and ${FONTDIR}. You may modify ${FONTDIR} to ensure this, but |
| 47 |
# DO NOT change ${FONTROOTDIR}. Make sure the port always adapts to |
| 48 |
# ${FONTROOTDIR}. Patch it if needed. |
| 49 |
# Additionally, ${FONTDIR} and ${FONTROOTDIR} are passed to ${SUB_LIST} and |
| 50 |
# ${PLIST_SUB} (respectively with and without ${PREFIX}). In this case, |
| 51 |
# %%FONTDIR%% expands to ${FONTROOTDIR}/${FONTDIR} (and |
| 52 |
# ${FONTROOTDIR_REL}/${FONTDIR}). Therefore, if ${FONTDIR} is a list this |
| 53 |
# substitution is useless. Use %%FONTROOTDIR%%/<hardcodeddirectoryname>, then. |
| 54 |
# Dependency on fontconfig, mkfontscale and mkfontdir is automatically handled, |
| 55 |
# as well as post-install/post-deinstall targets using those tools (via |
| 56 |
# @fontdir directive). To provide a customized fonts.dir/fonts.scale, install it |
| 57 |
# as fonts.dir.fixed/fonts.scale.fixed. |
| 58 |
# ${FONTROOTDIR}, and ${FONTDIR} under it (single or multiple), are |
| 59 |
# automatically created and removed: no need to ${MKDIR} or @dirrm. |
| 60 |
# A pkg-message notifying about FontPath addition to xorg.conf(5) is installed |
| 61 |
# automatically when no existing one is found. |
| 29 |
|
62 |
|
| 30 |
.if defined(XORG_CAT) |
63 |
.if defined(XORG_CAT) |
| 31 |
# Default variables, common to all new modular xorg ports. |
64 |
# Default variables, common to all new modular xorg ports. |
|
Lines 60-120
Link Here
|
| 60 |
. endif |
93 |
. endif |
| 61 |
|
94 |
|
| 62 |
. if ${XORG_CAT} == "font" |
95 |
. if ${XORG_CAT} == "font" |
| 63 |
FONTDIR?= ${PORTNAME:C/.*-//g:S/type/Type/:S/ttf/TTF/:S/speedo/Speedo/} |
96 |
INSTALLS_FONTS= yes |
| 64 |
CONFIGURE_ARGS+= --with-fontrootdir=${PREFIX}/lib/X11/fonts |
97 |
FONTDIR?= ${PORTNAME:C/.*-//g:S/type/Type/:S/ttf/TTF/:S/speedo/Speedo/} |
| 65 |
CONFIGURE_ENV+= FONTROOTDIR=${PREFIX}/lib/X11/fonts |
98 |
FONTROOTDIR?= ${XORGFONTDIR} |
| 66 |
NEED_MKFONTFOO= yes |
99 |
. if ${PORTNAME} == "encodings" || ${PORTNAME} == "font-alias" || ${PORTNAME} == "font-util" |
| 67 |
|
100 |
# These ports do not install any fonts, they just need FONTROOTDIR, |
| 68 |
. if ${PORTNAME:M*type1*}x != x |
101 |
# CONFIGURE_ARGS, CONFIGURE_ENV and PLIST_SUB (some are defined below). |
| 69 |
INSTALLS_TTF?= yes |
102 |
. undef INSTALLS_FONTS |
| 70 |
. elif ${PORTNAME:M*ttf*}x != x |
103 |
. elif ${PORTNAME:M*type1*} == "" && ${PORTNAME:M*ttf*} == "" && ${PORTNAME:M*ethiopic*} == "" && ${PORTNAME:M*meltho*} == "" |
| 71 |
INSTALLS_TTF?= yes |
104 |
# We add this dependency to non-Type1/TTF fonts, i.e., bitmap fonts. |
| 72 |
. elif ${PORTNAME:M*encodings*}x != x |
|
|
| 73 |
# This is terrific, we want mkfontscale at build time, but don't use it like for the other ports. |
| 74 |
NEED_MKFONTFOO= no |
| 75 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale |
| 76 |
INSTALLS_TTF?= no |
| 77 |
. else |
| 78 |
INSTALLS_TTF?= no |
| 79 |
. endif |
| 80 |
|
| 81 |
. if ${PORTNAME:M*font-util*}x != x |
| 82 |
USE_GNOME+= gnomehack |
| 83 |
NEED_MKFONTFOO= no |
| 84 |
. elif ${INSTALLS_TTF} == "yes" |
| 85 |
USE_GNOME+= pkgconfig |
| 86 |
BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/fontconfig.pc:${PORTSDIR}/x11-fonts/fontconfig |
| 87 |
RUN_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/fontconfig.pc:${PORTSDIR}/x11-fonts/fontconfig |
| 88 |
. else |
| 89 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/bdftopcf:${PORTSDIR}/x11-fonts/bdftopcf |
105 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/bdftopcf:${PORTSDIR}/x11-fonts/bdftopcf |
| 90 |
. endif |
106 |
. endif |
| 91 |
|
|
|
| 92 |
. if ${NEED_MKFONTFOO} == "yes" |
| 93 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/mkfontdir:${PORTSDIR}/x11-fonts/mkfontdir \ |
| 94 |
${LOCALBASE}/bin/mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale |
| 95 |
RUN_DEPENDS+= ${LOCALBASE}/bin/mkfontdir:${PORTSDIR}/x11-fonts/mkfontdir \ |
| 96 |
${LOCALBASE}/bin/mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale |
| 97 |
. endif |
| 98 |
|
| 99 |
post-install: |
| 100 |
. if ${INSTALLS_TTF} == "yes" |
| 101 |
. for _fontdir in ${FONTDIR} |
| 102 |
@${ECHO_CMD} "@exec fc-cache -s %D/lib/X11/fonts/${_fontdir} 2>/dev/null || true" >> ${TMPPLIST} |
| 103 |
@${ECHO_CMD} "@unexec fc-cache -s %D/lib/X11/fonts/${_fontdir} 2>/dev/null || true" >> ${TMPPLIST} |
| 104 |
@${ECHO_CMD} "@unexec rmdir %D/lib/X11/fonts/${_fontdir} 2>/dev/null || true" >> ${TMPPLIST} |
| 105 |
. endfor |
| 106 |
. endif |
| 107 |
. for _fontdir in ${FONTDIR} |
| 108 |
. if ${NEED_MKFONTFOO} == "yes" |
| 109 |
@${ECHO_CMD} "@exec mkfontscale %D/lib/X11/fonts/${_fontdir} 2>/dev/null || true" >> ${TMPPLIST} |
| 110 |
@${ECHO_CMD} "@unexec mkfontscale %D/lib/X11/fonts/${_fontdir} 2>/dev/null || true" >> ${TMPPLIST} |
| 111 |
@${ECHO_CMD} "@unexec if [ -e %D/lib/X11/fonts/${_fontdir}/fonts.scale -a \"\`stat -f '%%z' %D/lib/X11/fonts/${_fontdir}/fonts.scale 2>/dev/null\`\" = '2' ]; then rm %D/lib/X11/fonts/${_fontdir}/fonts.scale; fi" >> ${TMPPLIST} |
| 112 |
@${ECHO_CMD} "@exec mkfontdir %D/lib/X11/fonts/${_fontdir} 2>/dev/null || true" >> ${TMPPLIST} |
| 113 |
@${ECHO_CMD} "@unexec mkfontdir %D/lib/X11/fonts/${_fontdir} 2>/dev/null || true" >> ${TMPPLIST} |
| 114 |
@${ECHO_CMD} "@unexec if [ -e %D/lib/X11/fonts/${_fontdir}/fonts.dir -a \"\`stat -f '%%z' %D/lib/X11/fonts/${_fontdir}/fonts.dir 2>/dev/null\`\" = '2' ]; then rm %D/lib/X11/fonts/${_fontdir}/fonts.dir; fi" >> ${TMPPLIST} |
| 115 |
. endif |
| 116 |
@${ECHO_CMD} "@unexec rmdir %D/lib/X11/fonts/${_fontdir} 2>/dev/null || true" >> ${TMPPLIST} |
| 117 |
. endfor |
| 118 |
. endif |
107 |
. endif |
| 119 |
|
108 |
|
| 120 |
. if ${XORG_CAT} == "lib" |
109 |
. if ${XORG_CAT} == "lib" |
|
Lines 139-144
Link Here
|
| 139 |
|
128 |
|
| 140 |
.endif |
129 |
.endif |
| 141 |
|
130 |
|
|
|
131 |
.if defined(INSTALLS_FONTS) |
| 132 |
# We will set USE_GNOME in post-makefile section, so we need this. |
| 133 |
WANT_GNOME= yes |
| 134 |
.endif |
| 135 |
|
| 142 |
.endif |
136 |
.endif |
| 143 |
|
137 |
|
| 144 |
.if defined(_POSTMKINCLUDED) && !defined(Xorg_Post_Include) |
138 |
.if defined(_POSTMKINCLUDED) && !defined(Xorg_Post_Include) |
|
Lines 260-263
Link Here
|
| 260 |
done |
254 |
done |
| 261 |
.endif |
255 |
.endif |
| 262 |
|
256 |
|
|
|
257 |
# We check fot XORG_CAT as this section is for those ports (listed above) with |
| 258 |
# XORG_CAT set to "font" which don't set INSTALLS_FONTS. |
| 259 |
.if defined(XORG_CAT) && ${XORG_CAT} == "font" || defined(INSTALLS_FONTS) |
| 260 |
# Default X.Org font installation directory. |
| 261 |
XORGFONTDIR?= ${PREFIX}/lib/X11/fonts |
| 262 |
FONTROOTDIR_REL?= ${FONTROOTDIR:S,^${PREFIX}/,,} |
| 263 |
CONFIGURE_ARGS+= --with-fontrootdir=${FONTROOTDIR} |
| 264 |
CONFIGURE_ENV+= FONTROOTDIR=${FONTROOTDIR} |
| 265 |
# When FONTDIR is set to multiple directories, we can't use it in |
| 266 |
# plist: use FONTROOTDIR then, and hardcode remaining path. |
| 267 |
PLIST_SUB+= FONTDIR="${FONTROOTDIR_REL}/${FONTDIR}" \ |
| 268 |
FONTROOTDIR="${FONTROOTDIR_REL}" |
| 269 |
.endif |
| 270 |
|
| 271 |
.if defined(INSTALLS_FONTS) |
| 272 |
FONTDIR?= ${PORTNAME:C/[-_][ot]tf$//:C/[-_]([ot]t)?fonts?$//} |
| 273 |
# Non-X.Org fonts go here. |
| 274 |
FONTROOTDIR?= ${PREFIX}/share/fonts |
| 275 |
USE_GNOME+= pkgconfig |
| 276 |
FONT_DEPENDS= ${LOCALBASE}/bin/mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale \ |
| 277 |
${LOCALBASE}/bin/mkfontdir:${PORTSDIR}/x11-fonts/mkfontdir \ |
| 278 |
${LOCALBASE}/bin/fc-cache:${PORTSDIR}/x11-fonts/fontconfig |
| 279 |
BUILD_DEPENDS+= ${FONT_DEPENDS} |
| 280 |
RUN_DEPENDS+= ${FONT_DEPENDS} |
| 281 |
# The same logic of PLIST_SUB applies. |
| 282 |
SUB_LIST+= FONTDIR="${FONTROOTDIR}/${FONTDIR}" \ |
| 283 |
FONTROOTDIR="${FONTROOTDIR}" |
| 284 |
.endif |
| 285 |
|
| 286 |
.if defined(INSTALLS_FONTS) |
| 287 |
# Install a default pkg-message in non-X.Org ports which don't provide |
| 288 |
# one already. |
| 289 |
. if !defined(XORG_CAT) && !exists(${PKGMESSAGE}) && (!exists(${FILESDIR}/pkg-message.in) || defined(SUB_FILES) && ${SUB_FILES:Mpkg-message} == "") |
| 290 |
FONTPKGMESSAGE= yes |
| 291 |
PKGMESSAGE= ${WRKDIR}/pkg-message |
| 292 |
. else |
| 293 |
FONTPKGMESSAGE= no |
| 294 |
. endif |
| 295 |
|
| 296 |
. if defined(XORG_CAT) |
| 297 |
pre-configure: fonts-pre-configure |
| 298 |
|
| 299 |
# Keep X.Org ports from running mkfontscale, mkfontdir and fc-cache: we'll do |
| 300 |
# that later. |
| 301 |
fonts-pre-configure: |
| 302 |
-@${REINPLACE_CMD} -e '/MKFONTSCALE/ d; /MKFONTDIR/ d; /FCCACHE/ d' \ |
| 303 |
${WRKSRC}/Makefile.in |
| 304 |
. endif |
| 305 |
|
| 306 |
pre-install: fonts-pre-install |
| 307 |
post-install: fonts-post-install |
| 308 |
# fonts-post-install would be better, but would "fail" if fonts.dir.fixed is |
| 309 |
# installed in post-install, so we create a target which comes later. |
| 310 |
add-plist-post: add-plist-fontdirs |
| 311 |
|
| 312 |
fonts-pre-install: |
| 313 |
. if ${FONTPKGMESSAGE} == yes |
| 314 |
@${ECHO_CMD} 'To use these fonts, add the following line(s) to the "Files" section' > ${PKGMESSAGE} |
| 315 |
@${ECHO_CMD} "of xorg.conf(5):" >> ${PKGMESSAGE} |
| 316 |
@${ECHO_CMD} >> ${PKGMESSAGE} |
| 317 |
. endif |
| 318 |
. for _fontdir in ${FONTDIR:O:S,^,${FONTROOTDIR}/,} |
| 319 |
@${MKDIR} ${_fontdir} |
| 320 |
. if ${FONTPKGMESSAGE} == yes |
| 321 |
@${ECHO_CMD} " FontPath \"${_fontdir}/\"" >> ${PKGMESSAGE} |
| 322 |
. endif |
| 323 |
. endfor |
| 324 |
|
| 325 |
fonts-post-install: |
| 326 |
. if ${FONTPKGMESSAGE} == yes |
| 327 |
@${CAT} ${PKGMESSAGE} |
| 328 |
. endif |
| 329 |
|
| 330 |
add-plist-fontdirs: |
| 331 |
. for _fontdir in ${FONTDIR:S,^,${FONTROOTDIR_REL}/,} |
| 332 |
@${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST} |
| 333 |
. if defined(WITH_PKGNG) |
| 334 |
@${ECHO_CMD} "@fontdir ${_fontdir}" >> ${TMPPLIST} |
| 335 |
. endif |
| 336 |
@${ECHO_MSG} "===> Updating font cache" |
| 337 |
. for t in scale dir |
| 338 |
@${ECHO_CMD} "mkfont${t} ${PREFIX}/${_fontdir}" |
| 339 |
@if [ -e ${PREFIX}/${_fontdir}/fonts.${t}.fixed ]; then \ |
| 340 |
${CP} ${PREFIX}/${_fontdir}/fonts.${t}.fixed ${PREFIX}/${_fontdir}/fonts.${t}; \ |
| 341 |
else \ |
| 342 |
mkfont${t} ${PREFIX}/${_fontdir}; \ |
| 343 |
fi |
| 344 |
@if [ -e ${PREFIX}/${_fontdir}/fonts.${t} -a "`stat -f '%z' ${PREFIX}/${_fontdir}/fonts.${t}`" = '2' ]; then ${RM} ${PREFIX}/${_fontdir}/fonts.${t}; fi |
| 345 |
. if !defined(WITH_PKGNG) |
| 346 |
@${ECHO_CMD} "@exec if [ -e %D/${_fontdir}/fonts.${t}.fixed ]; then ${CP} %D/${_fontdir}/fonts.${t}.fixed %D/${_fontdir}/fonts.${t}; else mkfont${t} %D/${_fontdir}; fi" >> ${TMPPLIST} |
| 347 |
@${ECHO_CMD} "@unexec mkfont${t} %D/${_fontdir}" >> ${TMPPLIST} |
| 348 |
. for cmd in exec unexec |
| 349 |
@${ECHO_CMD} "@${cmd} if [ -e %D/${_fontdir}/fonts.${t} -a \"\`stat -f '%%z' %D/${_fontdir}/fonts.${t}\`\" = '2' ]; then ${RM} %D/${_fontdir}/fonts.${t}; fi" >> ${TMPPLIST} |
| 350 |
. endfor |
| 351 |
. endif |
| 352 |
. endfor |
| 353 |
fc-cache -s ${PREFIX}/${_fontdir} |
| 354 |
. if !defined(WITH_PKGNG) |
| 355 |
@${ECHO_CMD} "@exec fc-cache -s %D/${_fontdir}" >> ${TMPPLIST} |
| 356 |
@${ECHO_CMD} "@unexec fc-cache -s %D/${_fontdir}" >> ${TMPPLIST} |
| 357 |
@${ECHO_CMD} "@unexec ${RMDIR} %D/${_fontdir} 2>/dev/null || ${TRUE}" >> ${TMPPLIST} |
| 358 |
. endif |
| 359 |
. endfor |
| 360 |
. if !defined(XORG_CAT) |
| 361 |
. if defined(WITH_PKGNG) |
| 362 |
@${ECHO_CMD} "@dirrmtry ${FONTROOTDIR_REL}" >> ${TMPPLIST} |
| 363 |
. else |
| 364 |
@${ECHO_CMD} "@unexec ${RMDIR} %D/${FONTROOTDIR_REL} 2>/dev/null || ${TRUE}" >> ${TMPPLIST} |
| 365 |
. endif |
| 366 |
. endif |
| 367 |
.endif |
| 368 |
|
| 263 |
.endif |
369 |
.endif |