changeset 64:81ad4c2646fc

use vanilla freetype, python fixes, lilypond stuff
author janneke <janneke@gnu.org>
date Mon, 28 Nov 2005 21:37:28 +0100
parents d015a83e01dd
children e0eba72edffd
files specs/download.py specs/framework.py specs/gub.py specs/mingw.py
diffstat 4 files changed, 120 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/specs/download.py	Sun Nov 27 22:46:31 2005 +0100
+++ b/specs/download.py	Mon Nov 28 21:37:28 2005 +0100
@@ -1,3 +1,14 @@
+
+def untar_flags (tarball):
+	flags = ''
+	if tarball.endswith ('.tar.gz') or tarball.endswith ('.tgz'):
+		flags = '-xzf'
+	elif tarball.endswith ('.tar.bz2'):
+		flags = '-jxf'
+	elif tarball.endswith ('.tar'):
+		flags = '-xf'
+	return flags
+
 def gtk ():
 	return 'ftp://ftp.gtk.org/pub/gtk/v%(gtk_version)s/%(name)s-%(version)s.tar.%(format)s'
 
--- a/specs/framework.py	Sun Nov 27 22:46:31 2005 +0100
+++ b/specs/framework.py	Mon Nov 28 21:37:28 2005 +0100
@@ -8,11 +8,8 @@
 class Libtool (gub.Target_package):
 	pass
 
-class Gs (gub.Target_package):
-	pass
-
 class Python (gub.Target_package):
-	def xxset_download (self, mirror=download.gnu, format='gz', download=gub.Target_package.wget):
+	def set_download (self, mirror=download.gnu, format='gz', download=gub.Target_package.wget):
 		gub.Target_package.set_download (self, mirror, format, download)
 		self.url = re.sub ('python-', 'Python-', self.url)
 		gub.Target_package.wget (self)
@@ -21,31 +18,31 @@
 		Python = re.sub ('python-', 'Python-', python)
 		self.system ('ln -f %(Python)s %(python)s', locals ())
 
-	def xxuntar (self):
+	def untar (self):
 		gub.Target_package.untar (self)
 		python = self.srcdir ()
 		Python = re.sub ('python-', 'Python-', python)
 		self.system ('mv %(Python)s %(python)s', locals ())
 
-	def xxpatch (self):
+	def patch (self):
 		if self.settings.platform.startswith ('mingw'):
 			self.system ('''
 cd %(srcdir)s && patch -p1 < $HOME/installers/windows/patch/python-2.4.2-1.patch
 ''')
 
-	def xxconfigure (self):
-		self.autoupdate ()
-		gub.Target_package.configure (self)
-
 	def configure (self):
 		if self.settings.platform.startswith ('mingw'):
+			self.system ('''cd %(srcdir)s && autoconf''')
+			self.system ('''cd %(srcdir)s && libtoolize --copy --force''')
 			self.settings.target_gcc_flags = '-DMS_WINDOWS -DPy_WIN_WIDE_FILENAMES -I%(systemdir)s/usr/include' % self.package_dict ()
 		gub.Target_package.configure (self)
 
-	def xxcompile (self):
-		if self.settings.platform.startswith ('mingw'):
-			self.settings.target_gcc_flags = '-DMS_WINDOWS -DPy_WIN_WIDE_FILENAMES -I%(systemdir)s/usr/include' % self.package_dict ()
-		gub.Target_package.compile (self)
+	def install_command (self):
+		return gub.Target_package.install_command (self) \
+		       + gub.join_lines ('''
+INCLUDEDIR=%(installdir)s/include
+MANDIR=%(installdir)s/share/man
+		       ''')
 
 class LilyPad (gub.Target_package):
 	pass
@@ -64,7 +61,7 @@
 
 		os.chmod ('%(srcdir)s/configure' % self.package_dict (), 0755)
 		gub.Target_package.configure (self)
-		
+
 	def xpatch (self):
 		if self.settings.platform.startswith ('mingw'):
 	                ## FIXME, seems we don't need this?
@@ -106,7 +103,7 @@
 -I%(srcdir)s/libguile"
 ''')
 		cmd += gub.Target_package.configure_command (self) \
-		      + gub.join_lines (''' 
+		      + gub.join_lines ('''
 --without-threads
 --with-gnu-ld
 --enable-deprecated
@@ -168,13 +165,57 @@
 exit 0
 ''')
 		os.chmod ('%(installdir)s/bin/%(target_architecture)s-guile-config' % self.package_dict (), 0755)
-	
+
 
 class LilyPond (gub.Target_package):
 	def configure (self):
 		self.autoupdate ()
 		gub.Target_package.configure (self)
 
