From 56af9f2416a6afd42a1debdda8b25609861b32b1 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 8 Feb 2011 04:49:25 +0000 Subject: [PATCH] osx: wrap up cairo and pycairo into framework --- osx/wrap.py | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/osx/wrap.py b/osx/wrap.py index 103968672..7b527a625 100644 --- a/osx/wrap.py +++ b/osx/wrap.py @@ -36,6 +36,10 @@ if __name__ == "__main__": INCLUDE_PYTHON = True + INCLUDE_CAIRO = True + + INCLUDE_PYCAIRO = True + # final resting place install_path = '/Library/Frameworks' @@ -76,6 +80,28 @@ if __name__ == "__main__": # purge the installed headers of mapnik os.system('rm -rf %s' % join(active,'unix/include')) + if INCLUDE_CAIRO: + + # install cairo libs and deps + copy_all_items('sources/lib/libcairo*dylib',join(active,'unix/lib'),recursive=True) + copy_all_items('sources/lib/libfontconfig*dylib',join(active,'unix/lib'),recursive=True) + copy_all_items('sources/lib/libsigc-2.0*dylib',join(active,'unix/lib'),recursive=True) + copy_all_items('sources/lib/libpixman*dylib',join(active,'unix/lib'),recursive=True) + + # install cairo includes + if INCLUDE_HEADERS: + # what is layout? + for group in ['cairo','cairomm-1.0','fontconfig','pixman-1','pycairo','sigc++-2.0','layout']: + if not os.path.exists(join(active,'unix/include/%s' % group)): + os.mkdir(join(active,'unix/include/%s' % group)) + copy_all_items('sources/include/%s/*' % group,join(active,'unix/include/%s' % group),recursive=True) + + # likely uneeded + if not os.path.exists(join(active,'unix/lib/sigc++-2.0')): + os.mkdir(join(active,'unix/lib/sigc++-2.0')) + copy_all_items('sources/lib/sigc++-2.0/*',join(active,'unix/lib/sigc++-2.0'),recursive=True) + + # install icu libs copy_all_items('sources/lib/libicuu*dylib',join(active,'unix/lib'),recursive=True) copy_all_items('sources/lib/libicud*dylib',join(active,'unix/lib'),recursive=True) @@ -158,9 +184,27 @@ if __name__ == "__main__": if not os.path.exists(join(active,'Python')): os.mkdir(join(active,'Python')) os.mkdir(join(active,'Python/mapnik2')) - shutil.copy('python/__init__.py',join(active,'Python/mapnik2/')) + if INCLUDE_PYCAIRO: + os.mkdir(join(active,'Python/cairo')) + shutil.copy('python/mapnik.py',join(active,'Python/mapnik2/__init__.py')) + if INCLUDE_PYCAIRO: + if not os.path.exists(join(active,'Python/cairo/')): + os.mkdir(join(active,'Python/cairo/')) + shutil.copy('python/cairo.py',join(active,'Python/cairo/__init__.py')) #sym(py_dir,join(active,'Python')) sym(join(active,'Python'),join(framework,'Python')) + + + # pycairo module + if INCLUDE_PYCAIRO: + for pyver in glob.glob('sources/lib/python*'): + ver = os.path.basename(pyver) + assert os.path.exists(join(active,'unix/lib/%s' % ver)) + assert os.path.exists(join(active,'unix/lib/%s/site-packages' % ver)) + to = join(active,'unix/lib/%s/site-packages/cairo/' % ver) + if not os.path.exists(to): + os.mkdir(to) + copy_all_items('sources/lib/%s/site-packages/cairo/*' % ver,to,recursive=True) # try to start using relative paths.. #paths_py = '''