Commit Graph

71 Commits

Author SHA1 Message Date
Maxython d502e7489d scripts(build-package.sh): fix on device compilation of packages when force building and revert `-f` flag behaviour
- Reverted behviour of `-f` flag changed in b9b5987 and only force build current package instead of dependencies.
- Added a  new `-F` flag to force build current package and dependencies as well.
- If both `-I` and `-F` flags are passed and dependencies cannot be compiled on device, i.e `$TERMUX_PKG_ON_DEVICE_BUILD_NOT_SUPPORTED` is set to `true` in `build.sh` of package, then they will be downloaded instead.
- If only `-F` flag is passed without the `-I` flag, and building on device is not supported, then building with fail with error.
- The `$TERMUX_BUILD_PACKAGE_CALL_DEPTH` variable will be used to track depth of recursive calls to `build-package.sh`.
- The file at `$TERMUX_BUILD_PACKAGE_CALL_BUILT_PACKAGES_LIST_FILE_PATH` will be used to track list of packages and their dependencies that have been compiled at any instant by recursive calls to `build-package.sh`.
- Added `scripts/utils/package/package.sh` to store package utils. The `pacakge__is_package_version_built()` method can be used to check if a certain package version has been built. In future this should include `$TERMUX_APP_PACKAGE` as well.

Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
Co-authored-by: Maxython <mixython@gmail.com>
2023-01-03 20:06:03 +05:00
Tee KOBAYASHI 7ed4279993 termux_setup_gir: Add flag to opt out
`TERMUX_PKG_DISABLE_GIR=true` disables building of introspection data.

%ci:no-build
2022-10-22 08:23:21 +09:00
Henrik Grimler b044a49d0f
scripts: export TERMUX_PACKAGE_FORMAT and TERMUX_PACKAGE_MANAGER
Otherwise these variables is not visible to child shells.  This caused
configure step of termux-tools to always use debian/apt combination,
since it checks for variables among environmental variables and they
were not visible.
2022-08-10 09:00:33 +02:00
Chongyun Lee 90fda1305b chore: Move REPO-related variables to properties.sh 2022-07-11 15:43:24 +08:00
Henrik Grimler 6cf9f35fac
scripts,ci(*): use termux.dev instead of termux.org
We are now mainly promoting and using termux.dev, so lets switch all
the urls.
2022-07-02 10:41:16 +02:00
Yaksh Bariya ad28dd2ad7
Revert "chore,scripts(termux_step_setup_variables): use main host instead of Cloudflare"
This reverts commit 4da820d32c.

Fixed now
2022-05-28 12:36:16 +05:30
Yaksh Bariya 4da820d32c
chore,scripts(termux_step_setup_variables): use main host instead of Cloudflare
Should be reverted as soon as @Grimler91 fixes the DNS/CNAME
configuration

Closes #10835
Closes #10836
2022-05-28 12:27:51 +05:30
agnostic-apollo 0275d9bff3 changed(scripts|main/termux-tools): Use TERMUX_APP_PACKAGE_MANAGER instead of TERMUX_MAIN_PACKAGE_FORMAT
Make changes as per new design implemented in termux/termux-app@b950efec and termux/termux-app#2740

The package build and termux-tools scripts use current package manager for custom logic. The `termux-tools/termux-setup-package-manager` script has been added that will now be used to provide backward compatibility for termux-app `< 0.119.0` (when its released) and validate the package manager. It will also ensure the variable in not unset to prevent `unbound variable` errors if `set -u` is being used by calling scripts.

Closes #10782
2022-05-23 12:14:55 +05:00
Yaksh Bariya f0ea9b922b
monorepo: apply changes suggested by buttaface 2022-04-18 13:57:19 +05:30
Yaksh Bariya 52c383b4d1
chore: switch to monorepo 2022-04-18 13:57:13 +05:30
Aditya Alok 3b92fd5648
Revert "[TEMP] download deps from grimler.se instead of packages.termux.org"
- It should be fixed now.
https://github.com/termux/termux-packages/issues/9860#issuecomment-1087144145

