Mercurial > touhou
annotate setup.py @ 783:ec1e06402a97
Replace SDL2_mixer with the kira crate
| author | Link Mauve <linkmauve@linkmauve.fr> |
|---|---|
| date | Fri, 21 Nov 2025 10:21:59 +0100 |
| parents | 317e93b7d586 |
| children | 7e940ebeb5fd |
| rev | line source |
|---|---|
|
213
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 # -*- encoding: utf-8 -*- |
|
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
2 |
|
431
77c0e9a53795
Use cythonize in setup.py, also compile .py files, and entirely remove pyximport support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
3 import os |
|
77c0e9a53795
Use cythonize in setup.py, also compile .py files, and entirely remove pyximport support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
4 import sys |
|
213
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 from distutils.core import setup |
|
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 from distutils.extension import Extension |
|
513
5e3e0b09a531
Move the OpenGL backend to its own package.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
7 from subprocess import check_output, CalledProcessError |
|
213
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 |
|
218
9634eefd2063
Minor changes to the setup script
Thibaut Girka <thib@sitedethib.com>
parents:
213
diff
changeset
|
9 # Cython is needed |
|
213
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 try: |
|
431
77c0e9a53795
Use cythonize in setup.py, also compile .py files, and entirely remove pyximport support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
11 from Cython.Build import cythonize |
|
213
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 except ImportError: |
|
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 print('You don’t seem to have Cython installed. Please get a ' |
|
451
c034570ac785
Give a friendlier error message if pkg-config isn’t found.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
14 'copy from http://www.cython.org/ and install it.') |
|
213
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
15 sys.exit(1) |
|
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
16 |
|
218
9634eefd2063
Minor changes to the setup script
Thibaut Girka <thib@sitedethib.com>
parents:
213
diff
changeset
|
17 |
|
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
237
diff
changeset
|
18 COMMAND = 'pkg-config' |
|
636
4fa0a8e7d941
Add a GLFW implementation of gui.Window.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
634
diff
changeset
|
19 GLFW_LIBRARIES = ['glfw3'] |
|
783
ec1e06402a97
Replace SDL2_mixer with the kira crate
Link Mauve <linkmauve@linkmauve.fr>
parents:
773
diff
changeset
|
20 SDL_LIBRARIES = ['sdl2', 'SDL2_image', 'SDL2_ttf'] |
|
555
98380e4a0ee5
Switch to libepoxy instead of libGLEW, which will help with OpenGL portability.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
553
diff
changeset
|
21 GL_LIBRARIES = ['epoxy'] |
|
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
237
diff
changeset
|
22 |
|
521
53129f3a54af
Add a debug option to enable HTML annotations, type inference display and profiling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
23 debug = False # True to generate HTML annotations and display infered types. |
|
522
e8496e5ba056
Add a compilation option to disable anmviewer.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
521
diff
changeset
|
24 anmviewer = False # It’s currently broken anyway. |
|
634
5270c34b4c00
Use the number of cores available for parallel compilation, instead of an hardcoded 4 threads.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
633
diff
changeset
|
25 nthreads = os.cpu_count() # How many processes to use for Cython compilation. |
|
619
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
26 compile_everything = False # Maybe improve running time a bit by wasting a lot |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
27 # of CPU time during compilation, and disk space. |
|
541
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
28 |
|
542
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
29 |
|
580
8a8c2e519637
Make setup.py chdir into our root directory, to prevent it to fail when called from elsewhere.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
576
diff
changeset
|
30 # Hack to move us to the correct build directory. |
|
8a8c2e519637
Make setup.py chdir into our root directory, to prevent it to fail when called from elsewhere.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
576
diff
changeset
|
31 os.chdir(os.path.join(os.getcwd(), os.path.dirname(__file__))) |
|
8a8c2e519637
Make setup.py chdir into our root directory, to prevent it to fail when called from elsewhere.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
576
diff
changeset
|
32 |
|
8a8c2e519637
Make setup.py chdir into our root directory, to prevent it to fail when called from elsewhere.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
576
diff
changeset
|
33 |
|
542
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
34 # Hack to prevent `setup.py clean` from compiling Cython files. |
|
576
f3778145d7e7
Allow setup.py to be called without arguments.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
572
diff
changeset
|
35 if len(sys.argv) > 1 and sys.argv[1] == 'clean': |
|
542
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
36 import shutil |
|
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
37 shutil.rmtree('build', ignore_errors=True) |
|
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
38 for directory, _, files in os.walk('pytouhou'): |
|
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
39 for filename in files: |
|
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
40 if filename.endswith('.c'): |
|
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
41 os.unlink(os.path.join(directory, filename)) |
|
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
42 sys.exit(0) |
|
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
43 |
|
a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
541
diff
changeset
|
44 |
|
562
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
45 try: |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
46 sys.argv.remove('--disable-opengl') |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
47 except ValueError: |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
48 use_opengl = True |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
49 else: |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
50 use_opengl = False |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
51 |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
52 |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
53 # Check for epoxy.pc, and don’t compile the OpenGL backend if it isn’t present. |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
54 if use_opengl: |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
55 try: |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
56 check_output([COMMAND] + GL_LIBRARIES) |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
57 except CalledProcessError: |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
58 print('libepoxy not found. Please install it or pass --disable-opengl') |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
59 sys.exit(1) |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
60 except OSError: |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
61 # Assume GL is here if we can’t use pkg-config, but display a warning. |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
62 print('You don’t seem to have pkg-config installed. Please get a copy ' |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
63 'from http://pkg-config.freedesktop.org/ and install it.\n' |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
64 'Continuing without it, assuming every dependency is available.') |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
65 |
|
991c817d1e6b
Fail when libepoxy can’t be found, pass --disable-opengl to skip the OpenGL backend compilation.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
66 |
|
541
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
67 default_libs = { |
|
636
4fa0a8e7d941
Add a GLFW implementation of gui.Window.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
634
diff
changeset
|
68 'glfw3': '-lglfw', |
|
541
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
69 'sdl2': '-lSDL2', |
|
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
70 'SDL2_image': '-lSDL2_image', |
|
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
71 'SDL2_ttf': '-lSDL2_ttf', |
|
555
98380e4a0ee5
Switch to libepoxy instead of libGLEW, which will help with OpenGL portability.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
553
diff
changeset
|
72 'epoxy': '-lepoxy' |
|
541
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
73 } |
|
521
53129f3a54af
Add a debug option to enable HTML annotations, type inference display and profiling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
74 |
|
228
8f4cd1c01d22
Add basic cx_Freeze support in order to freeze to a windows executable.
Thibaut Girka <thib@sitedethib.com>
parents:
226
diff
changeset
|
75 |
|
451
c034570ac785
Give a friendlier error message if pkg-config isn’t found.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
76 def get_arguments(arg, libraries): |
|
c034570ac785
Give a friendlier error message if pkg-config isn’t found.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
77 try: |
|
590
e15672733c93
Switch to Python 3.x instead of 2.7.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
580
diff
changeset
|
78 return check_output([COMMAND, arg] + libraries).decode().split() |
|
513
5e3e0b09a531
Move the OpenGL backend to its own package.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
79 except CalledProcessError: |
|
5e3e0b09a531
Move the OpenGL backend to its own package.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
80 # The error has already been displayed, just exit. |
|
5e3e0b09a531
Move the OpenGL backend to its own package.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
81 sys.exit(1) |
|
451
c034570ac785
Give a friendlier error message if pkg-config isn’t found.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
82 except OSError: |
|
541
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
83 # We already said to the user pkg-config was suggested. |
|
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
84 if arg == '--cflags': |
|
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
85 return [] |
|
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
86 return [default_libs[library] for library in libraries] |
|
451
c034570ac785
Give a friendlier error message if pkg-config isn’t found.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
87 |
|
c034570ac785
Give a friendlier error message if pkg-config isn’t found.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
88 |
|
636
4fa0a8e7d941
Add a GLFW implementation of gui.Window.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
634
diff
changeset
|
89 glfw_args = {'extra_compile_args': get_arguments('--cflags', GLFW_LIBRARIES), |
|
4fa0a8e7d941
Add a GLFW implementation of gui.Window.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
634
diff
changeset
|
90 'extra_link_args': get_arguments('--libs', GLFW_LIBRARIES)} |
|
541
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
91 sdl_args = {'extra_compile_args': get_arguments('--cflags', SDL_LIBRARIES), |
|
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
92 'extra_link_args': get_arguments('--libs', SDL_LIBRARIES)} |
|
513
5e3e0b09a531
Move the OpenGL backend to its own package.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
93 |
|
541
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
94 if use_opengl: |
|
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
95 opengl_args = {'extra_compile_args': get_arguments('--cflags', GL_LIBRARIES + SDL_LIBRARIES), |
|
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
96 'extra_link_args': get_arguments('--libs', GL_LIBRARIES + SDL_LIBRARIES)} |
|
513
5e3e0b09a531
Move the OpenGL backend to its own package.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
97 |
|
5e3e0b09a531
Move the OpenGL backend to its own package.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
98 |
|
619
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
99 def get_module_hierarchy(directory): |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
100 packages = {} |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
101 allowed_extensions = ('.py', '.pyx', '.pxd') |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
102 pycache = os.path.sep + '__pycache__' |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
103 for directory, _, files in os.walk(directory): |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
104 if directory.endswith(pycache): |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
105 continue |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
106 package_name = directory.replace(os.path.sep, '.') |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
107 package = packages.setdefault(package_name, {}) |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
108 for filename in files: |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
109 module_name, file_ext = os.path.splitext(filename) |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
110 if file_ext not in allowed_extensions: |
|
522
e8496e5ba056
Add a compilation option to disable anmviewer.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
521
diff
changeset
|
111 continue |
|
619
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
112 package.setdefault(module_name, []).append(file_ext) |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
113 for module_name, extensions in list(package.items()): |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
114 if '.pyx' not in extensions and '.py' not in extensions: |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
115 del package[module_name] |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
116 return packages |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
117 |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
118 |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
119 def extract_module_types(packages): |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
120 py_modules = [] |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
121 ext_modules = [] |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
122 for package_name, package in packages.items(): |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
123 if package_name in ('pytouhou.ui', 'pytouhou.ui.sdl'): |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
124 package_args = sdl_args |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
125 elif package_name == 'pytouhou.ui.opengl': |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
126 package_args = opengl_args |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
127 else: |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
128 package_args = {} |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
129 for module_name, extensions in package.items(): |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
130 fully_qualified_name = '%s.%s' % (package_name, module_name) |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
131 if '.pyx' in extensions or '.pxd' in extensions or compile_everything: |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
132 if fully_qualified_name == 'pytouhou.lib.sdl': |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
133 compile_args = sdl_args |
|
636
4fa0a8e7d941
Add a GLFW implementation of gui.Window.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
634
diff
changeset
|
134 elif fully_qualified_name == 'pytouhou.lib.glfw': |
|
4fa0a8e7d941
Add a GLFW implementation of gui.Window.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
634
diff
changeset
|
135 compile_args = glfw_args |
|
619
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
136 else: |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
137 compile_args = package_args |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
138 ext = 'pyx' if '.pyx' in extensions else 'py' |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
139 source = '%s.%s' % (fully_qualified_name.replace('.', os.path.sep), ext) |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
140 ext_modules.append(Extension(fully_qualified_name, |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
141 [source], |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
142 **compile_args)) |
|
513
5e3e0b09a531
Move the OpenGL backend to its own package.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
143 else: |
|
619
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
144 py_modules.append(fully_qualified_name) |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
145 return py_modules, ext_modules |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
146 |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
147 |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
148 packages = get_module_hierarchy('pytouhou') |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
149 |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
150 if not use_opengl: |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
151 del packages['pytouhou.ui.opengl'] |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
152 del packages['pytouhou.ui.opengl.shaders'] |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
153 |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
154 if not anmviewer: |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
155 del packages['pytouhou.ui']['anmrenderer'] |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
156 |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
157 py_modules, ext_modules = extract_module_types(packages) |
|
213
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
158 |
|
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
159 |
|
541
8895ede4e51e
Fix Windows and OSX build by making pkg-config optional and assuming every dependency is available.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
528
diff
changeset
|
160 # OS-specific setuptools options. |
|
228
8f4cd1c01d22
Add basic cx_Freeze support in order to freeze to a windows executable.
Thibaut Girka <thib@sitedethib.com>
parents:
226
diff
changeset
|
161 try: |
|
8f4cd1c01d22
Add basic cx_Freeze support in order to freeze to a windows executable.
Thibaut Girka <thib@sitedethib.com>
parents:
226
diff
changeset
|
162 from cx_Freeze import setup, Executable |
|
8f4cd1c01d22
Add basic cx_Freeze support in order to freeze to a windows executable.
Thibaut Girka <thib@sitedethib.com>
parents:
226
diff
changeset
|
163 except ImportError: |
|
8f4cd1c01d22
Add basic cx_Freeze support in order to freeze to a windows executable.
Thibaut Girka <thib@sitedethib.com>
parents:
226
diff
changeset
|
164 extra = {} |
|
8f4cd1c01d22
Add basic cx_Freeze support in order to freeze to a windows executable.
Thibaut Girka <thib@sitedethib.com>
parents:
226
diff
changeset
|
165 else: |
|
630
6c40f5840a06
Include all of the modules during cx_Freeze, and don’t prevent multi-threaded Cython compilation on non-Windows platforms.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
629
diff
changeset
|
166 base = None |
|
6c40f5840a06
Include all of the modules during cx_Freeze, and don’t prevent multi-threaded Cython compilation on non-Windows platforms.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
629
diff
changeset
|
167 if sys.platform == 'win32': |
|
6c40f5840a06
Include all of the modules during cx_Freeze, and don’t prevent multi-threaded Cython compilation on non-Windows platforms.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
629
diff
changeset
|
168 nthreads = None # It seems Windows can’t compile in parallel. |
|
6c40f5840a06
Include all of the modules during cx_Freeze, and don’t prevent multi-threaded Cython compilation on non-Windows platforms.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
629
diff
changeset
|
169 base = 'Win32GUI' |
|
6c40f5840a06
Include all of the modules during cx_Freeze, and don’t prevent multi-threaded Cython compilation on non-Windows platforms.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
629
diff
changeset
|
170 extra = {'options': {'build_exe': {'includes': [mod.name for mod in ext_modules] + py_modules}}, |
|
546
94dd9862c470
Rename the eosd script into pytouhou, and remove the obsolete pcb one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
542
diff
changeset
|
171 'executables': [Executable(script='scripts/pytouhou', base=base)]} |
|
228
8f4cd1c01d22
Add basic cx_Freeze support in order to freeze to a windows executable.
Thibaut Girka <thib@sitedethib.com>
parents:
226
diff
changeset
|
172 |
|
8f4cd1c01d22
Add basic cx_Freeze support in order to freeze to a windows executable.
Thibaut Girka <thib@sitedethib.com>
parents:
226
diff
changeset
|
173 |
|
572
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
174 # Create a link to the data files (for packaging purposes) |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
175 current_dir = os.path.dirname(os.path.realpath(__file__)) |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
176 temp_data_dir = os.path.join(current_dir, 'pytouhou', 'data') |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
177 if not os.path.exists(temp_data_dir): |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
178 os.symlink(os.path.join(current_dir, 'data'), temp_data_dir) |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
179 |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
180 |
|
213
9bdf116bb2a5
Add a distutils setup and don’t hardcode DAT list.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
181 setup(name='PyTouhou', |
|
629
26d9d251f658
Use the current revision as the version number.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
626
diff
changeset
|
182 version=check_output(['hg', 'heads', '.', '-T', '{rev}']).decode(), |
|
218
9634eefd2063
Minor changes to the setup script
Thibaut Girka <thib@sitedethib.com>
parents:
213
diff
changeset
|
183 author='Thibaut Girka', |
|
9634eefd2063
Minor changes to the setup script
Thibaut Girka <thib@sitedethib.com>
parents:
213
diff
changeset
|
184 author_email='thib@sitedethib.com', |
|
431
77c0e9a53795
Use cythonize in setup.py, also compile .py files, and entirely remove pyximport support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
185 url='http://pytouhou.linkmauve.fr/', |
|
218
9634eefd2063
Minor changes to the setup script
Thibaut Girka <thib@sitedethib.com>
parents:
213
diff
changeset
|
186 license='GPLv3', |
|
619
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
187 py_modules=py_modules, |
|
39874a722b76
Use two passes for the module search, and clean it up so that pure Python modules don’t get compiled by default.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
608
diff
changeset
|
188 ext_modules=cythonize(ext_modules, nthreads=nthreads, annotate=debug, |
|
607
9dbc234ea087
Actually compile under 3.x feature level.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
590
diff
changeset
|
189 language_level=3, |
|
431
77c0e9a53795
Use cythonize in setup.py, also compile .py files, and entirely remove pyximport support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
190 compiler_directives={'infer_types': True, |
|
521
53129f3a54af
Add a debug option to enable HTML annotations, type inference display and profiling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
191 'infer_types.verbose': debug, |
|
53129f3a54af
Add a debug option to enable HTML annotations, type inference display and profiling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
515
diff
changeset
|
192 'profile': debug}, |
|
515
b3193b43a86c
Add an indirection layer for textures, to cope with drivers assigning them random names.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
513
diff
changeset
|
193 compile_time_env={'MAX_TEXTURES': 128, |
|
505
bfea9e9a6845
Manage the texture-specific indices in the Texture, and some more renderer optimisations.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
488
diff
changeset
|
194 'MAX_ELEMENTS': 640 * 4 * 3, |
|
528
7c3c90468996
Inherit music players from a base class.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
525
diff
changeset
|
195 'MAX_SOUNDS': 26, |
|
555
98380e4a0ee5
Switch to libepoxy instead of libGLEW, which will help with OpenGL portability.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
553
diff
changeset
|
196 'USE_OPENGL': use_opengl}), |
|
546
94dd9862c470
Rename the eosd script into pytouhou, and remove the obsolete pcb one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
542
diff
changeset
|
197 scripts=['scripts/pytouhou'] + (['scripts/anmviewer'] if anmviewer else []), |
|
633
38928d4d6709
package_data doesn’t work with no package specified, add the pytouhou package back.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
630
diff
changeset
|
198 packages=['pytouhou'], |
|
431
77c0e9a53795
Use cythonize in setup.py, also compile .py files, and entirely remove pyximport support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
199 **extra) |
|
572
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
200 |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
201 |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
202 # Remove the link afterwards |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
203 if os.path.exists(temp_data_dir): |
|
7f113f15300b
Include the Glade file in the main package on install.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
563
diff
changeset
|
204 os.unlink(temp_data_dir) |
