[Libreoffice-commits] core.git: config_host/config_harfbuzz.h.in config_host.mk.in configure.ac download.lst harfbuzz/ExternalPackage_harfbuzz.mk harfbuzz/ExternalProject_harfbuzz.mk harfbuzz/harfbuzz.configure.patch.1 harfbuzz/Makefile harfbuzz/Module_harfbuzz.mk harfbuzz/README harfbuzz/UnpackedTarball_harfbuzz.mk Makefile.fetch RepositoryExternal.mk RepositoryModule_host.mk vcl/Library_vcl.mk vcl/Library_vclplug_gen.mk

Khaled Hosny khaledhosny at eglug.org
Tue Apr 23 01:00:34 PDT 2013


 Makefile.fetch                       |    1 
 RepositoryExternal.mk                |   33 ++++++++++++
 RepositoryModule_host.mk             |    1 
 config_host.mk.in                    |    4 +
 config_host/config_harfbuzz.h.in     |    6 ++
 configure.ac                         |   20 +++++++
 download.lst                         |    1 
 harfbuzz/ExternalPackage_harfbuzz.mk |   34 ++++++++++++
 harfbuzz/ExternalProject_harfbuzz.mk |   37 +++++++++++++
 harfbuzz/Makefile                    |    7 ++
 harfbuzz/Module_harfbuzz.mk          |   22 ++++++++
 harfbuzz/README                      |    1 
 harfbuzz/UnpackedTarball_harfbuzz.mk |   18 ++++++
 harfbuzz/harfbuzz.configure.patch.1  |   93 +++++++++++++++++++++++++++++++++++
 vcl/Library_vcl.mk                   |    1 
 vcl/Library_vclplug_gen.mk           |    1 
 16 files changed, 280 insertions(+)

New commits:
commit 7e389f4def1964ee38bb93b575926a089e84bae6
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sat Apr 20 13:00:56 2013 +0200

    Add HarfBuzz support to the build system
    
    To be used in the next commit.
    
    Change-Id: I6ee286d0c050a5ca650e7fb3692b0facccb5f0c0
    Reviewed-on: https://gerrit.libreoffice.org/3517
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/Makefile.fetch b/Makefile.fetch
index bfc882d..e683f28 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -112,6 +112,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
 		$(call fetch_Optional,GLIBC,$(GLIBC_TARBALL)) \
 		$(call fetch_Optional,HSQLDB,$(HSQLDB_TARBALL)) \
 		$(call fetch_Optional,HUNSPELL,$(HUNSPELL_TARBALL)) \
+		$(call fetch_Optional,HARFBUZZ,$(HARFBUZZ_TARBALL)) \
 		$(call fetch_Optional,HYPHEN,$(HYPHEN_TARBALL)) \
 		$(call fetch_Optional,ICU,$(ICU_TARBALL)) \
 		$(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_FLOW_ENGINE_TARBALL)) \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index f3ee5dd..807150d 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1186,6 +1186,39 @@ endef
 
 endif # SYSTEM_ICU
 
+ifeq ($(ENABLE_HARFBUZZ),YES)
+ifeq ($(SYSTEM_HARFBUZZ),YES)
+
+define gb_LinkTarget__use_harfbuzz
+$(call gb_LinkTarget_set_include,$(1),\
+	$$(INCLUDE) \
+	$(HARFBUZZ_CFLAGS) \
+)
+$(call gb_LinkTarget_add_libs,$(1),$(HARFBUZZ_LIBS))
+
+endef
+
+else # SYSTEM_HARFBUZZ != YES
+
+$(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
+	harfbuzz \
+))
+define gb_LinkTarget__use_harfbuzz
+$(call gb_LinkTarget_use_package,$(1),\
+	harfbuzz \
+)
+$(call gb_LinkTarget_use_static_libraries,$(1),\
+	harfbuzz \
+)
+
+endef
+
+endif # SYSTEM_HARFBUZZ
+else # ENABLE_HARFBUZZ != YES
+
+gb_LinkTarget__use_harfbuzz :=
+
+endif # ENABLE_HARFBUZZ
 
 ifeq ($(DISABLE_OPENSSL),YES)
 
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index b9854f7..1b939f1 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -72,6 +72,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	framework \
 	$(call gb_Helper_optional,FREETYPE,freetype) \
 	$(call gb_Helper_optional,GRAPHITE,graphite) \
+	$(call gb_Helper_optional,HARFBUZZ,harfbuzz) \
 	$(call gb_Helper_optional,DESKTOP,helpcompiler) \
 	$(call gb_Helper_optional,HELP,helpcontent2) \
 	$(call gb_Helper_optional,HSQLDB,hsqldb) \
