~jacksonc/python-packager/devel

« back to all changes in this revision

Viewing changes to Build-Server/pyinstaller/windows-2.6/buildtests/test15.spec

  • Committer: Jackson Cooper
  • Date: 2010-04-13 03:14:06 UTC
  • Revision ID: jackson@jacksonc.com-20100413031406-415e68ruamsfc5se
Added pyinstaller for Windows

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- mode: python -*-
 
2
import sys
 
3
import os
 
4
 
 
5
CTYPES_DIR = "ctypes"
 
6
TEST_LIB = os.path.join(CTYPES_DIR, "testctypes")
 
7
if sys.platform == "linux2":
 
8
    TEST_LIB += ".so"
 
9
elif sys.platform == "darwin2":
 
10
    TEST_LIB += ".dylib"
 
11
elif sys.platform == "win32":
 
12
    TEST_LIB += ".dll"
 
13
else:
 
14
    raise NotImplentedError
 
15
 
 
16
# If the required dylib does not reside in the current directory, the Analysis
 
17
# class machinery, based on ctypes.util.find_library, will not find it. This was
 
18
# done on purpose for this test, to show how to give Analysis class a clue.
 
19
os.environ["DYLD_LIBRARY_PATH"] = CTYPES_DIR
 
20
os.environ["LD_LIBRARY_PATH"] = CTYPES_DIR
 
21
 
 
22
# Check for presence of testctypes shared library, build it if not present
 
23
if not os.path.exists(TEST_LIB):
 
24
    os.chdir(CTYPES_DIR)
 
25
    if sys.platform == "darwin2":
 
26
        os.system("gcc -Wall -dynamiclib testctypes.c -o testctypes.dylib -headerpad_max_install_names")
 
27
        id_dylib = os.path.abspath("testctypes.dylib")
 
28
        os.system("install_name_tool -id %s testctypes.dylib" % (id_dylib,))
 
29
    elif sys.platform == "linux2":
 
30
        os.system("gcc -fPIC -shared testctypes.c -o testctypes.so")
 
31
    else:
 
32
        raise NotImplementedError
 
33
    os.chdir("..")
 
34
 
 
35
__testname__ = 'test15'
 
36
 
 
37
a = Analysis(['../support/_mountzlib.py',
 
38
              '../support/useUnicode.py',
 
39
              'test15.py'],
 
40
             pathex=[])
 
41
pyz = PYZ(a.pure)
 
42
exe = EXE(pyz,
 
43
          a.scripts,
 
44
          a.binaries,
 
45
          name=os.path.join('dist', __testname__),
 
46
          debug=False,
 
47
          strip=False,
 
48
          upx=False,
 
49
          console=1 )