Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump|addpkg(main/{termux-core,termux-exec,tudo,sudo}) for android-5 #22629

Open
wants to merge 14 commits into
base: android-5
Choose a base branch
from

Conversation

agnostic-apollo
Copy link
Member

Related pulls #18872 and termux/termux-exec#24

DO NOT MERGE UNTIL CHANGES HAVE BEEN MERGED WITH termux-exec MASTER

@agnostic-apollo agnostic-apollo force-pushed the termux-constants-and-exec-android-5 branch 2 times, most recently from e7be404 to 77e999f Compare December 27, 2024 21:37
… as scoped variables for different Termux runtime components that are to be shared between Termux packages, apps, site and `termux-exec` and add validation framework

The variables are scoped under `TERMUX__` and `TERMUX_APP__` (note two underscores `__`). Alternative variables `TERMUX_APP_PACKAGE`, `TERMUX_CACHE_DIR`, `TERMUX_BASE_DIR`, `TERMUX_PREFIX`, `TERMUX_ANDROID_HOME` are still kept and will be used for now until we can move to new scoped variables and add them to variable replacements for source and patch files.

Check https://github.com/termux/termux-core-package/blob/master/site/pages/en/projects/docs/usage/utils/termux-scoped-env-variable.md for more info.

The validation of variables is necessary as the Termux packages build framework is a mess and uses unquoted variables everywhere, which could have dangerous consequences. Additionally, forks may make changes that may not be supported or are invalid, so any changes must be checked as well.

The `TERMUX_ENV__S_` scoped variables will also be replaced in patch files.
…directory set in `$TERMUX_PKG_SRCURL` if its in the format `file:///path/to/source/dir`

The `/path/to/source/dir` must be an absolute and normalized path to a source directory on the local file system.

Whatever was the current state of the local source directory when build was started, that is what will be built, without any changes to any `git` branches/tags. Any uncommitted changes to current `git` branch will also get built. No checksum checks like one set in `$TERMUX_PKG_SHA256` will be done, and a tar for source directory will be created every time package is built, assuming `-f` flags are passed for rebuilds.

The `termux_download()` function has been copied from `master` branch, check it for history of contributions.
…it could be a different path than `/data` that is critical for build host like Termux docker

Either delete entire `TERMUX_APP__DATA_DIR` if `TERMUX__PREFIX` directory exists under it, or only delete `TERMUX__PREFIX` directory itself if it exists outside it.
…chy under `/tmp` so that `TERMUX_PKGS__BUILD__REPO_ROOT_DIR` validation does not fail in `properties.sh` file

The `TERMUX_PKGS__BUILD__REPO_ROOT_DIR` validation checks if `scripts/properties.sh` file exists, which wouldn't exist under `scripts` directory if proper hierarchy is not created under `/tmp` directory.
Reworked variant of #4753.

Copied from 99236ea commit in `master` branch.
…ath for setting ownership of `TERMUX__PREFIX` and create `TERMUX_APP__DATA_DIR` as well in case `TERMUX__PREFIX` is not under it

Ownership of `TERMUX__PREFIX` must be fixed before `TERMUX_APP__DATA_DIR` if its under it, otherwise `TERMUX__ROOTFS` will not have its ownership fixed and following error would occur during package dependency extraction.

`tar: data/data/com.termux/files: Cannot change mode to rwxr-xr-x: Operation not permitted`
@agnostic-apollo agnostic-apollo force-pushed the termux-constants-and-exec-android-5 branch from 77e999f to 18d3253 Compare January 5, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant