optimize compiled modules in win32
[gajim.git] / setup_win32.py
blob3be40f9135b1a15551af3306e1abfea78bc4af89
1 ## setup_win32.py (run me as python setup_win32.py py2exe -O2)
2 ##
3 ## Copyright (C) 2003-2008 Yann Leboulanger <asterix AT lagaule.org>
4 ## Copyright (C) 2005-2006 Nikos Kouremenos <kourem AT gmail.com>
5 ## Copyright (C) 2008 Jonathan Schleifer <js-gajim AT webkeks.org>
6 ##
7 ## This file is part of Gajim.
8 ##
9 ## Gajim is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published
11 ## by the Free Software Foundation; version 3 only.
13 ## Gajim is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ## GNU General Public License for more details.
18 ## You should have received a copy of the GNU General Public License
19 ## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
22 from distutils.core import setup
23 import py2exe
24 import glob
25 import sys
26 import os
28 docutils_files = []
29 def fill_docutils_files(folder, base=u'docutils'):
30 docutils_files.append((base, glob.glob(os.path.join(folder, base, '*.pyc'))))
31 for path in os.listdir(os.path.join(folder, base)):
32 if os.path.isdir(os.path.join(folder, base, path)):
33 fill_docutils_files(folder, base=os.path.join(base, path))
35 try:
36 import docutils.readers
37 import docutils.writers.html4css1
38 import docutils.languages
39 except ImportError:
40 pass
41 else:
42 fill_docutils_files(os.path.join(sys.prefix, 'Lib', 'site-packages'))
43 docutils_files.append((os.path.join('docutils', 'writers', 'html4css1'),
44 glob.glob(os.path.join(sys.prefix, 'Lib', 'site-packages', 'docutils',
45 'writers', 'html4css1', '*.css'))))
47 sys.path.append('src')
48 # Use local gtk folder instead of the one in PATH that is not latest gtk
49 if 'gtk' in os.listdir('.'):
50 sys.path.append('gtk/bin')
52 opts = {
53 'py2exe': {
54 # ConfigParser,UserString,roman are needed for docutils
55 'includes': 'pango,atk,gobject,cairo,pangocairo,gtk.keysyms,encodings,encodings.*,ConfigParser,UserString',
56 'dll_excludes': [
57 'iconv.dll','intl.dll','libatk-1.0-0.dll',
58 'libgdk_pixbuf-2.0-0.dll','libgdk-win32-2.0-0.dll',
59 'libglib-2.0-0.dll','libgmodule-2.0-0.dll',
60 'libgobject-2.0-0.dll','libgthread-2.0-0.dll',
61 'libgtk-win32-2.0-0.dll','libpango-1.0-0.dll',
62 'libpangowin32-1.0-0.dll','libcairo-2.dll',
63 'libpangocairo-1.0-0.dll','libpangoft2-1.0-0.dll',
65 'excludes': [
66 'docutils'
68 'optimize': 2,
73 setup(
74 name = 'Gajim',
75 version = '0.13-rc5',
76 description = 'A full featured Jabber client',
77 author = 'Gajim Development Team',
78 url = 'http://www.gajim.org/',
79 download_url = 'http://www.gajim.org/downloads.php',
80 license = 'GPL',
82 windows = [{'script': 'src/gajim.py',
83 'icon_resources': [(1, 'data/pixmaps/gajim.ico')]},
84 {'script': 'src/history_manager.py',
85 'icon_resources': [(1, 'data/pixmaps/gajim.ico')]}],
86 options=opts,
88 data_files=docutils_files,
92 # vim: se ts=3: