[vlc-commits] [Git][videolan/vlc][master] 10 commits: contrib: libxml2: require 2.6 or higher

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Jul 5 08:04:45 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
61a5fe6f by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: libxml2: require 2.6 or higher

This is the requirement from fontconfig (built on all platforms but windows)
and libbluray.

- - - - -
d59f6358 by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: use a generic flag to tell if a platform builds fontconfig or not

Then each target can use it if it's available as it's usually better than builtin font lookup.

It is built on those platforms
- Windows: No
- Darwin: No
- Emscripten: No
- Android: Yes
- Linux: Yes
- BSD: Yes
- others: Yes

- - - - -
5d9cddeb by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: ass: use the global BUILD_WITH_FONTCONFIG to know if a platform uses fontconfig

- - - - -
f55a001e by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: bluray: use the global BUILD_WITH_FONTCONFIG to know if a platform uses fontconfig

That enables usage of fontconfig on Android. Otherwise it was returning this error:

> BD-J font config support not compiled in

- - - - -
628ef883 by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: freetype2: match minimum requirement with fontconfig requirements

fontconfig requires freetype 21.0.15 since 2.12.91 [^1].
harfbuzz requires freetype 20.0.14 since 14.2.1 [^2].

[^1]: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/f504b2d6a149930cbbe745d56713bd88425a87fd
[^2]: https://github.com/harfbuzz/harfbuzz/commit/ef1b37502ac9f277bcb59acebc16b6c025242f7d

- - - - -
148470ce by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: fontconfig: update to 2.18.1

Changelogs:
- https://gitlab.freedesktop.org/fontconfig/fontconfig/-/releases/2.18.1
- https://gitlab.freedesktop.org/fontconfig/fontconfig/-/releases/2.18.0
- https://gitlab.freedesktop.org/fontconfig/fontconfig/-/releases/2.17.1
- https://gitlab.freedesktop.org/fontconfig/fontconfig/-/releases/2.17.0
- https://gitlab.freedesktop.org/fontconfig/fontconfig/-/releases/2.16.2
- https://www.freedesktop.org/software/fontconfig/release/ChangeLog-2.16.0
- https://www.freedesktop.org/software/fontconfig/release/ChangeLog-2.15.0

- - - - -
06f17951 by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: fontconfig: pick more default font folders in macOS

It will pick [^1]:

['/System/Library/Fonts', '/Library/Fonts', '~/Library/Fonts', '/System/Library/Assets', '/System/Library/AssetsV2']

[^1]: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/blob/2.18.1/configure.ac?ref_type=tags&plain=1#L580

- - - - -
dafee75a by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: fontconfig: use the global BUILD_WITH_FONTCONFIG to build by default

- - - - -
4806edd6 by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: fontconfig: never run fc-cache during the build

- - - - -
fe6e76a9 by Steve Lhomme at 2026-07-05T07:37:18+00:00
contrib: fontconfig: remove --with-freetype-config option

PKGS is not fully set until all the rules.mak have been processed.
Given fontconfig comes before freetype in alphabetical order it's likely that
freetype2 has not been added to PKGS.
In any case, that option has no effect in 2.18.1 anymore and we freetype doesn't
generate this file.

- - - - -


8 changed files:

- contrib/src/ass/rules.mak
- contrib/src/bluray/rules.mak
- − contrib/src/fontconfig/0001-detect-mkostemp-with-stdlib.h.patch
- contrib/src/fontconfig/SHA512SUMS
- contrib/src/fontconfig/rules.mak
- contrib/src/freetype2/rules.mak
- contrib/src/libxml2/rules.mak
- contrib/src/main.mak


Changes:

=====================================
contrib/src/ass/rules.mak
=====================================
@@ -11,26 +11,6 @@ ifneq ($(filter aarch64 i386 x86_64, $(ARCH)),)
 WITH_ASS_ASM = 1
 endif
 
