forked from renpy/renpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·148 lines (119 loc) · 5.6 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·148 lines (119 loc) · 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/usr/bin/env python
# Copyright 2004-2026 Tom Rothamel <pytom@bishoujo.us>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import os, sys
from pathlib import Path
import scripts.generate_styles as generate_styles
import scripts.setuplib as setuplib
from scripts.setuplib import cython, env, generate_all_cython, generate_setup_files
# Change to the directory containing this file.
BASE = Path(__file__).resolve().parent
def main():
os.chdir(BASE)
setuplib.init()
setuplib.check_imports(BASE / "scripts", "setuplib.py", "generate_styles.py")
generate_styles.generate()
# These control the level of optimization versus debugging.
setuplib.extra_compile_args = ["-Wno-unused-function", "-O2", "-mtune=generic", "-flto", "-g0"]
setuplib.extra_link_args = ["-s", "-flto"]
cubism = os.environ.get("CUBISM", None)
setuplib.include_dirs.append(f"{cubism}/Core/include")
# src/ directory.
cython("_renpy", ["src/IMG_savepng.c", "src/core.c"], packages="sdl3 libpng")
# renpy.pygame
cython("renpy.pygame.iostream", packages="sdl3")
cython("renpy.pygame.locals", packages="sdl3")
cython("renpy.pygame.image", source=[ "src/pygame/write_png.c", "src/pygame/write_jpeg.c" ], packages="sdl3-image libjpeg libpng sdl3")
cython("renpy.pygame.sdl_image", packages="sdl3")
cython("renpy.pygame.controller", packages="sdl3")
cython("renpy.pygame.joystick", packages="sdl3")
cython("renpy.pygame.pygame_time", packages="sdl3")
cython("renpy.pygame.power", packages="sdl3")
cython("renpy.pygame.transform", source=["src/pygame/SDL3_rotozoom.c"], packages="sdl3")
cython("renpy.pygame.scrap", packages="sdl3")
cython("renpy.pygame.key", packages="sdl3")
cython("renpy.pygame.mouse", packages="sdl3")
cython("renpy.pygame.event", packages="sdl3")
cython("renpy.pygame.display", packages="sdl3")
cython("renpy.pygame.sdl", packages="sdl3")
cython("renpy.pygame.color", packages="sdl3")
cython("renpy.pygame.rect", packages="sdl3")
cython("renpy.pygame.error", packages="sdl3")
cython("renpy.pygame.surface", packages="sdl3")
cython("renpy.pygame.draw", packages="sdl3")
cython("renpy.pygame.gfxdraw", source=[ "src/pygame/SDL3_gfxPrimitives.c", "src/pygame/SDL3_rotozoom.c" ], packages="sdl3")
# renpy
cython("renpy.astsupport")
cython("renpy.cslots")
cython("renpy.lexersupport")
cython("renpy.pydict")
cython("renpy.style")
cython("renpy.encryption")
cython("renpy.tfd", ["src/tinyfiledialogs/tinyfiledialogs.c"], setup_filename="Setup.tfd")
cython("renpy.ecsign", ["src/ec_sign_core.c", "src/ec_sign_core_web.c"], packages="openssl")
# renpy.audio
cython(
"renpy.audio.renpysound", [ "src/renpysound_core.c", "src/ffmedia.c" ],
compile_args=["-Wno-deprecated-declarations"] if ("RENPY_FFMPEG_NO_DEPRECATED_DECLARATIONS" in os.environ) else [],
packages="libavformat libavcodec libavutil libswresample libswscale sdl3")
cython("renpy.audio.filter")
# renpy.styledata
cython("renpy.styledata.styleclass")
for p in generate_styles.prefixes:
cython(f"renpy.styledata.style_{p}functions")
# renpy.display
cython("renpy.display.matrix")
cython("renpy.display.render")
cython("renpy.display.accelerator", packages="sdl3")
cython("renpy.display.quaternion")
# renpy.uguu
cython("renpy.uguu.gl", packages="sdl3")
cython("renpy.uguu.uguu", packages="sdl3")
# renpy.gl2
cython("renpy.gl2.gl2mesh")
cython("renpy.gl2.gl2mesh2")
cython("renpy.gl2.gl2mesh3")
cython("renpy.gl2.gl2polygon")
cython("renpy.gl2.gl2model", packages="sdl3")
cython("renpy.gl2.gl2draw", packages="sdl3")
cython("renpy.gl2.gl2texture", packages="sdl3")
cython("renpy.gl2.gl2uniform", packages="sdl3")
cython("renpy.gl2.gl2shader", packages="sdl3")
cython("renpy.gl2.live2dmodel", ["src/live2dcsm.c"], packages="sdl3")
cython("renpy.gl2.assimp", ["src/assimpio.cc"], language="c++", packages="assimp sdl3")
# renpy.text
cython("renpy.text.textsupport")
cython("renpy.text.texwrap")
cython("renpy.text.ftfont", ["src/ftsupport.c", "src/ttgsubtable.c"], packages="freetype2 harfbuzz sdl3")
cython("renpy.text.hbfont", ["src/ftsupport.c"], packages="freetype2 harfbuzz sdl3")
cython("renpy.text.bidi", ["src/renpybidicore.c"], packages="fribidi")
generate_all_cython()
generate_setup_files()
if len(sys.argv) >= 2 and sys.argv[1] == "generate":
return
env("CC")
env("LD")
env("CXX")
env("CFLAGS")
env("LDFLAGS")
setuplib.setup("renpy", "8.99.99")
if __name__ == "__main__":
main()