changeset 35:9a1fbf9c845c

Add expat, more work on fontconfig
author janneke <janneke@gnu.org>
date Fri, 25 Nov 2005 14:29:15 +0100
parents c80c7e7e8b7e
children 20d755d88fa7
files specs/download.py specs/framework.py specs/gub.py
diffstat 3 files changed, 39 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/specs/download.py	Fri Nov 25 13:34:38 2005 +0100
+++ b/specs/download.py	Fri Nov 25 14:29:15 2005 +0100
@@ -17,3 +17,9 @@
 
 def opendarwin ():
 	return 'http://www.opendarwin.org/downloads/%(name)s-%(version)s.tar.%(format)s'
+
+def sf ():
+	return 'http://mesh.dl.sourceforge.net/sourceforge/%(name)s/%(name)s-%(version)s.tar.%(format)s'
+
+def lp ():
+	return 'http://lilypond.org/mingw/uploads/%(name)s/%(name)s-%(version)s-src.tar.%(format)s'
--- a/specs/framework.py	Fri Nov 25 13:34:38 2005 +0100
+++ b/specs/framework.py	Fri Nov 25 14:29:15 2005 +0100
@@ -1,6 +1,7 @@
 import cvs
 import download
 import gub
+import os
 import re
 
 class Libtool (gub.Target_package):
@@ -43,7 +44,7 @@
 		
 
 def read_pipe (cmd):
-	pipe = os.popen (cmd, mode)
+	pipe = os.popen (cmd, 'r')
 	output = pipe.read ()
 	status = pipe.close ()
 	# successful pipe close returns 'None'
@@ -71,13 +72,32 @@
 		# 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'):
+		cflags = '-I%(srcdir)s -I%(srcdir)s/src ' \
+			 + read_pipe ('freetype-config --cflags')[:-1]
+		libs = read_pipe ('freetype-config --libs')[:-1]
+		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=
-''')
+''', locals ())
+
+class Expat (gub.Target_package):
+	def xxconfigure (self):
+		self.autoupdate ()
+		gub.Target_package.configure (self)
+
+	def compile_command (self):
+		return gub.Target_package.compile_command (self) + ''' \
+CFLAGS="-O2 -DHAVE_EXPAT_CONFIG_H" \
+EXEEXT= \
+'''
+	def install_command (self):
+		return gub.Target_package.install_command (self) + ''' \
+EXEEXT= \
+exec_prefix=%(installdir)s \
+libdir=%(installdir)s/lib \
+includedir=%(installdir)s/include \
+man1dir=%(installdir)s/share/man/man1 \
+'''
 
 def get_packages (settings, platform):
 	packages = {
@@ -92,6 +112,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),
+#		Expat (settings).with (version='1.95.8', mirror=download.sf),
+		Expat (settings).with (version='1.95.8-1', mirror=download.lp, format='bz2'),
 #		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),
--- a/specs/gub.py	Fri Nov 25 13:34:38 2005 +0100
+++ b/specs/gub.py	Fri Nov 25 14:29:15 2005 +0100
@@ -104,6 +104,7 @@
 	
 	def basename (self):
 		f = self.file_name ()
+		f = re.sub ('-src\.tar.*', '', f)
 		f = re.sub ('\.tar.*', '', f)
 		return f
 
@@ -160,6 +161,9 @@
 cd %(srcdir)s && aclocal
 cd %(srcdir)s && autoheader
 cd %(srcdir)s && autoconf
+''')
+			if os.path.exists (os.path.join (self.srcdir (), 'Makefile.am')):
+				self.system ('''
 cd %(srcdir)s && automake --add-missing
 ''')
 
@@ -277,6 +281,7 @@
 			'LDFLAGS': '-L%(installdir)s/lib',
 			'NM': '%(target_architecture)s-nm',
 			'RANLIB': '%(target_architecture)s-ranlib',
+			'SED': 'sed', # libtool (expat mingw) fixup
 			}
 
 		dict.update (env)