Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-131531: Addandroid.py package command#131532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
freakboy3742 merged 8 commits intopython:mainfrommhsmith:android-package
Apr 1, 2025
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Remove extrabuild level in directory structure
  • Loading branch information
@mhsmith
mhsmith committedMar 31, 2025
commitc537d97d83127f6917eb59b464bae4a17a289ffd
26 changes: 12 additions & 14 deletionsAndroid/android.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -111,7 +111,7 @@ def run(command, *, host=None, env=None, log=True, **kwargs):

def build_python_path():
"""The path to the build Python binary."""
build_dir = subdir("build", "build")
build_dir = subdir("build")
binary = build_dir / "python"
if not binary.is_file():
binary = binary.with_suffix(".exe")
Expand All@@ -125,7 +125,7 @@ def build_python_path():
def configure_build_python(context):
if context.clean:
clean("build")
os.chdir(subdir("build","build",create=True))
os.chdir(subdir("build", create=True))

command = [relpath(CHECKOUT / "configure")]
if context.args:
Expand All@@ -134,7 +134,7 @@ def configure_build_python(context):


def make_build_python(context):
os.chdir(subdir("build", "build"))
os.chdir(subdir("build"))
run(["make", "-j", str(os.cpu_count())])


Expand All@@ -158,14 +158,14 @@ def configure_host_python(context):
if context.clean:
clean(context.host)

prefix_dir = subdir(context.host, "prefix", create=True)
if not (prefix_dir / "include").exists():
host_dir = subdir(context.host, create=True)
prefix_dir = host_dir / "prefix"
if not prefix_dir.exists():
prefix_dir.mkdir()
os.chdir(prefix_dir)
unpack_deps(context.host)

build_dir = subdir(context.host, "build", create=True)
os.chdir(build_dir)

os.chdir(host_dir)
command = [
# Basic cross-compiling configuration
relpath(CHECKOUT / "configure"),
Expand All@@ -192,11 +192,12 @@ def make_host_python(context):
# The CFLAGS and LDFLAGS set in android-env include the prefix dir, so
# delete any previous Python installation to prevent it being used during
# the build.
prefix_dir = subdir(context.host, "prefix")
host_dir = subdir(context.host)
prefix_dir = host_dir / "prefix"
for pattern in ("include/python*", "lib/libpython*", "lib/python*"):
delete_glob(f"{prefix_dir}/{pattern}")

os.chdir(subdir(context.host, "build"))
os.chdir(host_dir)
run(["make", "-j", str(os.cpu_count())], host=context.host)
run(["make", "install", f"prefix={prefix_dir}"], host=context.host)

Expand All@@ -209,10 +210,7 @@ def build_all(context):


def clean(host):
# Don't delete "dist", as that could be difficult to regenerate, and won't
# affect future builds anyway.
for name in ["build", "prefix"]:
delete_glob(CROSS_BUILD_DIR / host / name)
delete_glob(CROSS_BUILD_DIR / host)


def clean_all(context):
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp