commit: 7ad7b980f0cc6497bed201469ce0d5949260d558 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Apr 1 23:20:01 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sat Apr 2 03:07:31 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ad7b980
media-libs/fontconfig: add 2.14.0 - Clean up ebuild - Rebased patches (and submitted our docbook one upstream) - Add json-c test-only dependency - Scrub patches - Drop global scope usage from 2.13.93 while at it (fixes previous cleanup) - Rely on cache generation to create /var/cache/fontconfig Closes: https://bugs.gentoo.org/587492 Closes: https://bugs.gentoo.org/710184 Closes: https://bugs.gentoo.org/785100 Fixes: 35ac56d0683de8ad8ab4316b109ef77a88a77300 Signed-off-by: Sam James <sam <AT> gentoo.org> media-libs/fontconfig/Manifest | 1 + .../files/fontconfig-2.10.2-docbook.patch | 6 +- .../files/fontconfig-2.13.1-proper_homedir.patch | 10 -- .../files/fontconfig-2.13.1-static_build.patch | 10 -- .../files/fontconfig-2.14.0-docbook.patch | 29 +++++ .../files/fontconfig-2.14.0-latin-update.patch | 66 ++++++++++ .../fontconfig-2.14.0-skip-bubblewrap-tests.patch | 14 ++ media-libs/fontconfig/fontconfig-2.13.93.ebuild | 2 - ...fig-2.13.93.ebuild => fontconfig-2.14.0.ebuild} | 141 ++++++++++++--------- 9 files changed, 196 insertions(+), 83 deletions(-) diff --git a/media-libs/fontconfig/Manifest b/media-libs/fontconfig/Manifest index 21aef1e5b150..a42cf3ac9874 100644 --- a/media-libs/fontconfig/Manifest +++ b/media-libs/fontconfig/Manifest @@ -1,2 +1,3 @@ DIST fontconfig-2.13.1.tar.bz2 1723639 BLAKE2B 08b9a522a9d89bc5e5ed0f0898182359efb110f22b6b7010f6bdda0d6d516957ea74ebe0703d684d4724fd9f44a2eaf50d8329d4e0f4e45e79f50466d808b9e1 SHA512 f97f2a9db294fd72d416a7d76dd7db5934ade2cf76903764b09e7decc33e0e2eed1a1d35c5f1c7fd9ea39e2c7653b9e65365f0c6205e047e95e38ba5000dd100 DIST fontconfig-2.13.93.tar.xz 1418288 BLAKE2B 2be273c21c16f9bb2dfe618177eaf2de48610a145d402ba53becc1c4c2d0417a9cd0ce969d4521ff00c8c71e4b1d65e4bf945da56e140434244b81e7e24ecb7a SHA512 1ba119ea3faba662e108df6fce22f242eb2b7c5ec087159ca0cb76944991b19563f744c181263343941c50547bc0c73c6437d5380df09b5029facaab80465b58 +DIST fontconfig-2.14.0.tar.xz 1431056 BLAKE2B 880f34d33ac30158ea61e922f6635900c5b244c2eb5d259f7947a364df86ee13f6190f651471b0a28bcd3c13f19c970783517903df374839e474921611dff1ff SHA512 a5257249d031b3cd1a7b1521cd58f48d235a970020da4136a727db5407ec98e74a3776bc467d7e39f30ec664f56ff9fe39068317744a5e737a65109f7a005bfc diff --git a/media-libs/fontconfig/files/fontconfig-2.10.2-docbook.patch b/media-libs/fontconfig/files/fontconfig-2.10.2-docbook.patch index 33d6549c8147..94bea6327148 100644 --- a/media-libs/fontconfig/files/fontconfig-2.10.2-docbook.patch +++ b/media-libs/fontconfig/files/fontconfig-2.10.2-docbook.patch @@ -1,6 +1,6 @@ -diff --unified -uNrp fontconfig-2.10.2-orig/configure.ac fontconfig-2.10.2/configure.ac ---- fontconfig-2.10.2-orig/configure.ac 2012-11-26 09:21:13.000000000 +0100 -+++ fontconfig-2.10.2/configure.ac 2013-01-05 15:40:54.541682239 +0100 +https://bugs.gentoo.org/310157 +--- fontconfig-2.10.2-orig/configure.ac ++++ fontconfig-2.10.2/configure.ac @@ -570,7 +570,11 @@ AC_SUBST(XMLDIR) # Let people not build/install docs if they don't have docbook # diff --git a/media-libs/fontconfig/files/fontconfig-2.13.1-proper_homedir.patch b/media-libs/fontconfig/files/fontconfig-2.13.1-proper_homedir.patch index 19aee94ba988..71c27f56f644 100644 --- a/media-libs/fontconfig/files/fontconfig-2.13.1-proper_homedir.patch +++ b/media-libs/fontconfig/files/fontconfig-2.13.1-proper_homedir.patch @@ -7,8 +7,6 @@ Subject: [PATCH] Fix the issue that '~' wasn't extracted to the proper homedir this behavior was broken by d1f48f11. this change fixes it back to the correct behavior. https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/110 -diff --git a/src/fccfg.c b/src/fccfg.c -index d7c48e8..4a53581 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -2207,17 +2207,19 @@ FcConfigFilename (const FcChar8 *url) @@ -40,8 +38,6 @@ index d7c48e8..4a53581 100644 return file; } -diff --git a/test/Makefile.am b/test/Makefile.am -index 79bcede..9f4d48a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -91,6 +91,22 @@ test_bz106632_CFLAGS = \ @@ -67,9 +63,6 @@ index 79bcede..9f4d48a 100644 EXTRA_DIST=run-test.sh run-test-conf.sh $(TESTDATA) out.expected-long-family-names out.expected-no-long-family-names CLEANFILES=out out1 out2 fonts.conf out.expected -diff --git a/test/test-issue110.c b/test/test-issue110.c -new file mode 100644 -index 0000000..28a3bd2 --- /dev/null +++ b/test/test-issue110.c @@ -0,0 +1,245 @@ @@ -318,6 +311,3 @@ index 0000000..28a3bd2 + return retval; +} + --- -2.18.0 - diff --git a/media-libs/fontconfig/files/fontconfig-2.13.1-static_build.patch b/media-libs/fontconfig/files/fontconfig-2.13.1-static_build.patch index 7a0edfd849ab..d78317da0b3c 100644 --- a/media-libs/fontconfig/files/fontconfig-2.13.1-static_build.patch +++ b/media-libs/fontconfig/files/fontconfig-2.13.1-static_build.patch @@ -4,9 +4,6 @@ Date: Mon, 3 Sep 2018 04:56:16 +0000 Subject: [PATCH] Fix the build issue with --enable-static Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/109 ---- -diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h -index bac1dda..af870d0 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -1076,6 +1076,10 @@ FcUtf16Len (const FcChar8 *string, @@ -20,8 +17,6 @@ index bac1dda..af870d0 100644 FcPublic FcChar8 * FcStrDirname (const FcChar8 *file); -diff --git a/src/fcint.h b/src/fcint.h -index de78cd8..a9d075a 100644 --- a/src/fcint.h +++ b/src/fcint.h @@ -1282,10 +1282,6 @@ FcStrUsesHome (const FcChar8 *s); @@ -35,8 +30,6 @@ index de78cd8..a9d075a 100644 FcPrivate FcChar8 * FcStrLastSlash (const FcChar8 *path); -diff --git a/test/test-bz106632.c b/test/test-bz106632.c -index daa0c1e..2d67c2e 100644 --- a/test/test-bz106632.c +++ b/test/test-bz106632.c @@ -25,25 +25,26 @@ @@ -96,6 +89,3 @@ index daa0c1e..2d67c2e 100644 int main (void) { --- -2.18.0 - diff --git a/media-libs/fontconfig/files/fontconfig-2.14.0-docbook.patch b/media-libs/fontconfig/files/fontconfig-2.14.0-docbook.patch new file mode 100644 index 000000000000..b9d5e8e5b5e2 --- /dev/null +++ b/media-libs/fontconfig/files/fontconfig-2.14.0-docbook.patch @@ -0,0 +1,29 @@ +https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/223 + +From d4a8381169984246dbb14b7a810abd170d7d0afd Mon Sep 17 00:00:00 2001 +From: Sam James <s...@gentoo.org> +Date: Sat, 2 Apr 2022 02:36:24 +0100 +Subject: [PATCH] configure.ac: allow disabling docbook + +Sometimes we might want to build docs (install man pages, etc) +but allow disabling use of docbook. + +Bug: https://bugs.gentoo.org/310157 +Signed-off-by: Sam James <s...@gentoo.org> +--- a/configure.ac ++++ b/configure.ac +@@ -736,7 +736,13 @@ dnl =========================================================================== + # Let people not build/install docs if they don't have docbook + # + +-AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no) ++AC_ARG_ENABLE(docbook, ++ [AS_HELP_STRING([--disable-docbook], ++ [Disable building docs with docbook2html (default: no)])],,) ++ ++if test x$enable_docbook != xno; then ++ AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no) ++fi + + AM_CONDITIONAL(USEDOCBOOK, test "x$HASDOCBOOK" = xyes) + diff --git a/media-libs/fontconfig/files/fontconfig-2.14.0-latin-update.patch b/media-libs/fontconfig/files/fontconfig-2.14.0-latin-update.patch new file mode 100644 index 000000000000..2ae36f4ae4d6 --- /dev/null +++ b/media-libs/fontconfig/files/fontconfig-2.14.0-latin-update.patch @@ -0,0 +1,66 @@ +https://bugs.gentoo.org/130466 +--- a/conf.d/60-latin.conf ++++ b/conf.d/60-latin.conf +@@ -5,47 +5,50 @@ + <alias> + <family>serif</family> + <prefer> ++ <family>Liberation Serif</family> + <family>Noto Serif</family> + <family>DejaVu Serif</family> + <family>Times New Roman</family> +- <family>Thorndale AMT</family> + <family>Luxi Serif</family> + <family>Nimbus Roman No9 L</family> + <family>Nimbus Roman</family> + <family>Times</family> ++ <family>Thorndale AMT</family> + </prefer> + </alias> + <alias> + <family>sans-serif</family> + <prefer> ++ <family>Liberation Sans</family> + <family>Noto Sans</family> + <family>DejaVu Sans</family> +- <family>Verdana</family> + <family>Arial</family> +- <family>Albany AMT</family> + <family>Luxi Sans</family> + <family>Nimbus Sans L</family> + <family>Nimbus Sans</family> + <family>Helvetica</family> + <family>Lucida Sans Unicode</family> + <family>BPG Glaho International</family> <!-- lat,cyr,arab,geor --> ++ <family>Verdana</family> + <family>Tahoma</family> <!-- lat,cyr,greek,heb,arab,thai --> ++ <family>Albany AMT</family> + </prefer> + </alias> + <alias> + <family>monospace</family> + <prefer> ++ <family>Liberation Mono</family> + <family>Noto Sans Mono</family> + <family>DejaVu Sans Mono</family> + <family>Inconsolata</family> + <family>Andale Mono</family> + <family>Courier New</family> +- <family>Cumberland AMT</family> + <family>Luxi Mono</family> + <family>Nimbus Mono L</family> + <family>Nimbus Mono</family> + <family>Nimbus Mono PS</family> + <family>Courier</family> ++ <family>Cumberland AMT</family> + </prefer> + </alias> + <!-- +@@ -66,6 +69,7 @@ + <alias> + <family>cursive</family> + <prefer> ++ <family>Comic Neue</family> + <family>ITC Zapf Chancery Std</family> + <family>Zapfino</family> + <family>Comic Sans MS</family> diff --git a/media-libs/fontconfig/files/fontconfig-2.14.0-skip-bubblewrap-tests.patch b/media-libs/fontconfig/files/fontconfig-2.14.0-skip-bubblewrap-tests.patch new file mode 100644 index 000000000000..7d0041ad9765 --- /dev/null +++ b/media-libs/fontconfig/files/fontconfig-2.14.0-skip-bubblewrap-tests.patch @@ -0,0 +1,14 @@ +https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/320 +--- a/test/run-test.sh ++++ b/test/run-test.sh +@@ -40,9 +40,7 @@ EXPECTED=${EXPECTED-"out.expected"} + FCLIST="$LOG_COMPILER ../fc-list/fc-list$EXEEXT" + FCCACHE="$LOG_COMPILER ../fc-cache/fc-cache$EXEEXT" + +-if [ -x "$(command -v bwrap)" ]; then +- BWRAP="$(command -v bwrap)" +-fi ++BWRAP="" + + FONT1=$TESTDIR/4x6.pcf + FONT2=$TESTDIR/8x16.pcf diff --git a/media-libs/fontconfig/fontconfig-2.13.93.ebuild b/media-libs/fontconfig/fontconfig-2.13.93.ebuild index a88e04398db3..72b70d969b41 100644 --- a/media-libs/fontconfig/fontconfig-2.13.93.ebuild +++ b/media-libs/fontconfig/fontconfig-2.13.93.ebuild @@ -51,8 +51,6 @@ PATCHES=( # Patches from upstream (can usually be removed with next version bump) ) -MULTILIB_CHOST_TOOLS=( /usr/bin/fc-cache$(get_exeext) ) - pkg_setup() { DOC_CONTENTS="Please make fontconfig configuration changes using \`eselect fontconfig\`. Any changes made to /etc/fonts/fonts.conf will be diff --git a/media-libs/fontconfig/fontconfig-2.13.93.ebuild b/media-libs/fontconfig/fontconfig-2.14.0.ebuild similarity index 56% copy from media-libs/fontconfig/fontconfig-2.13.93.ebuild copy to media-libs/fontconfig/fontconfig-2.14.0.ebuild index a88e04398db3..64af2b159179 100644 --- a/media-libs/fontconfig/fontconfig-2.13.93.ebuild +++ b/media-libs/fontconfig/fontconfig-2.14.0.ebuild @@ -1,8 +1,10 @@ # Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 +# Cannot yet migrate to Meson as of 2.14.0: +# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/244 inherit autotools multilib-minimal readme.gentoo-r1 DESCRIPTION="A library for configuring and customizing font access" @@ -11,20 +13,33 @@ SRC_URI="https://fontconfig.org/release/${P}.tar.xz" LICENSE="MIT" SLOT="1.0" -[[ $(ver_cut 3) -ge 90 ]] || \ -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" -IUSE="doc static-libs" - -# Test test-bz106632 is known to be broken, see bug #751232 -# and would require several backports. It will be fixed in -# next version. -# check-missing-doc is known to be broken, see bug #733608 -# because fontconfig-2.13.1-static_build.patch introduces a -# function FcStrBuildFilename which is lacking documentation. -# However, backporting isn't worth it. Will be fixed in -# next version. -RESTRICT="test" - +if ! [[ $(ver_cut 3) -ge 90 ]] ; then + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" +fi +IUSE="doc static-libs test" +RESTRICT="!test? ( test )" + +# - Check minimum freetype & other deps on bumps. See +# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/blob/main/configure.ac#L314. +# Note that FT versioning is confusing, need to map it using +# https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/VERSIONS.TXT +# But sometimes it's actually greater than that, e.g. see Fedora's spec file +# https://src.fedoraproject.org/rpms/fontconfig/blob/rawhide/f/fontconfig.spec#_1 +# +# - Purposefully dropped the xml USE flag and libxml2 support. Expat is the +# default and used by every distro. See bug #283191. +# +# - There's a test-only dep on json-c. +# It might become an optional(?) runtime dep in future though. Who knows. +# Keep an eye on it. +RDEPEND=">=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}] + >=media-libs/freetype-2.9.1[${MULTILIB_USEDEP}] + !elibc_Darwin? ( !elibc_SunOS? ( sys-apps/util-linux[${MULTILIB_USEDEP}] ) ) + elibc_Darwin? ( sys-libs/native-uuid ) + elibc_SunOS? ( sys-libs/libuuid ) + virtual/libintl[${MULTILIB_USEDEP}]" +DEPEND="${RDEPEND} + test? ( dev-libs/json-c )" BDEPEND="dev-util/gperf >=sys-devel/gettext-0.19.8 virtual/pkgconfig @@ -32,91 +47,98 @@ BDEPEND="dev-util/gperf =app-text/docbook-sgml-dtd-3.1* app-text/docbook-sgml-utils[jadetex] )" -# Purposefully dropped the xml USE flag and libxml2 support. Expat is the -# default and used by every distro. See bug #283191. -RDEPEND=">=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}] - >=media-libs/freetype-2.9[${MULTILIB_USEDEP}] - !elibc_Darwin? ( !elibc_SunOS? ( sys-apps/util-linux[${MULTILIB_USEDEP}] ) ) - elibc_Darwin? ( sys-libs/native-uuid ) - elibc_SunOS? ( sys-libs/libuuid ) - virtual/libintl[${MULTILIB_USEDEP}]" -DEPEND="${RDEPEND}" PDEPEND="!x86-winnt? ( app-eselect/eselect-fontconfig ) virtual/ttf-fonts" PATCHES=( - "${FILESDIR}"/${PN}-2.10.2-docbook.patch # 310157 - "${FILESDIR}"/${PN}-2.13.93-latin-update.patch # 130466 + make liberation default + # bug #310157 + "${FILESDIR}"/${PN}-2.14.0-docbook.patch + # bug #130466 + make liberation default + "${FILESDIR}"/${PN}-2.14.0-latin-update.patch + # Avoid test failure (bubblewrap doesn't work within sandbox) + "${FILESDIR}"/${PN}-2.14.0-skip-bubblewrap-tests.patch # Patches from upstream (can usually be removed with next version bump) ) -MULTILIB_CHOST_TOOLS=( /usr/bin/fc-cache$(get_exeext) ) - -pkg_setup() { - DOC_CONTENTS="Please make fontconfig configuration changes using - \`eselect fontconfig\`. Any changes made to /etc/fonts/fonts.conf will be - overwritten. If you need to reset your configuration to upstream defaults, - delete the directory ${EROOT}/etc/fonts/conf.d/ and re-emerge fontconfig." -} +DOC_CONTENTS="Please make fontconfig configuration changes using +\`eselect fontconfig\`. Any changes made to /etc/fonts/fonts.conf will be +overwritten. If you need to reset your configuration to upstream defaults, +delete the directory ${EROOT}/etc/fonts/conf.d/ and re-emerge fontconfig." src_prepare() { default - eautoreconf - # https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/272 - # Please remove on next version bump! - if [[ "${PV}" == 2.13.93 ]] ; then - local sgmlfile - for sgmlfile in doc/*.fncs ; do - touch -r ${sgmlfile} ${sgmlfile//.fncs/.sgml} || die - done - else - die "Forgot to clean up src_prepare()" - fi + # Needed for docbook patch + eautoreconf } multilib_src_configure() { - local addfonts - # harvest some font locations, such that users can benefit from the + local addfonts=( + "${EPREFIX}"/usr/local/share/fonts + ) + + # Harvest some font locations, such that users can benefit from the # host OS's installed fonts case ${CHOST} in *-darwin*) - addfonts=",/Library/Fonts,/System/Library/Fonts" + addfonts+=( + /Library/Fonts + /System/Library/Fonts + ) ;; + *-solaris*) [[ -d /usr/X/lib/X11/fonts/TrueType ]] && \ - addfonts=",/usr/X/lib/X11/fonts/TrueType" - [[ -d /usr/X/lib/X11/fonts/Type1 ]] && \ - addfonts="${addfonts},/usr/X/lib/X11/fonts/Type1" + addfonts+=( /usr/X/lib/X11/fonts/TrueType ) + [[ -d /usr/X/lib/X11/fonts/Type1 ]] && + addfonts+=( /usr/X/lib/X11/fonts/Type1 ) ;; + *-linux-gnu) use prefix && [[ -d /usr/share/fonts ]] && \ - addfonts=",/usr/share/fonts" + addfonts+=( /usr/share/fonts ) ;; esac local myeconfargs=( $(use_enable doc docbook) $(use_enable static-libs static) + + # man pages. We split out the docbook parts into its own flag. --enable-docs + # We handle this ourselves. + --disable-cache-build + # See comment above *DEPEND. We use Expat instead. + --disable-libxml2 + --localstatedir="${EPREFIX}"/var --with-default-fonts="${EPREFIX}"/usr/share/fonts - --with-add-fonts="${EPREFIX}/usr/local/share/fonts${addfonts}" + --with-add-fonts=$(IFS=, ; echo "${addfonts[*]}" ) --with-templatedir="${EPREFIX}"/etc/fonts/conf.avail ) ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" } +multilib_src_test() { + # Test needs network access + # https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/319 + # On bumps after 2.14.0, please check to see if this has been fixed + # to allow local access! + chmod -x test/test-crbug1004254 || die + + default +} + multilib_src_install() { MULTILIB_CHOST_TOOLS=( /usr/bin/fc-cache$(get_exeext) ) default - # avoid calling this multiple times, bug #459210 + # Avoid calling this multiple times, bug #459210 if multilib_is_native_abi; then - # stuff installed from build-dir + # Stuff installed from build-dir emake -C doc DESTDIR="${D}" install-man insinto /etc/fonts @@ -126,6 +148,7 @@ multilib_src_install() { multilib_src_install_all() { einstalldocs + find "${ED}" -name "*.la" -delete || die # fc-lang directory contains language coverage datafiles @@ -154,11 +177,13 @@ multilib_src_install_all() { readme.gentoo_create_doc - keepdir /var/cache/${PN} + # We allow the cache generation to make this later + # bug #587492 + rm -r "${ED}"/var/cache/fontconfig || die } pkg_preinst() { - # Bug #193476 + # bug #193476 # /etc/fonts/conf.d/ contains symlinks to ../conf.avail/ to include various # config files. If we install as-is, we'll blow away user settings. ebegin "Syncing fontconfig configuration to system" @@ -185,7 +210,7 @@ pkg_postinst() { readme.gentoo_print_elog - if [[ ${ROOT} == "" ]] ; then + if [[ -z ${ROOT} ]] ; then multilib_pkg_postinst() { ebegin "Creating global font cache for ${ABI}" "${EPREFIX}"/usr/bin/${CHOST}-fc-cache -srf