这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@agnostic-apollo
Copy link
Member

Related pulls #18872 and termux/termux-exec-package#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
@agnostic-apollo agnostic-apollo force-pushed the termux-constants-and-exec-android-5 branch from 77e999f to 18d3253 Compare January 5, 2025 22:12
@agnostic-apollo agnostic-apollo force-pushed the termux-constants-and-exec-android-5 branch from 18d3253 to ce2251b Compare March 5, 2025 05:51
… 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.
…ermux_step_elf_cleaner` for packages to hook into

Packages may not want specific elf files to be stripped, like for debug `-g` test binaries, or may have elf files under different non-standard directories.
…function to file and provide `termux_step_create_debscripts__copy_from_dir()` for packages to copy debscripts from a custom directory into the current `DEBIAN` working directory

For example:

```shell
termux_step_create_debscripts() {
	termux_step_create_debscripts__copy_from_dir "$TERMUX_PKG_SRCDIR/build/output/packaging/debian" .
}
```
…r if `argv[0]` length is `>= 128` on Android `< 6` instead of letting process fail post execve() without an error

Related commit termux/termux-exec-package@3d7eecac
…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`
… `termux-exec` package version `>= 2.0.0` in `login` script
@agnostic-apollo agnostic-apollo force-pushed the termux-constants-and-exec-android-5 branch from ce2251b to 13058f0 Compare March 22, 2025 00:26
@agnostic-apollo agnostic-apollo merged commit 13058f0 into android-5 Mar 22, 2025
@Grimler91 Grimler91 deleted the termux-constants-and-exec-android-5 branch March 23, 2025 11:25
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