+	def configure_command (self):
+		cmd = gub.Target_package.configure_command (self)
+		cmd += ' --disable-documentation'
+		if self.settings.platform.startswith ('mingw'):
+			cmd += gub.join_lines ('''
+--without-kpathsea
+--enable-relocation
+--with-python-include=%(systemdir)s/include/python2.4
+--disable-optimising
+''')
+		return cmd
+
+	def configure (self):
+		gub.Target_package.configure (self)
+		if self.settings.platform.startswith ('mingw'):
+			self.settings.target_gcc_flags = '-mms-bitfields'
+			self.settings.target_gxx_flags = '-mms-bitfields'
+			cmd = self.configure_command () \
+			      + ' --enable-config=console'
+			self.system ('''cd %(builddir)s && %(cmd)s''',
+				     locals ())
+		gub.Package.system (self, '''
+cp /usr/include/FlexLexer.h .
+''')
+
+	def compile_command (self):
+		cmd = gub.Target_package.compile_command (self)
+		if self.settings.platform.startswith ('mingw'):
+			python_lib = "%(systemdir)s/libpython2.4.dll"
+			return cmd + 'LDFLAGS=%(python_lib)s' % locals ()
+
+	def compile (self):
+		gub.Target_package.compile ()
+		if self.settings.platform.startswith ('mingw'):
+			gub.Package.system (self, '''
+mkdir -p %(builddir)s/mf/out-console
+cp -pv %(builddir)/mf/out/* mf/out-console
+''')
+			cmd = gub.Target_package.compile_command (self)
+			cmd += ' conf=console'
+			self.system ('''cd %(builddir)s && %(cmd)s''',
+				     locals ())
+
+
 class Gettext (gub.Target_package):
 	def config_cache_overrides (self, str):
 		if self.settings.platform == 'mingw':
@@ -197,9 +238,9 @@
 		       + ' --disable-csharp'
 
 		if self.settings.platform == 'mac':
-			cmd = re.sub ('--config-cache ', '', cmd) 
+			cmd = re.sub ('--config-cache ', '', cmd)
 		return cmd
-	
+
 	def configure (self):
 		self.system ('''cd %(srcdir)s && libtoolize --force --copy''')
 		gub.Target_package.configure (self)
@@ -223,7 +264,7 @@
 
 	def xxconfigure (self):
 		self.system ('''cd %(srcdir)s && libtoolize --force --copy''')
-#woe!		
+#woe!
 #libtool: link: CURRENT `1001' is not a nonnegative integer
 #libtool: link: `1001:0:1001' is not valid version information
 		gub.Target_package.configure (self)
@@ -241,7 +282,7 @@
 	def configure (self):
 #		self.autoupdate (autodir=os.path.join (self.srcdir (),
 #						       'builds/unix'))
-		
+
 		gub.Package.system (self, '''
 		rm -f %(srcdir)s/builds/unix/{unix-def.mk,unix-cc.mk,ftconfig.h,freetype-config,freetype2.pc,config.status,config.log}
 ''')
@@ -259,13 +300,13 @@
 cd %(srcdir)s && ./configure --disable-static --enable-shared
 ''')
 		gub.Package.install (self)
-		
+
 
 class Fontconfig (gub.Target_package):
 	def configure_command (self):
 		# FIXME: system dir vs packaging install
 		cmd = gub.Target_package.configure_command (self) \
-		      + gub.join_lines (''' 
+		      + gub.join_lines ('''
 --with-freetype-config="/usr/bin/freetype-config
 --prefix=%(systemdir)s/usr
 --exec-prefix=%(systemdir)s/usr
@@ -278,7 +319,7 @@
 ''')
 
 		return cmd
-	
+
 	def configure (self):
 ##		self.autoupdate ()
 		gub.Package.system (self, '''
@@ -286,7 +327,7 @@
 ''',
 			     env = {'ft_config' : '''/usr/bin/freetype-config \
 --prefix=%(installdir)s \
---exec-prefix=%(installdir)s \ 
+--exec-prefix=%(installdir)s \
 '''})
 		gub.Target_package.configure (self)
 		if self.settings.platform.startswith ('mingw'):
