changeset 34:c80c7e7e8b7e

More work on freetype
author janneke <janneke@gnu.org>
date Fri, 25 Nov 2005 13:34:38 +0100
parents fe03d4a5a3ba
children 9a1fbf9c845c
files specs/framework.py
diffstat 1 files changed, 25 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/specs/framework.py	Fri Nov 25 13:51:42 2005 +0100
+++ b/specs/framework.py	Fri Nov 25 13:34:38 2005 +0100
@@ -42,12 +42,20 @@
 		gub.Package.install (self)
 		
 
+def read_pipe (cmd):
+	pipe = os.popen (cmd, mode)
+	output = pipe.read ()
+	status = pipe.close ()
+	# successful pipe close returns 'None'
+	if status:
+		raise 'barf'
+	return output
+
 class Fontconfig (gub.Target_package):
-
 	def configure_command (self):
-		return gub.Target_package.configure_command (self) + '''
---with-default-fonts=@WINDIR@\fonts\
---with-add-fonts=@INSTDIR@\usr\share\gs\fonts
+		return gub.Target_package.configure_command (self) + ''' \
+--with-default-fonts=@WINDIR@\\fonts \
+--with-add-fonts=@INSTDIR@\\usr\\share\\gs\\fonts \
 '''
 
 	def configure (self):
@@ -60,6 +68,17 @@
 '''})
 		gub.Package.configure (self)
 
+		# help fontconfig cross compiling a bit, all CC/LD
+		# flags are wrong, set to the target's root
+		
+		cflags = '-I%(srcdir)s -I%(srcdir)s/src' \
+			 + read_pipe ('freetype-config --cflags')
+		libs = read_pipe ('freetype-config --libs')
+		for i in ('fc-case' 'fc-lang' 'fc-glyphname'):
+			self.system ('''
+cd %(builddir)s/%(i)s && make "CFLAGS=%(cflags)s" "LIBS=%(libs)s" CPPFLAGS= LDFLAGS= INCLUDES=
+''')
+
 def get_packages (settings, platform):
 	packages = {
 	'mac': (
@@ -73,6 +92,8 @@
 		Libiconv (settings).with (version='1.9.2'),
 		Glib (settings).with (version='2.8.4', mirror=download.gtk),
 		Freetype (settings).with (version='2.1.9', mirror=download.freetype),
+#		Fontconfig (settings).with (version='2.3.92', mirror=download.fontconfig),
+		Fontconfig (settings).with (version='2.3.2', mirror=download.fontconfig),
 		LilyPond (settings).with (mirror=cvs.gnu, download=gub.Package.cvs),
 	),
 	}