This reverts commit dbd7249e4b.
2022-04-04 11:37:23 +05:30
Aditya Alok dbd7249e4b
[TEMP] download deps from grimler.se instead of packages.termux.org
- packages.termux.org gives wrong checksum for arm and aarch64 repository metadata
2022-04-04 11:03:30 +05:30
Aditya Alok 3a1acb712b feat(build scripts): allow packages to define extra static split patterns
- add variable `TERMUX_PKG_STATICSPLIT_EXTRA_PATTERNS`

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
2022-03-09 10:01:57 +09:00
Henrik Grimler b79db7ce73
Revert "[TEMP] download deps from grimler.se instead of packages.termux.org"
This reverts commit 5b432ffbbc.
2022-03-07 14:40:40 +01:00
Henrik Grimler 5b432ffbbc
[TEMP] download deps from grimler.se instead of packages.termux.org
Fosshost mirror is down at the moment.
2022-03-04 08:26:51 +01:00
Henrik Grimler e37646a3ae
Revert "[TEMP] download deps from grimler.se instead of packages.termux.org"
This reverts commit 7850c1d98b.
2022-02-25 08:27:38 +01:00
Henrik Grimler 7850c1d98b
[TEMP] download deps from grimler.se instead of packages.termux.org
Fosshost mirror is down at the moment.
2022-02-24 14:11:43 +01:00
Henrik Grimler 42b4712c15
step_setup_variables: fix warning about undefined TERMUX_MAIN_PACKAGE_FORMAT 2022-02-19 14:41:19 +05:30
Maxython 465159a72e
build-package.sh: change logic for package manager selection to be more stable
termux_step_setup_variables: added logic with TERMUX_PACKAGE_FORMAT
for easier compilation.
2022-02-11 22:38:40 +01:00
Henrik Grimler ed351084a0
termux_step_setup_variables: no need to check termux-{games,science}
Since these repositories have been merged into the main repository
there is no need to check them for dependencies.
2021-12-05 13:18:21 +01:00
Henrik Grimler 96dd5b5f96
Remove unstable-repo from list of repos
It has been merged with main repo so no need to look for package
dependencies in it.
2021-11-14 20:58:36 +01:00
Leonid Pliushch 6572b28692
build-package.sh: introduce TERMUX_PKG_NO_SHEBANG_FIX
This variable will disable shebang fixing during massage step. Normally
such fix shouldn't be disabled, but there are packages where it causes
a huge overhead and is not needed anyway.

Packages that are known to be affected by overhead and take long time
for building:

 * papirus-icon-theme from x11-packages