@@ -295,7 +336,7 @@
 ''', mode='a')
 		# 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 ' \
 			 + self.read_pipe ('freetype-config --cflags')[:-1]
 		libs = self.read_pipe ('freetype-config --libs')[:-1]
@@ -333,9 +374,7 @@
 
 # latest vanilla packages
 #Zlib (settings).with (version='1.2.3', mirror=download.zlib, format='bz2'),
-#Freetype (settings).with (version='2.1.9', mirror=download.freetype),
 #Expat (settings).with (version='1.95.8', mirror=download.sf),
-#Fontconfig (settings).with (version='2.3.92', mirror=download.fontconfig),
 #Gettext (settings).with (version='0.14.5'),
 #Guile (settings).with (version='1.7.2', mirror=download.alpha, format='gz'),
 
@@ -353,17 +392,15 @@
 		Zlib (settings).with (version='1.2.2-1', mirror=download.lp, format='bz2'),
 		Gettext (settings).with (version='0.14.1-1', mirror=download.lp, format='bz2'),
 		Libiconv (settings).with (version='1.9.2'),
-		Freetype (settings).with (version='2.1.7-1', mirror=download.lp, format='bz2'),
+		Freetype (settings).with (version='2.1.7', mirror=download.freetype),
 		Expat (settings).with (version='1.95.8-1', mirror=download.lp, format='bz2'),
-		Fontconfig (settings).with (version='2.3.2-1', mirror=download.lp, format='bz2'),
+		Fontconfig (settings).with (version='2.3.2', mirror=download.fontconfig),
 		Gmp (settings).with (version='4.1.4'),
 		# FIXME: we're actually using 1.7.2-cvs+, 1.7.2 needs too much work
 		Guile (settings).with (version='1.7.2-3', mirror=download.lp, format='bz2'),
 		Glib (settings).with (version='2.8.4', mirror=download.gtk),
 		Pango (settings).with (version='1.10.1', mirror=download.gtk),
-#		Python (settings).with (version='2.4.2', mirror=download.python, format='bz2'),
-		Python (settings).with (version='2.4.2-1', mirror=download.lp, format='bz2'),
-		Gs (settings).with (version='8.15-1', mirror=download.lp, format='bz2'),
+		Python (settings).with (version='2.4.2', mirror=download.python, format='bz2'),
 		LilyPond (settings).with (mirror=cvs.gnu, download=gub.Package.cvs),
 		LilyPad (settings).with (version='0.0.7-1', mirror=download.lp, format='bz2'),
 	),
--- a/specs/gub.py	Sun Nov 27 22:46:31 2005 +0100
+++ b/specs/gub.py	Mon Nov 28 21:37:28 2005 +0100
@@ -275,22 +275,16 @@
 		pass
 
 	def untar (self):
-		file = self.settings.downloaddir + '/' + self.file_name ()
+		tarball = self.settings.downloaddir + '/' + self.file_name ()
 
-		if not os.path.exists (file):
+		if not os.path.exists (tarball):
 			return
 
-		flags = ''
-		if re.search ('.tar$', file):
-			flags = '-xf '
-		elif re.search ('.tar.bz2', file):
-			flags = '-jxf '
-		elif re.search ('.tar.gz', file):
-			flags = '-xzf '
+		flags = dl.untar_flags (tarball)
 
 		# clean up
 		self.system ("rm -rf  %(srcdir)s %(builddir)s")
-		cmd = 'tar %(flags)s %(file)s -C %(sourcesdir)s'
+		cmd = 'tar %(flags)s %(tarball)s -C %(sourcesdir)s'
 		self.system (cmd, locals ())
 
 	def set_download (self, mirror=dl.gnu, format='gz', download=wget):
--- a/specs/mingw.py	Sun Nov 27 22:46:31 2005 +0100
+++ b/specs/mingw.py	Mon Nov 28 21:37:28 2005 +0100
@@ -36,8 +36,43 @@
 class Regex (gub.Target_package):
 	pass
 
+class Gs (gub.Target_package):
+	def untar (self):
+		self.system ("rm -rf  %(srcdir)s %(builddir)s")
+		self.system ('mkdir -p %(srcdir)s/root')
+		tarball = self.settings.downloaddir + '/' + self.file_name ()
+		if not os.path.exists (tarball):
+			return
+		flags = download.untar_flags (tarball)
+		cmd = 'tar %(flags)s %(tarball)s -C %(srcdir)s/root'
+		self.system (cmd, locals ())
+		# FIXME: weird packaging
+		self.system ('cd %(srcdir)s && mv root/gs-%(version)s/* .')
+		installroot = os.path.dirname (self.installdir ())
+		gs_prefix = '/usr/share/gs'
+		self.dump ('%(srcdir)s/configure', '''
+cat > Makefile <<EOF
+default:
+	@echo done
+all: default
+install:
+	mkdir -p %(installdir)s
+	tar -C %(srcdir)s -cf- bin | tar -C %(installdir)s -xvf-
+	mkdir -p %(installroot)s/%(gs_prefix)s
+	tar -C %(srcdir)s -cf- fonts lib Resource | tar -C %(installroot)s/%(gs_prefix)s -xvf-
+	fc-cache %(installroot)s/%(gs_prefix)s/fonts
+	mkdir -p %(installdir)s/share/doc/gs/html
+	tar -C %(srcdir)s/doc -cf- --exclude='[A-Z]*[A-Z]' . | tar -C %(installdir)s/share/doc/gs/html -xvf-
+	tar -C %(srcdir)s/doc -cf- --exclude='*.htm*' . | tar -C %(installdir)s/share/doc/gs/html -xvf-
+EOF
+''', env=locals ())
+		os.chmod ('%(srcdir)s/configure' % self.package_dict (), 0755)
+
+
 def get_packages (settings):
 	return (
 		Mingw_runtime (settings).with (version='3.9', mirror=download.sf),
 		Regex (settings).with (version='2.3.90-1', mirror=download.lp, format='bz2'),
+		Gs (settings).with (version='8.15-1', mirror=download.lp, format='bz2'),
 		)
+