Ticket #2939: 2939.diff

File 2939.diff, 7.6 KB (added by moonfallen, 7 years ago)

Patch to make windows build post-Twisted 2.5 build system

  • win32/build.aap

     
    11 
    2 @supported_pythons = ('py2.3', 'py2.4') 
     2@supported_pythons = ('py2.4', 'py2.5') 
    33 
    44all: ../main.aap 
    55    @for p in _no.supported_pythons: 
  • win32/main.aap

     
    5252# get the version of twisted from the tree being built, not sys.path 
    5353Version=`getBuildingTwistedVersion()` 
    5454 
    55 ZIVersion=3.1.0c1 
     55ZIVersion=3.3.0 
    5656 
    5757# PyVersion is variant rather than a regular string variable so the script 
    5858# will accept only one of these two values 
     
    6565        pyversion=2.4 
    6666        pyversion10=24 
    6767        pyhome=`_no.pathdb["python24"]` 
     68    py2.5 
     69        pyversion=2.5 
     70        pyversion10=25 
     71        pyhome=`_no.pathdb["python25"]` 
    6872 
    6973pyexe=$(pyhome)\python.exe 
    7074 
     
    8387 
    8488# only run setup.py when needed 
    8589build/scripts-$(pyversion) build/lib.win32-$(pyversion):  \ 
    86                                                 ZopeInterface-$ZIVersion 
     90                                                zope.interface-$ZIVersion 
    8791    :mkdir {f} build/scripts-$(pyversion) 
    8892    :copy win32/twisted_postinstall.py  build/scripts-$(pyversion)/. 
    89     :sys $(pyexe) setup.py all  build --compiler=mingw32 \ 
     93    :sys $(pyexe) setup.py build --compiler=mingw32 \ 
    9094                                install --root=../win32dist --no-compile 
    9195    @1 
    92     :pushdir ZopeInterface-$(ZIVersion) 
     96    :pushdir zope.interface-$(ZIVersion) 
    9397    @try: 
    9498        :sys $(pyexe) setup.py build --compiler=mingw32 \ 
    9599                               install --root=../win32dist --no-compile 
    96100    @finally: 
    97101        :popdir 
    98102 
    99 ZopeInterface-$(ZIVersion).tgz: 
     103zope.interface-$(ZIVersion).tar.gz: 
    100104    err = "Please download the ZopeInterface $ZIVersion tarball" 
    101105    @assert os.path.exists(target), err 
    102 ZopeInterface-$ZIVersion: ZopeInterface-$(ZIVersion).tgz 
    103     :sys tar xvfz ZopeInterface-$(ZIVersion).tgz 
     106zope.interface-$ZIVersion: zope.interface-$(ZIVersion).tar.gz 
     107    :sys tar xvfz zope.interface-$(ZIVersion).tar.gz 
    104108 
    105109# build with inno 
    106110ExeDeps=py$(pyversion)-$(DoDocs).iss 
  • win32/aapwin.py

     
    5858 
    5959pathdb = dict(innohome=innohome, 
    6060              iscc=os.path.join(innohome, "ISCC.exe"), 
    61               python23=getPythonHomeForVersion('2.3'), 
    6261              python24=getPythonHomeForVersion('2.4'), 
     62              python25=getPythonHomeForVersion('2.5'), 
    6363              ) 
  • win32/README.win32

     
    1 OVERVIEW 
    2 -------- 
    3  
    4 Some requirements must be met to build the "Official" win32 
    5 Twisted.  The Official build produces four files with the following 
    6 features: 
    7  
    8 - Two of the four builds contain documentation, and make shortcuts to 
    9 it; the others do not. 
    10 - Two of the four builds are for Python 2.4, the other two are for Python 2.3. 
    11 - There is a shortcut in the start menu for the Twisted Command Prompt 
    12 which is a standard Windows command prompt with PATH and environment 
    13 variables set up to invoke the Twisted commands the same way you would 
    14 on Unix; e.g. "mktap". 
    15  
    16 There are two ways to get Twisted installed from source.  One is to do 
    17 the bare minimum necessary so that 'import twisted' works; the other 
    18 is the Official method. 
    19  
    20  
    21 BARE MINIMUM 
    22 ------------ 
    23 This method is only necessary if you are trying to install Twisted 
    24 from e.g. the Subversion repository, and you don't want to acquire all the 
    25 tools necessary to do the Official build. 
    26  
    27 * Install either Python 2.3 or Python 2.4 
    28  
    29 * Install ZopeInterface 3.0.1 or later for Python 
    30  
    31 * With MSVC *** 
    32 Without Cygwin installed, you need MSVC installed for the cl.exe 
    33 compiler, which is the default on windows.  Just issue the command: 
    34 $ python setup.py install 
    35  
    36 * With Cygwin *** 
    37 With Cygwin installed, you need to make sure these two packages are installed: 
    38 - gcc 
    39 - gcc-mingw 
    40 You also need libpython22.a (or libpython23.a as appropriate).   
    41 Instructions can be found at http://sebsauvage.net/python/mingw.html . 
    42  
    43 Once that's done, just issue the command: 
    44  
    45 $ python setup.py build --compiler=mingw32 install 
    46  
    47 If for some reason extensions won't build, try this instead: 
    48  
    49 $ python setup.py build_py build_scripts install --skip-build 
    50  
    51  
    52 OFFICIAL 
    53 -------- 
    54 The Official Twisted is built with native Python 2.3 (latest), not the 
    55 Cygwin version of Python, however it is built with the help of Cygwin 
    56 packages. 
    57  
    58 * Python 2.3 AND Python 2.4 *** 
    59 You need both. 
    60  
    61  
    62 * ZopeInterface 3.0.1 
    63 Download and install it for both versions of Python. 
    64  
    65  
    66 * A-A-P *** 
    67 This is what actually does the building. 
    68 http://www.a-a-p.org/download.html 
    69 After installing it, make sure the file aap.bat is in your system PATH, using 
    70 (for example) the environment variable applet. 
    71  
    72  
    73 * winreg *** 
    74 You need this little module: 
    75 http://www.rutherfurd.net/python/winreg/   # FIXME -- make aap fetch it 
    76  
    77  
    78 * Cygwin *** 
    79 You will need Cygwin, with the gcc-mingw package installed.  Get 
    80 Cygwin at: 
    81  
    82 http://cygwin.com 
    83  
    84 DO NOT INSTALL CYGWIN PYTHON! 
    85 DO NOT INSTALL CYGWIN PYTHON! 
    86 (Install Native Windows Python.) 
    87  
    88  
    89 * Inno Setup *** 
    90 This creates nice self-installers with uninstall functionality: 
    91 http://www.jrsoftware.org/isinfo.php 
    92 You need version 4.0.8 or above.  (5.0.8 or later preferred.) 
    93  
    94  
    95 * Bootstrap Twisted *** 
    96 You will need an existing installation of Twisted, as the build script 
    97 uses some utilities within Twisted.  The "bare minimum" install 
    98 described above will suffice. 
    99  
    100  
    101 * Issue the build command *** 
    102  
    103 Bring up a Cygwin prompt.  Change directories to the root of your Twisted 
    104 source tree.  It should contain the directory "win32/". 
    105 Now run the following: 
    106  
    107 $ aap.bat -f win32/build.aap 
    108  
    109 The four distributable files will be in dist/ when this is done. 
    110  
    111  
    112  
    113 TROUBLESHOOTING 
    114 --------------- 
    115 If you have trouble building the official build, try the following: 
    116 1. Remove "C:\winnt\aap.bat" or "C:\windows\aap.bat" which will have incorrect 
    117 contents. 
    118 2. Make sure that your system PATH includes C:\Program Files\AAP\Exec 
    119 3. Make sure your cygwin .bash_profile isn't clobbering this system PATH 
    120 4. Make sure you don't have Cygwin's Python package installed.  
    121 5. Make sure both Python 2.3 and Python 2.4 are installed. 
    122 6. If you're doing an official release, see maintainer-notes.txt. 
     1Moved to: http://twistedmatrix.com/trac/wiki/WindowsBuilds 
  • win32/pyx.x-foo.iss.template

     
    1515UninstallFilesDir={code:pythonRegKey} 
    1616 
    1717[Files] 
    18 Source: "%(twhome)s\win32dist\PYTHON%(pyversion10)s\Lib\site-packages\*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs 
     18Source: "%(twhome)s\win32dist\Python%(pyversion10)s\Lib\site-packages\*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs 
    1919%(docfile)s 
    20 Source: "%(twhome)s\win32dist\PYTHON%(pyversion10)s\Scripts\*.*"; DestDir: "{code:pythonRegKey}\scripts"; Flags: ignoreversion recursesubdirs 
     20; Source: "%(twhome)s\win32dist\Python%(pyversion10)s\Scripts\*.*"; DestDir: "{code:pythonRegKey}\scripts"; Flags: ignoreversion recursesubdirs 
    2121Source: "win32\twistenv.bat"; DestDir: "{app}\twisted"; Flags: ignoreversion 
    2222 
    2323[UninstallDelete]