# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python class Recipe(recipe.Recipe): name = 'matplotlib' version = '1.4.3' stype = SourceType.TARBALL url = 'http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-%(version)s/matplotlib-%(version)s.tar.gz/download' licenses = [License.BSD] deps = ['six', 'py-dateutil', 'pyparsing'] tarball_name = "matplotlib-%(version)s.tar.gz" btype = BuildType.CUSTOM files_data = [] def prepare(self): mapping = self.extensions.copy() mapping["prefix"] = self.py_prefix self.files_data = [ '%(prefix)s/site-packages/matplotlib/' % mapping, '%(prefix)s/site-packages/mpl_toolkits/' % mapping, '%(prefix)s/site-packages/matplotlib/mpl-data/' % (mapping), '%(prefix)s/site-packages/matplotlib/*%(srext)s' % (mapping), ] def install(self): flags = "" if self.config.target_platform == Platform.DARWIN: # numpy / setup.py seems to try to build a universal binary but fails. # Force it to a single arch for now. if self.config.target_arch == Architecture.X86: flags = 'ARCHFLAGS="-arch i386" ' elif self.config.target_arch == Architecture.X86_64: flags = 'ARCHFLAGS="-arch x86_64" ' shell.call(flags + 'python setup.py install --root / --prefix=%s' % (self.config.prefix), self.build_dir)