diff --git a/x11-fonts/fontconfig/Makefile b/x11-fonts/fontconfig/Makefile index 2ae668106cf5..8aced7d414ae 100644 --- a/x11-fonts/fontconfig/Makefile +++ b/x11-fonts/fontconfig/Makefile @@ -1,77 +1,78 @@ # Created by: Joe Marcus Clarke PORTNAME= fontconfig DISTVERSION= 2.13.93 +PORTREVISION?= 1 PORTEPOCH= 1 CATEGORIES= x11-fonts MASTER_SITES= https://www.freedesktop.org/software/fontconfig/release/ MAINTAINER= desktop@FreeBSD.org COMMENT= XML-based font configuration API for X Windows LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libfreetype.so:print/freetype2 \ libexpat.so:textproc/expat2 USES= cpe gperf meson pkgconfig python:3.6+,build shebangfix tar:xz CPE_VENDOR= fontconfig_project USE_LDCONFIG= yes SHEBANG_FILES= conf.d/link_confs.py \ conf.d/write-35-lang-normalize-conf.py \ fc-case/fc-case.py \ fc-lang/fc-lang.py TEST_TARGET= test # Custom configuration variables FCDEFAULTFONTS= ${PREFIX}/share/fonts FCADDFONTS= ${LOCALBASE}/lib/X11/fonts # To avoid circular depdency docs (including manpages) needs to be disabled as # they depend on textproc/docbook-utils which requires fontconfig MESON_ARGS= -Ddefault_library=both -Ddoc=disabled PLIST_SUB= PREFERRED_HINTING=${PREFERRED_HINTING} OPTIONS_DEFINE= NLS BITMAPS TEST OPTIONS_DEFAULT=BITMAPS HINTING_SLIGHT OPTIONS_SUB= yes OPTIONS_SINGLE= HINTING .for opt in NONE SLIGHT MEDIUM FULL OPTIONS_SINGLE_HINTING+= HINTING_${opt} HINTING_${opt}_DESC= ${opt:tl} HINTING_${opt}_VARS= PREFERRED_HINTING=${opt:tl} .endfor BITMAPS_DESC= Enable bitmap fonts by default HINTING_DESC= Preferred pixel hinting configuration NLS_USES= gettext-tools NLS_MESON_ENABLED= nls TEST_MESON_ENABLED= tests post-patch: @${REINPLACE_CMD} -e 's|%%FCDEFAULTFONTS%%|${FCDEFAULTFONTS}|g' \ ${PATCH_WRKSRC}/meson.build @${REINPLACE_CMD} -e 's|%%FCADDFONTS%%|${FCADDFONTS}|g' \ ${PATCH_WRKSRC}/meson.build @${REINPLACE_CMD} -e 's|%%FCPREFERREDHINTING%%|${PREFERRED_HINTING}|g' \ ${PATCH_WRKSRC}/conf.d/meson.build post-install: ${MV} ${STAGEDIR}${PREFIX}/etc/fonts/fonts.conf ${STAGEDIR}${PREFIX}/etc/fonts/fonts.conf.sample @${MKDIR} ${STAGEDIR}/var/db/fontconfig post-install-BITMAPS-off: ${RLN} ${STAGEDIR}${PREFIX}/etc/fonts/conf.avail/70-no-bitmaps.conf ${STAGEDIR}${PREFIX}/etc/fonts/conf.d/70-no-bitmaps.conf post-install-BITMAPS-on: ${RM} ${STAGEDIR}${PREFIX}/etc/fonts/conf.d/70-no-bitmaps.conf ${RLN} ${STAGEDIR}${PREFIX}/etc/fonts/conf.avail/70-yes-bitmaps.conf ${STAGEDIR}${PREFIX}/etc/fonts/conf.d/70-yes-bitmaps.conf .include diff --git a/x11-fonts/fontconfig/files/patch-src_fccfg.c b/x11-fonts/fontconfig/files/patch-src_fccfg.c new file mode 100644 index 000000000000..210815161b2b --- /dev/null +++ b/x11-fonts/fontconfig/files/patch-src_fccfg.c @@ -0,0 +1,42 @@ +From df29933e1a06b7aa7af229bd7cd03c62d957f15f Mon Sep 17 00:00:00 2001 +From: Szunti +Date: Sun, 6 Dec 2020 12:52:44 +0100 +Subject: [PATCH] Check qual and compare for family tests + +Fixes #267. Hash table lookups assumed qual="any" compare="eq". +Add a test too. +--- src/fccfg.c.orig 2020-11-28 01:56:42 UTC ++++ src/fccfg.c +@@ -1714,6 +1714,7 @@ FcConfigMatchValueList (FcPattern *p, + FcExpr *e = t->expr; + FcValue value; + FcValueList *v; ++ FcOp op; + + while (e) + { +@@ -1731,10 +1732,23 @@ FcConfigMatchValueList (FcPattern *p, + + if (t->object == FC_FAMILY_OBJECT && table) + { +- if (!FamilyTableLookup (table, t->op, FcValueString (&value))) ++ op = FC_OP_GET_OP (t->op); ++ if (op == FcOpEqual || op == FcOpListing) + { ++ if (!FamilyTableLookup (table, t->op, FcValueString (&value))) ++ { + ret = 0; + goto done; ++ } ++ } ++ if (op == FcOpNotEqual && t->qual == FcQualAll) ++ { ++ ret = 0; ++ if (!FamilyTableLookup (table, t->op, FcValueString (&value))) ++ { ++ ret = values; ++ } ++ goto done; + } + } + for (v = values; v; v = FcValueListNext(v))