-ifdef HAVE_ANDROID
-WITH_FONTCONFIG = 1
-else
-ifdef HAVE_DARWIN_OS
-WITH_FONTCONFIG = 0
-WITH_CORETEXT = 1
-else
-ifdef HAVE_WIN32
-WITH_FONTCONFIG = 0
-WITH_DWRITE = 1
-else
-ifdef HAVE_EMSCRIPTEN
-WITH_FONTCONFIG = 0
-else
-WITH_FONTCONFIG = 1
-endif
-endif
-endif
-endif
-
 $(TARBALLS)/libass-$(ASS_VERSION).tar.xz:
 	$(call download_pkg,$(ASS_URL),ass)
 
@@ -43,18 +23,18 @@ libass: libass-$(ASS_VERSION).tar.xz .sum-ass
 DEPS_ass = freetype2 $(DEPS_freetype2) fribidi $(DEPS_fribidi) iconv $(DEPS_iconv) harfbuzz $(DEPS_harfbuzz)
 
 ASS_CONF = -Dauto_features=disabled
-ifneq ($(WITH_FONTCONFIG), 0)
+ifneq ($(BUILD_WITH_FONTCONFIG), 0)
 DEPS_ass += fontconfig $(DEPS_fontconfig)
 ASS_CONF += -Dfontconfig=enabled
 else
 ASS_CONF += -Drequire-system-font-provider=false
 endif
 
-ifeq ($(WITH_DWRITE), 1)
+ifdef HAVE_WIN32
 ASS_CONF += -Ddirectwrite=enabled
 endif
 
-ifeq ($(WITH_CORETEXT), 1)
+ifdef HAVE_DARWIN_OS
 ASS_CONF += -Dcoretext=enabled
 endif
 


=====================================
contrib/src/bluray/rules.mak
=====================================
@@ -12,20 +12,6 @@ ifeq ($(call need_pkg,"libbluray >= 1.1.0"),)
 PKGS_FOUND += bluray
 endif
 
-ifdef HAVE_ANDROID
-WITH_FONTCONFIG = 0
-else
-ifdef HAVE_DARWIN_OS
-WITH_FONTCONFIG = 0
-else
-ifdef HAVE_WIN32
-WITH_FONTCONFIG = 0
-else
-WITH_FONTCONFIG = 1
-endif
-endif
-endif
-
 DEPS_bluray = libxml2 $(DEPS_libxml2) freetype2 $(DEPS_freetype2)
 
 BLURAY_CONF = -Dfreetype=enabled -Dlibxml2=enabled
@@ -33,7 +19,7 @@ ifdef HAVE_CROSS_COMPILE
 BLURAY_CONF += -Denable_tools=false
 endif
 
-ifneq ($(WITH_FONTCONFIG), 0)
+ifneq ($(BUILD_WITH_FONTCONFIG), 0)
 DEPS_bluray += fontconfig $(DEPS_fontconfig)
 BLURAY_CONF += -Dfontconfig=enabled
 


