Show More
@@ -3,19 +3,16 b' ROOT = CWD + "/../.."' | |||||
3 | # Code to run in Python interpreter. |
|
3 | # Code to run in Python interpreter. | |
4 | RUN_CODE = "import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; dispatch.run()" |
|
4 | RUN_CODE = "import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; dispatch.run()" | |
5 |
|
5 | |||
6 |
|
||||
7 | set_build_path(ROOT + "/build/pyoxidizer") |
|
6 | set_build_path(ROOT + "/build/pyoxidizer") | |
8 |
|
7 | |||
9 |
|
||||
10 | def make_distribution(): |
|
8 | def make_distribution(): | |
11 | return default_python_distribution() |
|
9 | return default_python_distribution() | |
12 |
|
10 | |||
13 |
|
||||
14 | def make_distribution_windows(): |
|
11 | def make_distribution_windows(): | |
15 | return default_python_distribution(flavor="standalone_dynamic") |
|
12 | return default_python_distribution(flavor = "standalone_dynamic") | |
16 |
|
||||
17 |
|
13 | |||
18 | def make_exe(dist): |
|
14 | def make_exe(dist): | |
|
15 | """Builds a Rust-wrapped Mercurial binary.""" | |||
19 | config = PythonInterpreterConfig( |
|
16 | config = PythonInterpreterConfig( | |
20 | raw_allocator = "system", |
|
17 | raw_allocator = "system", | |
21 | run_eval = RUN_CODE, |
|
18 | run_eval = RUN_CODE, | |
@@ -58,23 +55,20 b' def make_exe(dist):' | |||||
58 | # On Windows, we install extra packages for convenience. |
|
55 | # On Windows, we install extra packages for convenience. | |
59 | if "windows" in BUILD_TARGET_TRIPLE: |
|
56 | if "windows" in BUILD_TARGET_TRIPLE: | |
60 | exe.add_python_resources( |
|
57 | exe.add_python_resources( | |
61 | dist.pip_install(["-r", ROOT + "/contrib/packaging/requirements_win32.txt"]) |
|
58 | dist.pip_install(["-r", ROOT + "/contrib/packaging/requirements_win32.txt"]), | |
62 | ) |
|
59 | ) | |
63 |
|
60 | |||
64 | return exe |
|
61 | return exe | |
65 |
|
62 | |||
66 |
|
||||
67 | def make_manifest(dist, exe): |
|
63 | def make_manifest(dist, exe): | |
68 | m = FileManifest() |
|
64 | m = FileManifest() | |
69 | m.add_python_resource(".", exe) |
|
65 | m.add_python_resource(".", exe) | |
70 |
|
66 | |||
71 | return m |
|
67 | return m | |
72 |
|
68 | |||
73 |
|
||||
74 | def make_embedded_resources(exe): |
|
69 | def make_embedded_resources(exe): | |
75 | return exe.to_embedded_resources() |
|
70 | return exe.to_embedded_resources() | |
76 |
|
71 | |||
77 |
|
||||
78 | register_target("distribution_posix", make_distribution) |
|
72 | register_target("distribution_posix", make_distribution) | |
79 | register_target("distribution_windows", make_distribution_windows) |
|
73 | register_target("distribution_windows", make_distribution_windows) | |
80 |
|
74 |
General Comments 0
You need to be logged in to leave comments.
Login now