[vlc-commits] Contribs: add fontconfig

Jean-Baptiste Kempf git at videolan.org
Mon Jul 4 01:47:20 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Jul  4 01:43:25 2011 +0200| [f1faa9d8e7511839f897ba61f9b996ee94dc92ef] | committer: Jean-Baptiste Kempf

Contribs: add fontconfig

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f1faa9d8e7511839f897ba61f9b996ee94dc92ef
---

 contrib/src/ass/rules.mak                      |    4 +-
 contrib/src/fontconfig/SHA512SUMS              |    1 +
 contrib/src/fontconfig/fontconfig-march.patch  |   48 ++++++++++
 contrib/src/fontconfig/fontconfig-noxml2.patch |  110 ++++++++++++++++++++++++
 contrib/src/fontconfig/fontconfig-win32.patch  |   43 +++++++++
 contrib/src/fontconfig/rules.mak               |   51 +++++++++++
 6 files changed, 254 insertions(+), 3 deletions(-)

diff --git a/contrib/src/ass/rules.mak b/contrib/src/ass/rules.mak
index 522c6e5..7cd53a6 100644
--- a/contrib/src/ass/rules.mak
+++ b/contrib/src/ass/rules.mak
@@ -13,9 +13,7 @@ libass: libass-$(ASS_VERSION).tar.gz .sum-ass
 	$(UNPACK)
 	$(MOVE)
 
-#TODO .fontconfig
-
-.ass: libass .freetype2
+.ass: libass .freetype2 .fontconfig
 	#$(RECONF)
 	cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) -O3" ./configure $(HOSTCONF) --disable-png --disable-enca
 	cd $< && $(MAKE) install
