r23b was suppose to fix so that -fno-integrated-as worked again (which
libx265 needs for example), but the symlinks added point towards an
absolute path in /buildbot/src/android/ndk-release-r23 instead of to
../../bin/. Re-create symlinks with correct destination.
After https://github.com/termux/termux-packages/commit/e34ae5da030d,
llvm-config was created before termux_step_get_dependencies, meaning
that it gets overwritten if libllvm is installed.
Fix this by creating llvm-config in a new function
termux_step_override_config_scripts, that is run right after
termux_step_get_dependencies.
When adding this, we go from compiling with
/home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/clang++ [...] -mrelocation-model pic -pic-level 2 -pic-is-pie [...]
to
/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/clang++ [...] -mrelocation-model pic -pic-level 2 [...]
Before, we got a warning when compiling libandroid-spawn:
/home/builder/.termux-build/_cache/android-r21d-api-24-v4/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: warning: shared library text segment is not shareable
and trying to use a program linked against libandroid-spawn gave an
error, see
https://github.com/termux/termux-packages/issues/7215#issuecomment-906154438
the Without this, libraries might end up with text relocations. For
some reason it does not seem to be an issue on the other arches.
%ci:no-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.
All, or at least most, of our debs contain "./" as a folder. This
causes problems when extracting on some systems, as ./ then is the
system root directory /, and tar cannot change the permissions of this
folder. Trying to build on arch for example gives:
tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted
tar: Exiting with failure status due to previous errors
The issue appeared on arch somewhat recently, maybe with tar 1.33. To
avoid having to rebuild all packages we now handle both data.tar.xz
types, with prefixed ./, and without.
Also remove some indentation levels while we are at it.
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.
By defining __TERMUX__ and __TERMUX_PREFIX__ in <sys/cdefs.h> (which is
basically always included) one can more easily target Termux
specifically, both when cross-compiling packages and when code is built
on-device.
Variables
TERMUX_PKG_PLATFORM_INDEPENDENT
TERMUX_DEBUG
TERMUX_PKG_HAS_DEBUG
TERMUX_PKG_ESSENTIAL
TERMUX_SUBPKG_ESSENTIAL
TERMUX_PKG_NO_STATICSPLIT
TERMUX_PKG_BUILD_IN_SRC
TERMUX_PKG_FORCE_CMAKE
TERMUX_PKG_HOSTBUILD
should not accept arbitrary values for marking them "enabled". Instead
they should accept boolean values which makes them easier to handle and
also makes their meaning clear.
build-package.sh should make decision based on variable's value but not on
whether it is set or empty.
%ci:no-build
Partial compatibility for on-device builds.
There is no guarantee that it will be possible to build all available
packages and built packages will have same reliability that cross-compiled
but should solve "self-hosting" problems as much as possible.
* Do not re=download release files.
* Efficiently handle dependencies: do not try to download \*.deb files when they already downloaded, do not try to extract them more than one time.