2021-10-25 12:52:36 +03:00
Leonid Pliushch 653d72b8cf
build-package.sh: use cloudflare-backed package host 2021-10-08 23:54:38 +03:00
Ivan Max 5465f29528
build-package.sh: introduce TERMUX_PKG_GROUPS for pacman packaging format (#7609)
This metadata field allows to define groups to which the given packages belong.

See https://wiki.archlinux.org/title/Pacman#Installing_package_groups
2021-09-28 12:48:55 +03:00
Leonid Pliushch 07852c874b
build-package.sh: allow to select package formats between debian and pacman 2021-09-10 19:55:28 +03:00
Henrik Grimler ecd214881a build-package: add new arg -c for "continue build"
As replacement for TERMUX_PKG_QUICK_REBUILD. Running
./build-package.sh -c <package> starts a build for <package>, but does
not extract and patch the source from scratch. Instead it sets up the
build variables and starts from termux_step_make.

When working on a big package that can take hours to build it is
convenient to be able to build until there is an error, then apply
some new patch (manually) to the source, and then continue from where
the build failed.
2021-08-24 21:40:46 +02:00
Henrik Grimler 2c70621a98 build-package: rename TERMUX_DEBUG to TERMUX_DEBUG_BUILD
To make it more self-explanatory.
2021-08-21 20:55:57 +02:00
Henrik Grimler ea1772da55 termux_step_setup_variables: sort variables alphabetically 2021-08-21 20:54:44 +02:00
Leonid Pliushch c9e8d1cb2b
build-package.sh: use packages.termux.org when running with -I/-i options 2021-06-03 14:59:39 +03:00
Leonid Pliushch 5c45d87234
build-package.sh: use Github Pages repositories for Unstable/X11 packages 2021-05-10 21:01:21 +03:00
Leonid Pliushch a92e355891
build-package.sh: use grimler.se mirrors for unstable & x11 repos
Use non-IPFS repositories for fetching dependencies when building packages.
This is required at least for CI as gateways seem to block requests due to
either rate limit or restriction for usage by cloud platforms.
2021-04-30 16:29:45 +03:00
Leonid Pliushch 107c098419
build-package.sh: try dweb.link ipfs gateway for x11 & unstable repositories 2021-04-28 14:16:17 +03:00
Henrik Grimler e460d1f1aa termux_step_setup_variables: use grimler.se for main repo
CI seem to fail quite often due to timeout when downloading from IPFS
host. Switch to grimler.se for now.
2021-03-12 16:19:40 +01:00
Leonid Pliushch 00c96411be
build-package.sh: switch from {unstable,x11}.termux-mirror.ml to IPFS links 2021-02-10 15:03:57 +02:00
Leonid Pliushch aadee78eed
scripts: prepare for Bintray deprecation
Use termux.org as main repo host.

grimler.se / *.termux-mirror.ml for others.
2021-02-08 12:56:54 +02:00
Leonid Pliushch 37375312b9
explicitly set maintainer for each package
In issue https://github.com/termux/termux-packages/issues/6160 I have found
that community repo "its-pointless.github.io" specifies us as maintainer
for its packages. This is NOT TRUE and potentially misleads people using
these packages.

Now TERMUX_PKG_MAINTAINER will contain a default value which is neutral
and not specify maintainer. So all packages now have to override it to
the correct value.

[skip ci]
%ci:no-build
2020-12-20 15:16:34 +02:00
Leonid Pliushch a4263115fc termux_step_setup_variables.sh: no need to override home/prefix for on-device builds 2020-10-30 21:48:26 +02:00
Leonid Pliushch 7f8ee49bfc termux_step_setup_variables.sh: no need to attempt to set default prefix/home, they are set by properties.sh now 2020-10-30 21:46:29 +02:00
Leonid Pliushch 195314fe20 setup-offline-bundle.sh: add support for downloading package sources 2020-10-23 00:27:56 +03:00
Leonid Pliushch c80220e31d build-package.sh: make it possible to disable termux-elf-cleaner
Just set TERMUX_PKG_NO_ELF_CLEANER=true in build.sh.
2020-10-01 19:34:19 +03:00
Henrik Grimler 8cff1c6d4f termux_step_setup_variables: spaces->tab 2020-07-21 10:27:54 +02:00
Henrik Grimler 4e902a41a5 building packages: create termux_step_get_source function
Calls termux_git_clone_src if TERMUX_PKG_SRCURL ends with .git, and
termux_download_src_archive and termux_extract_src_archive otherwise.
termux_step_extract_package has been split up into the latter two
functions.

termux_step_post_extract_package has been renamed to
termux_step_post_get_source to reflect these changes.
2020-07-21 10:14:00 +02:00
Leonid Pliushch 19df87391a Revert "build-package.sh: fast builds (-i/-I): disable X11 repository temporarily"
This reverts commit 03c1693f09.
2020-06-23 15:25:11 +03:00
Leonid Pliushch 6d40bba10d build-package.sh: fast builds (-i/-I): disable X11 repository temporarily 2020-06-22 20:02:07 +03:00
Leonid Pliushch 9c9e7f65b8 update maintainer info
Specifying Termux org members is more correct as we don't have repo-specific
maintainers for termux-packages.

DEB control field specification doesn't allow to specify multiple people as
package maintainers. Value "Termux members @termux" will be used as default
for that field which can be overridden on per-package basis if needed.

%ci:no-build
2020-05-13 11:05:52 +03:00
Leonid Pliushch fb16d92527 Revert "build-package.sh: download dependency packages from mirror instead of Bintray"
This reverts commit f679a18402.
2020-04-25 02:28:35 +03:00
Leonid Pliushch 9954394e75 build-package.sh: download dependency packages from mirror instead of Bintray
Avoid redundant traffic for Bintray repos when doing fast builds (-i/-I).
2020-03-21 15:47:48 +02:00
Butta 3af25bc2a9 Introduce TERMUX_PKG_QUICK_REBUILD
This new variable is extremely useful when iterating on creating a large package,
as otherwise you have to wipe the source and rebuild each time you make a mistake
with the patches or build.sh script.

Simply set TERMUX_PKG_QUICK_REBUILD=true in build.sh if a build fails and then the
TERMUX_PKG_SRCDIR and TERMUX_PKG_BUILDDIR will not be touched when you rebuild,
including that the patches will not be applied again. When you're done iterating,
diff for any new patches, save them, and remove this variable before rebuilding
from scratch, hopefully for the last time. ;)

An example is shown for the giant libllvm package, where other modifications are
also excluded if this variable is set.
2020-02-15 13:38:30 +05:30
Henrik Grimler ab2a3b70f0 build-package.sh: add TERMUX_PKG_SERVICE_SCRIPT var and build script
termux_step_install_service_scripts is run after
termux_step_post_make_install and loops over the new array
TERMUX_PKG_SERVICE_SCRIPT to add service scripts for termux-services.

The service scripts are usually only a one-liner so we might just as
well define it in a variable like TERMUX_PKG_SERVICE_SCRIPT.

TERMUX_PKG_SERVICE_SCRIPT should be an array on the format
("daemon-name" 'script to execute' "another daemon" 'multi\n line\n script'),
i.e. it should be of even length with name + script where the script
part preferably is within single quotes (to avoid accidental expansion
of for example $HOME).
2020-01-05 15:00:15 +01:00
Leonid Pliushch ddf7066863 build-package.sh: fix url for unstable & x11 packages 2019-11-17 14:56:25 +02:00