diff --git a/config_host.mk.in b/config_host.mk.in
index 4256fa7..ad33e7d 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -122,6 +122,7 @@ export ENABLE_GCONF=@ENABLE_GCONF@
 export ENABLE_GIO=@ENABLE_GIO@
 export ENABLE_GNOMEVFS=@ENABLE_GNOMEVFS@
 export ENABLE_GRAPHITE=@ENABLE_GRAPHITE@
+export ENABLE_HARFBUZZ=@ENABLE_HARFBUZZ@
 export ENABLE_GSTREAMER=@ENABLE_GSTREAMER@
 export ENABLE_GSTREAMER_0_10=@ENABLE_GSTREAMER_0_10@
 export ENABLE_GTK3=@ENABLE_GTK3@
@@ -196,6 +197,8 @@ export GPERF=@GPERF@
 export GPERF=@GPERF@
 export GRAPHITE_CFLAGS=$(gb_SPACE)@GRAPHITE_CFLAGS@
 export GRAPHITE_LIBS=$(gb_SPACE)@GRAPHITE_LIBS@
+export HARFBUZZ_CFLAGS=$(gb_SPACE)@HARFBUZZ_CFLAGS@
+export HARFBUZZ_LIBS=$(gb_SPACE)@HARFBUZZ_LIBS@
 @x_Cygwin@ export GREP=@WIN_GREP@
 export GSSAPI_LIBS=@GSSAPI_LIBS@
 export GSTREAMER_0_10_CFLAGS=$(gb_SPACE)@GSTREAMER_0_10_CFLAGS@
@@ -478,6 +481,7 @@ export SYSTEM_GENBRK=@SYSTEM_GENBRK@
 export SYSTEM_GENCCODE=@SYSTEM_GENCCODE@
 export SYSTEM_GENCMN=@SYSTEM_GENCMN@
 export SYSTEM_GRAPHITE=@SYSTEM_GRAPHITE@
+export SYSTEM_HARFBUZZ=@SYSTEM_HARFBUZZ@
 export SYSTEM_HSQLDB=@SYSTEM_HSQLDB@
 export SYSTEM_HUNSPELL=@SYSTEM_HUNSPELL@
 export SYSTEM_HYPH=@SYSTEM_HYPH@
diff --git a/config_host/config_harfbuzz.h.in b/config_host/config_harfbuzz.h.in
new file mode 100644
index 0000000..b408f52
--- /dev/null
+++ b/config_host/config_harfbuzz.h.in
@@ -0,0 +1,6 @@
+#ifndef CONFIG_HARFBUZZ_H
+#define CONFIG_HARFBUZZ_H
+
+#define ENABLE_HARFBUZZ 0
+
+#endif
diff --git a/configure.ac b/configure.ac
index 2152487..6b844d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -720,6 +720,11 @@ AC_ARG_ENABLE(graphite,
         [Enables the compilation of Graphite smart font rendering.])
 )
 
+AC_ARG_ENABLE(harfbuzz,
+    AS_HELP_STRING([--enable-harfbuzz],
+        [Determines whether to use HarfBuzz text layout engine.])
+)
+
 AC_ARG_ENABLE(fetch-external,
     AS_HELP_STRING([--disable-fetch-external],
         [Disables fetching external tarballs from web sources.])
@@ -8378,6 +8383,20 @@ fi
 AC_SUBST(ENABLE_GRAPHITE)
 
 dnl ===================================================================
+dnl HarfBuzz
+dnl ===================================================================
+AC_MSG_CHECKING([whether to enable HarfBuzz support])
+if test "$_os" != "WINNT" -a "$_os" != "Darwin" && test "$enable_harfbuzz" = "" -o "$enable_harfbuzz" != "no"; then
+    AC_MSG_RESULT([yes])
+    ENABLE_HARFBUZZ="TRUE"
+    AC_DEFINE(ENABLE_HARFBUZZ)
+    libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz >= 0.9.10])
+else
+    AC_MSG_RESULT([no])
+fi
+AC_SUBST(ENABLE_HARFBUZZ)
+
+dnl ===================================================================
 dnl Check for NPAPI interface to plug browser plugins into LibreOffice documents
 dnl ===================================================================
 AC_MSG_CHECKING([whether to plug browser plugins into LibreOffice documents])
@@ -11880,6 +11899,7 @@ AC_CONFIG_HEADERS([config_host/config_clang.h])
 AC_CONFIG_HEADERS([config_host/config_features.h])
 AC_CONFIG_HEADERS([config_host/config_global.h])
 AC_CONFIG_HEADERS([config_host/config_graphite.h])
