diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2025-04-08 12:19:31 +0200 |
---|---|---|
committer | Khaled Hosny <khaled@libreoffice.org> | 2025-04-14 18:35:42 +0200 |
commit | ae24fc8c639b230284f94e837497cd7919f79d21 (patch) | |
tree | 0e9cb0e8a0f20b7086c350feb494a5879c1982ce /external/harfbuzz | |
parent | 233539764fa1751e9f0495468d410d8574860f13 (diff) |
harfbuzz: migrate to meson
Change-Id: I33aa7ca814409b39b9adb7da1d168c5ebb11b14d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183345
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
Diffstat (limited to 'external/harfbuzz')
-rw-r--r-- | external/harfbuzz/ExternalProject_harfbuzz.mk | 70 | ||||
-rw-r--r-- | external/harfbuzz/UnpackedTarball_harfbuzz.mk | 1 | ||||
-rw-r--r-- | external/harfbuzz/icu_75.patch.0 | 88 |
3 files changed, 39 insertions, 120 deletions
diff --git a/external/harfbuzz/ExternalProject_harfbuzz.mk b/external/harfbuzz/ExternalProject_harfbuzz.mk index 633d3658ce86..ee02b95753ec 100644 --- a/external/harfbuzz/ExternalProject_harfbuzz.mk +++ b/external/harfbuzz/ExternalProject_harfbuzz.mk @@ -9,8 +9,6 @@ $(eval $(call gb_ExternalProject_ExternalProject,harfbuzz)) -$(eval $(call gb_ExternalProject_use_autoconf,harfbuzz,build)) - $(eval $(call gb_ExternalProject_register_targets,harfbuzz,\ build \ )) @@ -20,37 +18,47 @@ $(eval $(call gb_ExternalProject_use_externals,harfbuzz,\ graphite \ )) -$(call gb_ExternalProject_get_state_target,harfbuzz,build) : +# We cannot use environment vars inside the meson cross-build file, +# so we're going to have to generate one on-the-fly. +# mungle variables into python list format +cross_c = '$(subst $(WHITESPACE),'$(COMMA)',$(strip $(gb_CC)))' +cross_cxx = '$(subst $(WHITESPACE),'$(COMMA)',$(strip $(gb_CXX)))' +define gb_harfbuzz_cross_compile +[binaries] +c = [$(cross_c)] +cpp = [$(cross_cxx)] +c_ld = [$(subst cl.exe,link.exe,$(cross_c))] +cpp_ld = [$(subst cl.exe,link.exe,$(cross_c))] +ar = '$(AR)' +strip = '$(STRIP)' +# TODO: this is pretty ugly... +[host_machine] +system = '$(if $(filter WNT,$(OS)),windows,$(if $(filter MACOSX,$(OS)),darwin,$(if $(filter ANDROID,$(OS)),android,linux)))' +cpu_family = '$(RTL_ARCH)' +cpu = '$(if $(filter x86,$(RTL_ARCH)),i686,$(if $(filter X86_64,$(RTL_ARCH)),x86_64,$(if $(filter AARCH64,$(RTL_ARCH)),aarch64,armv7)))' +endian = '$(ENDIANNESS)' +endef + +# cannot use CROSS_COMPILING as condition since we have cross-compilation "light" for cases where +# the builder can run the host binaries, like for example when compiling for win 32bit on win 64bit +$(call gb_ExternalProject_get_state_target,harfbuzz,build) : | $(call gb_ExternalExecutable_get_dependencies,python) $(call gb_Trace_StartRange,harfbuzz,EXTERNAL) + $(file >$(gb_UnpackedTarball_workdir)/harfbuzz/cross-file.txt,$(gb_harfbuzz_cross_compile)) $(call gb_ExternalProject_run,build,\ - $(if $(CROSS_COMPILING),ICU_CONFIG=$(SRCDIR)/external/icu/cross-bin/icu-config) \ - $(if $(SYSTEM_ICU),,ICU_CONFIG=$(SRCDIR)/external/icu/cross-bin/icu-config) \ - GRAPHITE2_CFLAGS="$(GRAPHITE_CFLAGS)" \ - GRAPHITE2_LIBS="$(GRAPHITE_LIBS)" \ - $(gb_RUN_CONFIGURE) ./configure \ - --enable-static \ - --disable-shared \ - --disable-gtk-doc \ - --with-pic \ - --with-icu=builtin \ - --with-freetype=no \ - --with-fontconfig=no \ - --with-cairo=no \ - --with-glib=no \ - --with-graphite2=yes \ - $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ - $(if $(gb_FULLDEPS),,--disable-dependency-tracking) \ - --libdir=$(gb_UnpackedTarball_workdir)/harfbuzz/src/.libs \ - $(gb_CONFIGURE_PLATFORMS) \ - CXXFLAGS=' \ - $(if $(filter ANDROID,$(OS)),-DHB_NO_MMAP=1,) \ - $(call gb_ExternalProject_get_build_flags,harfbuzz) \ - $(if $(ENABLE_RUNTIME_OPTIMIZATIONS),,-frtti) \ - $(CXXFLAGS) $(CXXFLAGS_CXX11) \ - $(if $(filter LINUX,$(OS)),-fvisibility=hidden)' \ - LDFLAGS="$(call gb_ExternalProject_get_link_flags,harfbuzz)" \ - MAKE=$(MAKE) \ - && (cd $(EXTERNAL_WORKDIR)/src && $(MAKE) lib) \ + PKG_CONFIG_PATH="${PKG_CONFIG_PATH}$(LIBO_PATH_SEPARATOR)$(gb_UnpackedTarball_workdir)/graphite$(if $(SYSTEM_ICU),,$(LIBO_PATH_SEPARATOR)$(gb_UnpackedTarball_workdir)/icu)" \ + PYTHONWARNINGS= \ + $(call gb_ExternalExecutable_get_command,python) $(MESON) setup builddir \ + -Ddefault_library=static -Dbuildtype=$(if $(ENABLE_DEBUG),debug,release) \ + -Dauto_features=disabled \ + -Dcpp_std=$(subst -std:,,$(subst -std=,,$(filter -std%,$(CXXFLAGS_CXX11)))) \ + -Dtests=disabled \ + -Dutilities=disabled \ + -Dicu=enabled \ + -Dicu_builtin=true \ + -Dgraphite2=enabled \ + $(if $(filter-out $(BUILD_PLATFORM),$(HOST_PLATFORM))$(WSL),--cross-file cross-file.txt) && \ + $(call gb_ExternalExecutable_get_command,python) $(MESON) compile -C builddir lib \ + $(if $(verbose),--verbose) \ ) $(call gb_Trace_EndRange,harfbuzz,EXTERNAL) diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk index 6de80f0ea415..71627725fae7 100644 --- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk +++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk @@ -17,7 +17,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0)) $(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \ external/harfbuzz/tdf159529.patch.0 \ - external/harfbuzz/icu_75.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/harfbuzz/icu_75.patch.0 b/external/harfbuzz/icu_75.patch.0 deleted file mode 100644 index 9b14433211b0..000000000000 --- a/external/harfbuzz/icu_75.patch.0 +++ /dev/null @@ -1,88 +0,0 @@ ---- configure 2024-06-12 16:35:18.736933604 +0200 -+++ configure 2024-06-12 16:57:39.544214075 +0200 -@@ -22533,7 +22362,83 @@ - fi - - if $have_icu; then -- CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS icu-uc`" -+ is_icu75=false -+ -+pkg_failed=no -+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for icu-uc >= 75.1" >&5 -+printf %s "checking for icu-uc >= 75.1... " >&6; } -+ -+if test -n "$ICU_CFLAGS"; then -+ pkg_cv_ICU_CFLAGS="$ICU_CFLAGS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc >= 75.1\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "icu-uc >= 75.1") 2>&5 -+ ac_status=$? -+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-uc >= 75.1" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+if test -n "$ICU_LIBS"; then -+ pkg_cv_ICU_LIBS="$ICU_LIBS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc >= 75.1\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "icu-uc >= 75.1") 2>&5 -+ ac_status=$? -+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-uc >= 75.1" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+ -+ -+ -+if test $pkg_failed = yes; then -+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+printf "%s\n" "no" >&6; } -+ -+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -+ _pkg_short_errors_supported=yes -+else -+ _pkg_short_errors_supported=no -+fi -+ if test $_pkg_short_errors_supported = yes; then -+ ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-uc >= 75.1" 2>&1` -+ else -+ ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-uc >= 75.1" 2>&1` -+ fi -+ # Put the nasty error message in config.log where it belongs -+ echo "$ICU_PKG_ERRORS" >&5 -+ -+ : -+elif test $pkg_failed = untried; then -+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+printf "%s\n" "no" >&6; } -+ : -+else -+ ICU_CFLAGS=$pkg_cv_ICU_CFLAGS -+ ICU_LIBS=$pkg_cv_ICU_LIBS -+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+printf "%s\n" "yes" >&6; } -+ is_icu75=true -+fi -+ if $is_icu75; then -+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS -std=c++17 icu-uc`" -+ else -+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS icu-uc`" -+ fi - - printf "%s\n" "#define HAVE_ICU 1" >>confdefs.h - - |