Mercurial > gub
changeset 6461:44f26aba5bd6
pango: set PANGO_SO_EXTENSION.
author | Jan Nieuwenhuizen <janneke@gnu.org> |
---|---|
date | Tue, 01 Feb 2011 15:15:56 +0100 |
parents | 967f2299c437 |
children | 9796761cf213 |
files | gub/specs/pango.py gub/specs/pangocairo.py |
diffstat | 2 files changed, 81 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/gub/specs/pango.py Tue Feb 01 15:14:38 2011 +0100 +++ b/gub/specs/pango.py Tue Feb 01 15:15:56 2011 +0100 @@ -7,7 +7,7 @@ 'pango-1.37.3-test-without-cairo.patch', ] dependencies = [ - 'tools::glib', + 'tools::glib', 'freetype-devel', 'fontconfig-devel', 'glib-devel', @@ -20,3 +20,78 @@ + misc.join_lines (''' --without-cairo ''')) + def module_version (self): + result = None + version = self.version() + for regex, candidate in pango_module_version_regexes: + if re.match(regex, version): + result = candidate + break + assert result + return result + def install (self): + target.AutoBuild.install (self) + self.create_config_files () + self.fix_config_files () + def create_config_files (self, prefix='/usr'): + pango_module_version = self.module_version () + etc = self.expand ('%(install_root)s/%(prefix)s/etc/pango', locals ()) + self.dump ('''[Pango] +ModuleFiles = $PANGO_PREFIX/etc/pango/pango.modules +ModulesPath = $PANGO_PREFIX/lib/pango/%(pango_module_version)s/modules +''' % locals (), etc + '/pangorc') + self.dump (''' +setfile PANGO_RC_FILE=$INSTALLER_PREFIX/etc/pango/pangorc +setdir PANGO_PREFIX=$INSTALLER_PREFIX/ +set PANGO_MODULE_VERSION=%(pango_module_version)s +set PANGO_SO_EXTENSION=.so +''', '%(install_prefix)s/etc/relocate/pango.reloc', env=locals ()) + self.copy ('%(sourcefiledir)s/pango.modules', etc) + def fix_config_files (self, prefix='/usr'): + etc = self.expand ('%(install_root)s/%(prefix)s/etc/pango', locals ()) + self.system ('mkdir -p %(etc)s' , locals ()) + def fix_prefix (logger, file_name): + loggedos.file_sub (logger, [('/' + prefix + '/', '$PANGO_PREFIX/')], + file_name) + self.map_locate (fix_prefix, etc, '*') + +class Pango__linux (Pango): + def untar (self): + Pango.untar (self) + # FIXME: --without-cairo switch is removed in 1.10.1, + # pango only compiles without cairo if cairo is not + # installed linkably on the build system. UGH. + self.file_sub ([('(have_cairo[_a-z0-9]*)=true', '\\1=false'), + ('(cairo[_a-z0-9]*)=yes', '\\1=no')], + '%(srcdir)s/configure') + +class Pango__freebsd (Pango__linux): + dependencies = Pango__linux.dependencies + ['libiconv-devel'] + +class Pango__darwin (Pango): + def configure (self): + Pango.configure (self) + self.file_sub ([('nmedit', '%(target_architecture)s-nmedit')], + '%(builddir)s/libtool') + def install (self): + Pango.install (self) + # FIXME: PANGO needs .so, NOT .dylib? + self.dump (''' +set PANGO_SO_EXTENSION=.so +''', '%(install_prefix)s/etc/relocate/pango.reloc', env=locals (), mode='a') + +class Pango__mingw (Pango): + # FIXME: need -lpthread now? + # /home/janneke/vc/gub/target/mingw/root/usr/cross/bin/i686-mingw32-ld: cannot find -lpthread + dependencies = (Pango.dependencies + + ['pthreads-w32-devel']) + def create_config_files (self, prefix='/usr'): + Pango.create_config_files (self, prefix) + etc = self.expand ('%(install_root)s/%(prefix)s/etc/pango', locals ()) + self.dump (''' +${PANGO_PREFIX}/lib/pango/${PANGO_MODULE_VERSIOn}/modules/pango-basic-win32${PANGO_SO_EXTENSION} BasicScriptEngineWin32 PangoEngineShape PangoRenderWin32 common: +''', '%(etc)s/pango.modules', env=locals (), mode='a') + Pango.fix_config_files (self, prefix) + self.dump (''' +set PANGO_SO_EXTENSION=.dll +''', '%(install_prefix)s/etc/relocate/pango.reloc', env=locals (), mode='a')
--- a/gub/specs/pangocairo.py Tue Feb 01 15:14:38 2011 +0100 +++ b/gub/specs/pangocairo.py Tue Feb 01 15:15:56 2011 +0100 @@ -9,14 +9,17 @@ class Pangocairo__mingw (Pangocairo): # FIXME: cut and paste Pango__mingw + configure_flags = (target.AutoBuild.configure_flags + + ' --disable-rebuilds') def create_config_files (self, prefix='/usr'): Pangocairo.create_config_files (self, prefix) etc = self.expand ('%(install_root)s/%(prefix)s/etc/pango', locals ()) self.dump ('''${PANGO_PREFIX}/lib/pango/${PANGO_MODULE_VERSION}/modules/pango-basic-win32${PANGO_SO_EXTENSION} BasicScriptEngineWin32 PangoEngineShape PangoRenderWin32 common: ''', '%(etc)s/pango.modules', env=locals (), mode='a') Pangocairo.fix_config_files (self, prefix) - configure_flags = (target.AutoBuild.configure_flags - + ' --disable-rebuilds') + self.dump (''' +set PANGO_SO_EXTENSION=.dll +''', '%(install_prefix)s/etc/relocate/pango.reloc', env=locals (), mode='a') class Pangocairo__darwin (Pangocairo): source = 'http://ftp.gnome.org/pub/GNOME/platform/2.29/2.29.91/sources/pango-1.27.1.tar.gz'