+AC_CONFIG_HEADERS([config_host/config_harfbuzz.h])
 AC_CONFIG_HEADERS([config_host/config_kde4.h])
 AC_CONFIG_HEADERS([config_host/config_mingw.h])
 AC_CONFIG_HEADERS([config_host/config_oox.h])
diff --git a/download.lst b/download.lst
index fe61f6f..bb1b2d6 100644
--- a/download.lst
+++ b/download.lst
@@ -38,6 +38,7 @@ export GRAPHITE_TARBALL := f5ef3f7f10fa8c3542c6a085a233080b-graphite2-1.2.0.tgz
 export GLIBC_TARBALL := 4a660ce8466c9df01f19036435425c3a-glibc-2.1.3-stub.tar.gz
 export HSQLDB_TARBALL := 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip
 export HUNSPELL_TARBALL := 3121aaf3e13e5d88dfff13fb4a5f1ab8-hunspell-1.3.2.tar.gz
+export HARFBUZZ_TARBALL := 90855e670c790c1fec4592908be3c0b8-harfbuzz-0.9.16.tar.bz2
 export HYPHEN_TARBALL := a2f6010987e1c601274ab5d63b72c944-hyphen-2.8.4.tar.gz
 export ICU_TARBALL := 6eef33b229d0239d654983028c9c7053-icu4c-51_1-src.tgz
 export JFREEREPORT_FLOW_ENGINE_TARBALL := ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
