2008-01-10 02:01:56 +00:00
|
|
|
from distutils.core import setup
|
|
|
|
import py2exe
|
|
|
|
|
2008-01-10 22:34:46 +00:00
|
|
|
import glob
|
|
|
|
|
2008-01-12 01:42:27 +00:00
|
|
|
lnf_manifest = """
|
|
|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
|
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
|
|
|
|
manifestVersion="1.0">
|
|
|
|
<assemblyIdentity
|
|
|
|
version="0.64.1.0"
|
|
|
|
processorArchitecture="x86"
|
|
|
|
name="Controls"
|
|
|
|
type="win32"
|
|
|
|
/>
|
|
|
|
<description>%s</description>
|
|
|
|
<dependency>
|
|
|
|
<dependentAssembly>
|
|
|
|
<assemblyIdentity
|
|
|
|
type="win32"
|
|
|
|
name="Microsoft.Windows.Common-Controls"
|
|
|
|
version="6.0.0.0"
|
|
|
|
processorArchitecture="X86"
|
|
|
|
publicKeyToken="6595b64144ccf1df"
|
|
|
|
language="*"
|
|
|
|
/>
|
|
|
|
</dependentAssembly>
|
|
|
|
</dependency>
|
|
|
|
</assembly>
|
|
|
|
"""
|
|
|
|
|
tweak py2exe setup.py to link in xmlplus iff present
so in the build slave's environment, everything builds and runs fine without
'_xmlplus'. In my existing local environment everything builds and runs only
if I tell py2exe to explicitly link in '_xmlplus'.
the _xmlplus module, tested for by the python standard library, comes from
PyXML ( http://pyxml.sf.net ) a project which is no longer maintained and,
for instance, hasn't released a build for windows past python 2.4
hence something about the way nevow and the std lib import xml dependencies
causes build environment incompatabilities between my box (which is running
py24 currently) and the buildslave (which is on py25, and doesn't have PyXML)
(if I remove _xmlplus from my environment, then a different set of nevow/xml
import problems emerge, which do not occur in the buildslave's py25 env)
this change tests the environment the build is happening in, and if the
_xmlplus package is importable, then py2exe is directed to link it into the
build. otherwise the package is left out. as far as I comprehend the issue
this should make both of these environments work. if other people have
problems around this issue, obviously I'm interested in learning more.
2008-01-15 23:59:41 +00:00
|
|
|
packages = ['encodings']
|
|
|
|
|
|
|
|
try:
|
|
|
|
import _xmlplus
|
|
|
|
except ImportError:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
packages.append('_xmlplus')
|
2008-01-12 01:42:27 +00:00
|
|
|
|
2008-01-10 02:01:56 +00:00
|
|
|
setup_args = {
|
|
|
|
'name': 'Tahoe',
|
|
|
|
'description': 'Allmydata Tahoe distributated storage',
|
|
|
|
'author': 'Allmydata, Inc.',
|
|
|
|
'windows': [
|
2008-01-12 01:42:27 +00:00
|
|
|
{
|
|
|
|
'script': 'confwiz.py',
|
|
|
|
'icon_resources': [(1, 'amdicon.ico')],
|
|
|
|
'other_resources': [(24,1,lnf_manifest%'Allmydata Tahoe Config Wizard')],
|
|
|
|
},
|
2008-01-10 02:01:56 +00:00
|
|
|
],
|
|
|
|
'console': [
|
|
|
|
'tahoe.py',
|
|
|
|
],
|
|
|
|
'service': [
|
|
|
|
'tahoesvc',
|
|
|
|
],
|
|
|
|
'data_files': [
|
|
|
|
('.', [
|
|
|
|
],),
|
2008-01-10 22:34:46 +00:00
|
|
|
('web', glob.glob('../src/allmydata/web/*')),
|
2008-01-10 02:01:56 +00:00
|
|
|
],
|
|
|
|
'zipfile' : 'library.zip',
|
|
|
|
'options': {
|
|
|
|
"py2exe": {
|
|
|
|
"excludes": [
|
2008-01-10 22:26:19 +00:00
|
|
|
"pkg_resources",
|
2008-01-10 02:01:56 +00:00
|
|
|
],
|
|
|
|
"includes": [
|
|
|
|
],
|
tweak py2exe setup.py to link in xmlplus iff present
so in the build slave's environment, everything builds and runs fine without
'_xmlplus'. In my existing local environment everything builds and runs only
if I tell py2exe to explicitly link in '_xmlplus'.
the _xmlplus module, tested for by the python standard library, comes from
PyXML ( http://pyxml.sf.net ) a project which is no longer maintained and,
for instance, hasn't released a build for windows past python 2.4
hence something about the way nevow and the std lib import xml dependencies
causes build environment incompatabilities between my box (which is running
py24 currently) and the buildslave (which is on py25, and doesn't have PyXML)
(if I remove _xmlplus from my environment, then a different set of nevow/xml
import problems emerge, which do not occur in the buildslave's py25 env)
this change tests the environment the build is happening in, and if the
_xmlplus package is importable, then py2exe is directed to link it into the
build. otherwise the package is left out. as far as I comprehend the issue
this should make both of these environments work. if other people have
problems around this issue, obviously I'm interested in learning more.
2008-01-15 23:59:41 +00:00
|
|
|
"packages": packages,
|
2008-01-10 02:01:56 +00:00
|
|
|
#"optimize" : 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
setup(**setup_args)
|
|
|
|
|
|
|
|
|
|
|
|
_junk = py2exe # appease pyflakes
|
|
|
|
del _junk
|