diff --git a/contrib/src/fontconfig/SHA512SUMS b/contrib/src/fontconfig/SHA512SUMS
new file mode 100644
index 0000000..e635f7b
--- /dev/null
+++ b/contrib/src/fontconfig/SHA512SUMS
@@ -0,0 +1 @@
+a110e72cc631f1e374324a02f6ba9526b89a547cafe2ae27b9913938b19018843b2940084d62f0dfaf38a6919dea6974fb98422d3908026f6873d5fba17c55a0  fontconfig-2.8.0.tar.gz
diff --git a/contrib/src/fontconfig/fontconfig-march.patch b/contrib/src/fontconfig/fontconfig-march.patch
new file mode 100644
index 0000000..851ee07
--- /dev/null
+++ b/contrib/src/fontconfig/fontconfig-march.patch
@@ -0,0 +1,48 @@
+diff -urNp fontconfig.orig/fc-arch/Makefile.am fontconfig/fc-arch/Makefile.am
+--- fontconfig.orig/fc-arch/Makefile.am	2009-03-18 22:02:20.000000000 +0100
++++ fontconfig/fc-arch/Makefile.am	2010-01-11 17:58:51.000000000 +0100
+@@ -22,6 +22,8 @@
+ # PERFORMANCE OF THIS SOFTWARE.
+ #
+ 
++CPPFLAGS =
++CFLAGS =
+ CC = @CC_FOR_BUILD@
+ EXEEXT = @EXEEXT_FOR_BUILD@
+ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+diff -urNp fontconfig.orig/fc-case/Makefile.am fontconfig/fc-case/Makefile.am
+--- fontconfig.orig/fc-case/Makefile.am	2009-03-18 22:02:20.000000000 +0100
++++ fontconfig/fc-case/Makefile.am	2010-01-11 17:56:39.000000000 +0100
+@@ -22,6 +22,8 @@
+ # PERFORMANCE OF THIS SOFTWARE.
+ #
+ 
++CPPFLAGS =
++CFLAGS =
+ CC = @CC_FOR_BUILD@
+ EXEEXT = @EXEEXT_FOR_BUILD@
+ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+diff -urNp fontconfig.orig/fc-glyphname/Makefile.am fontconfig/fc-glyphname/Makefile.am
+--- fontconfig.orig/fc-glyphname/Makefile.am	2009-03-18 22:02:20.000000000 +0100
++++ fontconfig/fc-glyphname/Makefile.am	2010-01-11 17:57:29.000000000 +0100
+@@ -22,6 +22,8 @@
+ # PERFORMANCE OF THIS SOFTWARE.
+ #
+ 
++CPPFLAGS =
++CFLAGS =
+ CC = @CC_FOR_BUILD@
+ EXEEXT = @EXEEXT_FOR_BUILD@
+ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+diff -urNp fontconfig.orig/fc-lang/Makefile.am fontconfig/fc-lang/Makefile.am
+--- fontconfig.orig/fc-lang/Makefile.am	2009-06-24 19:52:10.000000000 +0200
++++ fontconfig/fc-lang/Makefile.am	2010-01-11 17:56:56.000000000 +0100
+@@ -22,6 +22,8 @@
+ # PERFORMANCE OF THIS SOFTWARE.
+ #
+ 
++CPPFLAGS =
++CFLAGS =
+ CC = @CC_FOR_BUILD@
+ EXEEXT = @EXEEXT_FOR_BUILD@
+ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
diff --git a/contrib/src/fontconfig/fontconfig-noxml2.patch b/contrib/src/fontconfig/fontconfig-noxml2.patch
new file mode 100644
index 0000000..6f7f6f5
--- /dev/null
+++ b/contrib/src/fontconfig/fontconfig-noxml2.patch
@@ -0,0 +1,110 @@
+--- fontconfig/src/fcxml.c	2009-08-13 16:07:13.000000000 +0200
++++ fontconfig.new/src/fcxml.c	2009-08-13 16:05:41.000000000 +0200
+@@ -23,6 +23,8 @@
+  */
+ 
+ #include "fcint.h"
++
++#if 0
+ #include <fcntl.h>
+ #include <stdarg.h>
+ #include <dirent.h>
+@@ -58,6 +60,8 @@
+ #undef STRICT
+ #endif
+ 
++#endif
++
+ static void
+ FcExprDestroy (FcExpr *e);
+ 
+@@ -71,6 +75,7 @@
+     free (test);
+ }
+ 
++#if 0
+ static FcExpr *
+ FcExprCreateInteger (FcConfig *config, int i)
+ {
+@@ -179,7 +184,7 @@
+     }
+     return e;
+ }
+-
++#endif
+ static void
+ FcExprDestroy (FcExpr *e)
+ {
+@@ -255,6 +260,7 @@
+     free (e);
+ }
+ 
++#if 0
+ typedef enum _FcElement {
+     FcElementNone,
+     FcElementFontconfig,
+@@ -2373,6 +2379,7 @@
+     const FcChar8    *bs = *((FcChar8 **) b);
+     return FcStrCmp (as, bs);
+ }
++#endif
+ 
+ static FcBool
+ FcConfigParseAndLoadDir (FcConfig	*config,
+@@ -2380,6 +2387,9 @@
+ 			 const FcChar8	*dir,
+ 			 FcBool		complain)
+ {
++    return FcFalse;
++}
++#if 0
+     DIR		    *d;
+     struct dirent   *e;
+     FcBool	    ret = FcTrue;
+@@ -2589,3 +2599,4 @@
+ #define __fcxml__
+ #include "fcaliastail.h"
+ #undef __fcxml__
++#endif
+diff -ruN fontconfig/src/fcxml.c fontconfig.new/src/fcxml.c
+--- fontconfig/src/fcxml.c	2009-08-13 16:08:49.000000000 +0200
++++ fontconfig.new/src/fcxml.c	2009-08-19 00:03:35.000000000 +0200
+@@ -2466,13 +2466,18 @@
+ bail0:
+     return ret || !complain;
+ }
++#endif
++
+ 
+ FcBool
+ FcConfigParseAndLoad (FcConfig	    *config,
+ 		      const FcChar8 *name,
+ 		      FcBool	    complain)
+ {
++    return FcFalse;
++}
+ 
++#if 0
+     XML_Parser	    p;
+     FcChar8	    *filename;
+     int		    fd;
+--- fontconfig/src/fcinit.c	2010-04-27 15:31:41.000000000 +0200
++++ fontconfig.new/src/fcinit.c	2010-04-27 15:35:42.000000000 +0200
+@@ -34,11 +34,16 @@
+     config = FcConfigCreate ();
+     if (!config)
+ 	goto bail0;
+-    if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
++    char *path = malloc( MAX_PATH + 1 );
++    GetWindowsDirectory( path, MAX_PATH + 1 );
++    strcat( path, "\\fonts" );
++//    printf( "Fonts dir: %s\n", path );
++    if (!FcConfigAddDir (config, (FcChar8 *) path))
+ 	goto bail1;
+     char dir[MAX_PATH+5];
+     SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, dir );
+     strncat( dir, "\\vlc", 4 );
++//    printf( "Cache dir: %s\n", dir );
+     if (!FcConfigAddCacheDir (config, (FcChar8 *)dir))
+ 	goto bail1;
+     return config;
diff --git a/contrib/src/fontconfig/fontconfig-win32.patch b/contrib/src/fontconfig/fontconfig-win32.patch
new file mode 100644
index 0000000..36d3211
--- /dev/null
+++ b/contrib/src/fontconfig/fontconfig-win32.patch
@@ -0,0 +1,43 @@
+diff -ruN fontconfig/src/fcint.h fontconfig.good/src/fcint.h
+--- fontconfig/src/Makefile.in	2009-06-24 21:05:27.000000000 +0200
++++ fontconfig.good/src/Makefile.in	2009-07-03 00:13:38.000000000 +0200
+@@ -664,7 +664,6 @@
+ # gcc import library install/uninstall
+ 
+ @OS_WIN32_TRUE at install-libtool-import-lib: 
+- at OS_WIN32_TRUE@	$(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir)
+ @OS_WIN32_TRUE@	$(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def
+ 
+ @OS_WIN32_TRUE at uninstall-libtool-import-lib:
+--- fontconfig/src/Makefile.am	2009-03-18 22:02:22.000000000 +0100
++++ fontconfig.good/src/Makefile.am	2009-07-03 00:12:50.000000000 +0200
+@@ -30,7 +30,6 @@
+ # gcc import library install/uninstall
+ 
+ install-libtool-import-lib: 
+-	$(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir)
+ 	$(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def
+ 
+ uninstall-libtool-import-lib:
+--- fontconfig/src/fcinit.c	2009-06-06 00:59:27.000000000 +0200
++++ fontconfig.good/src/fcinit.c	2009-07-13 14:58:37.000000000 +0200
+@@ -24,6 +24,7 @@
+ 
+ #include "fcint.h"
+ #include <stdlib.h>
++# include <shlobj.h>
+ 
+ static FcConfig *
+ FcInitFallbackConfig (void)
+@@ -35,7 +36,10 @@
+ 	goto bail0;
+     if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
+ 	goto bail1;
+-    if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
++    char dir[MAX_PATH+5];
++    SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, dir );
++    strncat( dir, "\\vlc", 4 );
++    if (!FcConfigAddCacheDir (config, (FcChar8 *)dir))
+ 	goto bail1;
+     return config;
+ 
diff --git a/contrib/src/fontconfig/rules.mak b/contrib/src/fontconfig/rules.mak
new file mode 100644
index 0000000..175e742
--- /dev/null
+++ b/contrib/src/fontconfig/rules.mak
@@ -0,0 +1,51 @@
+# fontconfig
+
+FONTCONFIG_VERSION := 2.8.0
+FONTCONFIG_URL := http://fontconfig.org/release/fontconfig-$(FONTCONFIG_VERSION).tar.gz
+
+PKGS += fontconfig
+
+$(TARBALLS)/fontconfig-$(FONTCONFIG_VERSION).tar.gz:
+	$(call download,$(FONTCONFIG_URL))
+
+.sum-fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz
+
+fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz .sum-fontconfig
+	$(UNPACK)
+	$(APPLY) $(SRC)/fontconfig/fontconfig-march.patch
+ifdef HAVE_WIN32
+	$(APPLY) $(SRC)/fontconfig/fontconfig-win32.patch
+	$(APPLY) $(SRC)/fontconfig/fontconfig-noxml2.patch
+endif
+	$(MOVE)
+
+FONTCONFIG_BASE_CONF = --prefix=$(PREFIX) \
+					   --with-freetype-config=$(PREFIX)/bin/freetype-config \
+					   --enable-libxml2 \
+					   --disable-docs
+
+FONTCONFIG_CONF-$(ENABLED)      = $(HOSTCONF) $(FONTCONFIG_BASE_CONF)
+FONTCONFIG_CONF-$(HAVE_WIN32)   = $(HOSTCONF) --with-freetype-config=$(PREFIX)/bin/freetype-config --disable-docs --with-arch=i686
+FONTCONFIG_CONF-$(HAVE_MACOSX) += $(HOSTCONF) \
+	--with-cache-dir=~/Library/Caches/fontconfig \
+	--with-confdir=/usr/X11/lib/X11/fonts \
+	--with-default-fonts=/System/Library/Fonts \
+	--with-add-fonts=/Library/Fonts,~/Library/Fonts  \
+	--with-arch=$(ARCH)
+
+FONTCONFIG_ENV-$(ENABLED)         = $(HOSTCC) LIBXML2_CFLAGS=`$(PREFIX)/bin/xml2-config --cflags`
+FONTCONFIG_ENV-$(HAVE_MACOSX)     = $(HOSTCC) LIBXML2_CFLAGS=`xml2-config --cflags` LIBXML2_LIBS=`xml2-config --libs`
+FONTCONFIG_ENV-$(HAVE_WIN32)      = $(HOSTCC)
+
+.fontconfig: fontconfig .freetype .libxml2
+ifdef HAVE_WIN32
+	$(RECONF)
+endif
+	cd $<; $(FONTCONFIG_ENV-1) ./configure $(FONTCONFIG_CONF-1) && make
+ifndef HAVE_MACOSX
+	cd $<; make install
+else
+	cd $<; make install-exec && (cd fontconfig ; make install-data) && cp fontconfig.pc     $(PKG_CONFIG_LIBDIR) && sed -e 's%/usr/lib/libiconv.la%%' -i.orig $(PREFIX)/lib/libfontconfig.la
+endif
+	$(INSTALL_NAME)
+	touch $@



More information about the vlc-commits mailing list