diff --git a/harfbuzz/ExternalPackage_harfbuzz.mk b/harfbuzz/ExternalPackage_harfbuzz.mk
new file mode 100644
index 0000000..0894b2e7
--- /dev/null
+++ b/harfbuzz/ExternalPackage_harfbuzz.mk
@@ -0,0 +1,34 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,harfbuzz,harfbuzz))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,harfbuzz,inc/external/harfbuzz,\
+	src/hb.h \
+	src/hb-blob.h \
+	src/hb-buffer.h \
+	src/hb-common.h \
+	src/hb-font.h \
+	src/hb-icu.h \
+	src/hb-ot.h \
+	src/hb-ot-layout.h \
+	src/hb-ot-tag.h \
+	src/hb-set.h \
+	src/hb-shape.h \
+	src/hb-shape-plan.h \
+	src/hb-unicode.h \
+	src/hb-version.h \
+))
+
+$(eval $(call gb_ExternalPackage_use_external_project,harfbuzz,harfbuzz))
+
+$(eval $(call gb_ExternalPackage_add_file,harfbuzz,lib/libharfbuzz.a,src/.libs/libharfbuzz.a))
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/harfbuzz/ExternalProject_harfbuzz.mk b/harfbuzz/ExternalProject_harfbuzz.mk
new file mode 100644
index 0000000..ef1d823
--- /dev/null
+++ b/harfbuzz/ExternalProject_harfbuzz.mk
@@ -0,0 +1,37 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,harfbuzz))
+
+$(eval $(call gb_ExternalProject_use_unpacked,harfbuzz,harfbuzz))
+
+$(eval $(call gb_ExternalProject_use_autoconf,harfbuzz,build))
+
+$(eval $(call gb_ExternalProject_register_targets,harfbuzz,\
+	build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,harfbuzz,\
+	icu \
+))
+
+$(call gb_ExternalProject_get_state_target,harfbuzz,build) :
+	$(call gb_ExternalProject_run,build,\
+		export ICU_LIBS=" " \
+		&& export ICU_CFLAGS="$(if $(filter NO,$(SYSTEM_ICU)),\
+			-I$(call gb_UnpackedTarball_get_dir,icu)/source/i18n \
+			-I$(call gb_UnpackedTarball_get_dir,icu)/source/common, )" \
+		&& ./configure \
+			--enable-static \
+			--disable-shared \
+			$(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+		&& (cd $(EXTERNAL_WORKDIR)/src && $(MAKE) libharfbuzz.la) \
+	)
+
+# vim: set noet sw=4 ts=4:
diff --git a/harfbuzz/Makefile b/harfbuzz/Makefile
new file mode 100644
index 0000000..ccb1c85
--- /dev/null
+++ b/harfbuzz/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/harfbuzz/Module_harfbuzz.mk b/harfbuzz/Module_harfbuzz.mk
new file mode 100644
index 0000000..8eb9c17
--- /dev/null
+++ b/harfbuzz/Module_harfbuzz.mk
@@ -0,0 +1,22 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,harfbuzz))
+
+ifeq ($(SYSTEM_HARFBUZZ),NO)
+
+$(eval $(call gb_Module_add_targets,harfbuzz,\
+	ExternalPackage_harfbuzz \
+	ExternalProject_harfbuzz \
+	UnpackedTarball_harfbuzz \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/harfbuzz/README b/harfbuzz/README
new file mode 100644
index 0000000..d2af8b5
--- /dev/null
+++ b/harfbuzz/README
@@ -0,0 +1 @@
+HarfBuzz is an OpenType text shaping engine. From [http://harfbuzz.org/].
diff --git a/harfbuzz/UnpackedTarball_harfbuzz.mk b/harfbuzz/UnpackedTarball_harfbuzz.mk
new file mode 100644
index 0000000..4b98988
--- /dev/null
+++ b/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -0,0 +1,18 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,harfbuzz))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,harfbuzz,$(HARFBUZZ_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
+	harfbuzz/harfbuzz.configure.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/harfbuzz/harfbuzz.configure.patch.1 b/harfbuzz/harfbuzz.configure.patch.1
new file mode 100644
index 0000000..dc83c86
--- /dev/null
+++ b/harfbuzz/harfbuzz.configure.patch.1
@@ -0,0 +1,93 @@
+diff -ur harfbuzz.org/configure harfbuzz/configure
+--- harfbuzz.org/configure	2013-04-22 20:45:32.738213297 +0200
++++ harfbuzz/configure	2013-04-22 20:46:56.334209801 +0200
+@@ -16813,7 +16885,7 @@
+ 
+ 
+ 
+-have_hb_old=true
++have_hb_old=false
+ if $have_hb_old; then
+ 
+ $as_echo "#define HAVE_HB_OLD 1" >>confdefs.h
+@@ -16829,7 +16901,7 @@
+ 
+ 
+ 
+-have_ucdn=true
++have_ucdn=false
+ if $have_ucdn; then
+ 
+ $as_echo "#define HAVE_UCDN 1" >>confdefs.h
+@@ -16914,7 +16986,7 @@
+ 	GLIB_LIBS=$pkg_cv_GLIB_LIBS
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-	have_glib=true
++	have_glib=false
+ fi
+ if $have_glib; then
+ 
+@@ -16999,7 +17071,7 @@
+ 	GOBJECT_LIBS=$pkg_cv_GOBJECT_LIBS
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-	have_gobject=true
++	have_gobject=false
+ fi
+ if $have_gobject; then
+ 
+@@ -17087,7 +17159,7 @@
+ 	CAIRO_LIBS=$pkg_cv_CAIRO_LIBS
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-	have_cairo=true
++	have_cairo=false
+ fi
+ if $have_cairo; then
+ 
+@@ -17172,7 +17244,7 @@
+ 	CAIRO_FT_LIBS=$pkg_cv_CAIRO_FT_LIBS
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-	have_cairo_ft=true
++	have_cairo_ft=false
+ fi
+ if $have_cairo_ft; then
+ 
+@@ -17457,7 +17529,7 @@
+ 	ICU_LE_LIBS=$pkg_cv_ICU_LE_LIBS
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-	have_icu_le=true
++	have_icu_le=false
+ fi
+ if test "$have_icu_le" != "true"; then
+ 	if test -n "$ac_tool_prefix"; then
+@@ -17654,7 +17726,7 @@
+ 	GRAPHITE2_LIBS=$pkg_cv_GRAPHITE2_LIBS
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-	have_graphite=true
++	have_graphite=false
+ fi
+ if $have_graphite; then
+ 
+@@ -17740,7 +17812,7 @@
+ 	FREETYPE_LIBS=$pkg_cv_FREETYPE_LIBS
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-	have_freetype=true
++	have_freetype=false
+ fi
+ if $have_freetype; then
+ 
+@@ -17825,7 +17897,7 @@
+ ac_fn_c_check_type "$LINENO" "CTFontRef" "ac_cv_type_CTFontRef" "#include <ApplicationServices/ApplicationServices.h>
+ "
+ if test "x$ac_cv_type_CTFontRef" = xyes; then :
+-  have_coretext=true
++  have_coretext=false
+ else
+   have_coretext=false
+ fi
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index ab66d47..69705ea 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -347,6 +347,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 endif
 
 $(eval $(call gb_Library_use_external,vcl,graphite))
+$(eval $(call gb_Library_use_external,vcl,harfbuzz))
 
 endif
 
diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk
index bea09db..5aad457 100644
--- a/vcl/Library_vclplug_gen.mk
+++ b/vcl/Library_vclplug_gen.mk
@@ -47,6 +47,7 @@ $(eval $(call gb_Library_use_externals,vclplug_gen,\
 	boost_headers \
 	cairo \
 	graphite \
+	harfbuzz \
 	icule \
 	icuuc \
 	valgrind \


More information about the Libreoffice-commits mailing list