=====================================
contrib/src/fontconfig/0001-detect-mkostemp-with-stdlib.h.patch deleted
=====================================
@@ -1,62 +0,0 @@
-From d72fa7a842405592a3b38282e59639843147601b Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <slhomme at matroska.org>
-Date: Fri, 10 Oct 2025 12:01:35 +0200
-Subject: [PATCH] detect mkostemp with stdlib.h
-
-On Apple platforms it may be detected as available by
-just linking with it.
-But when calling it it may be turned into a weak
-reference that will fail to run on older platforms.
-
-It's possible to get around this using __builtin_available() [^1]
-but due to the way this code is used a clean fallback is not
-possible.
-
-It's available since macOS 10.12, iOS 10.0, tvOS 10.0 and watchOS 3.0.
-
-[^1]: https://clang.llvm.org/docs/LanguageExtensions.html#objective-c-available
----
- configure.ac | 4 +++-
- meson.build  | 4 ++--
- 2 files changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index f2cf27ef..1cc95dd8 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -194,7 +194,9 @@ AC_TYPE_PID_T
- # Checks for library functions.
- AC_FUNC_VPRINTF
- AC_FUNC_MMAP
--AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r readlink fstatvfs fstatfs lstat strerror strerror_r])
-+AC_CHECK_FUNCS([link mkstemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r readlink fstatvfs fstatfs lstat strerror strerror_r])
-+
-+AC_CHECK_DECL([mkostemp],[AC_DEFINE_UNQUOTED([HAVE_MKOSTEMP],[1],[Define to 1 if you have the 'mkostemp' function.])],[],[#include <stdlib.h>])
- 
- AC_SEARCH_LIBS([fabs], [m], [], [AC_MSG_ERROR([unable to find the fabs() function])])
- 
-diff --git a/meson.build b/meson.build
-index d71643db..4202eb5f 100644
---- a/meson.build
-+++ b/meson.build
-@@ -118,7 +118,6 @@ check_headers = [
- check_funcs = [
-   ['link'],
-   ['mkstemp'],
--  ['mkostemp'],
-   ['_mktemp_s'],
-   ['mkdtemp'],
-   ['getopt'],
-@@ -156,7 +155,8 @@ check_freetype_funcs = [
- ]
- 
- check_header_symbols = [
--  ['posix_fadvise', 'fcntl.h']
-+  ['posix_fadvise', 'fcntl.h'],
-+  ['mkostemp', 'stdlib.h'],
- ]
- 
- check_struct_members = [
--- 
-2.50.1 (Apple Git-155)
-


=====================================
contrib/src/fontconfig/SHA512SUMS
=====================================
@@ -1 +1 @@
-73287cc3f8f8261a27c2920b0f9430dd6e3ac8733fb2ba55e1b5934cee211023b6415e1d14ddad04ef3c7819727ed34d80aa503d2734bdfc2f1c733c4096463f  fontconfig-2.14.2.tar.gz
+5d637a030625fa5b55399a2711b4dd48949429caae4b80503655bc7bd12b9a58cc278b520660845c9e93dcac4631ad5c36bf97793ac1af1b8f3131e7bd22077c  fontconfig-2.18.1.tar.xz


=====================================
contrib/src/fontconfig/rules.mak
=====================================
@@ -1,41 +1,27 @@
 # fontconfig
 
-FONTCONFIG_VERSION := 2.14.2
-FONTCONFIG_URL := https://www.freedesktop.org/software/fontconfig/release/fontconfig-$(FONTCONFIG_VERSION).tar.gz
+FONTCONFIG_VERSION := 2.18.1
+FONTCONFIG_URL := https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/$(FONTCONFIG_VERSION)/fontconfig-$(FONTCONFIG_VERSION).tar.xz
 
-ifndef HAVE_WIN32
+ifneq ($(BUILD_WITH_FONTCONFIG), 0)
 PKGS += fontconfig
 endif
 ifeq ($(call need_pkg,"fontconfig >= 2.11"),)
 PKGS_FOUND += fontconfig
 endif
 
-$(TARBALLS)/fontconfig-$(FONTCONFIG_VERSION).tar.gz:
+$(TARBALLS)/fontconfig-$(FONTCONFIG_VERSION).tar.xz:
 	$(call download_pkg,$(FONTCONFIG_URL),fontconfig)
 
-.sum-fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz
+.sum-fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.xz
 
-fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz .sum-fontconfig
+fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.xz .sum-fontconfig
 	$(UNPACK)
 	$(call update_autoconfig,.)
-	$(RM) $(UNPACK_DIR)/src/fcobjshash.gperf
-	# include the generated fcobjshash.h, not the one from src/
-	sed -i.orig -e 's,"fcobjshash.h",<fcobjshash.h>,' $(UNPACK_DIR)/src/fcobjs.c
-	$(APPLY) $(SRC)/fontconfig/0001-detect-mkostemp-with-stdlib.h.patch
 	$(call pkg_static, "fontconfig.pc.in")
 	$(MOVE)
 
-FONTCONFIG_CONF := --enable-libxml2 --disable-docs
-FONTCONFIG_INSTALL :=
-ifdef HAVE_MACOSX
-# fc-cache crashes on macOS
-FONTCONFIG_INSTALL += RUN_FC_CACHE_TEST=false
-endif
-
-# FreeType flags
-ifneq ($(findstring freetype2,$(PKGS)),)
-FONTCONFIG_CONF += --with-freetype-config="$(PREFIX)/bin/freetype-config"
-endif
+FONTCONFIG_CONF := --enable-libxml2 --disable-docs --disable-cache-build
 
 ifdef HAVE_CROSS_COMPILE
 FONTCONFIG_CONF += --with-arch=$(ARCH)
@@ -43,9 +29,7 @@ endif
 
 ifdef HAVE_MACOSX
 FONTCONFIG_CONF += \
-	--with-cache-dir=~/Library/Caches/fontconfig \
-	--with-default-fonts=/System/Library/Fonts \
-	--with-add-fonts=/Library/Fonts,~/Library/Fonts
+	--with-cache-dir=~/Library/Caches/fontconfig
 endif
 
 ifdef HAVE_ANDROID
@@ -57,10 +41,12 @@ endif
 
 DEPS_fontconfig = freetype2 $(DEPS_freetype2) libxml2 $(DEPS_libxml2)
 
+# assume va_copy works as the test fails when cross compiling
+FONTCONFIG_CONF += ac_cv_va_copy=.C99
+
 .fontconfig: fontconfig
-	$(RECONF)
 	$(MAKEBUILDDIR)
 	$(MAKECONFIGURE) $(FONTCONFIG_CONF)
 	+$(MAKEBUILD)
-	+$(MAKEBUILD) $(FONTCONFIG_INSTALL) install
+	+$(MAKEBUILD) install
 	touch $@


=====================================
contrib/src/freetype2/rules.mak
=====================================
@@ -4,9 +4,15 @@ FREETYPE2_VERSION := 2.13.1
 FREETYPE2_URL := $(SF)/freetype/freetype2/$(FREETYPE2_VERSION)/freetype-$(FREETYPE2_VERSION).tar.xz
 
 PKGS += freetype2
-ifeq ($(call need_pkg,"freetype2"),)
+ifeq ($(BUILD_WITH_FONTCONFIG), 1)
+ifeq ($(call need_pkg,"freetype2 >= 21.0.15"),)
 PKGS_FOUND += freetype2
 endif
+else # without fontconfig
+ifeq ($(call need_pkg,"freetype2 >= 20.0.14"),)
+PKGS_FOUND += freetype2
+endif
+endif
 
 $(TARBALLS)/freetype-$(FREETYPE2_VERSION).tar.xz:
 	$(call download_pkg,$(FREETYPE2_URL),freetype2)


=====================================
contrib/src/libxml2/rules.mak
=====================================
@@ -4,7 +4,7 @@ LIBXML2_VERSION := 2.15.3
 LIBXML2_URL := https://download.gnome.org/sources/libxml2/2.15/libxml2-$(LIBXML2_VERSION).tar.xz
 
 PKGS += libxml2
-ifeq ($(call need_pkg,"libxml-2.0"),)
+ifeq ($(call need_pkg,"libxml-2.0 >= 2.6"),)
 PKGS_FOUND += libxml2
 endif
 


=====================================
contrib/src/main.mak
=====================================
@@ -635,6 +635,26 @@ ifdef QT_USES_SYSTEM_TOOLS
 QT_CMAKE_CONFIG += -DQT_NO_PACKAGE_VERSION_CHECK=TRUE
 endif
 
+##### fontconfig
+ifdef HAVE_ANDROID
+BUILD_WITH_FONTCONFIG := 1
+else
+ifdef HAVE_DARWIN_OS
+BUILD_WITH_FONTCONFIG := 0
+else
+ifdef HAVE_WIN32
+BUILD_WITH_FONTCONFIG := 0
+else
+ifdef HAVE_EMSCRIPTEN
+BUILD_WITH_FONTCONFIG := 0
+else
+BUILD_WITH_FONTCONFIG := 1
+endif
+endif
+endif
+endif
+
+
 ifdef GPL
 REQUIRE_GPL =
 else



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/912031c86d39c9aae42dbf00ab522e9b0f17881c...fe6e76a9060aa7982e24bf5c8931be5c5bf4f7e7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/912031c86d39c9aae42dbf00ab522e9b0f17881c...fe6e76a9060aa7982e24bf5c8931be5c5bf4f7e7
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list