build-package: rename TERMUX_DEBUG to TERMUX_DEBUG_BUILD

To make it more self-explanatory.
This commit is contained in:
Henrik Grimler 2021-08-21 16:50:05 +02:00
parent ea1772da55
commit 2c70621a98
13 changed files with 17 additions and 17 deletions

View File

@ -12,7 +12,7 @@ fi
test -f "$HOME"/.termuxrc && . "$HOME"/.termuxrc
: ${TERMUX_TOPDIR:="$HOME/.termux-build"}
: ${TERMUX_ARCH:="aarch64"}
: ${TERMUX_DEBUG:=""}
: ${TERMUX_DEBUG_BUILD:=""}
: ${TERMUX_INSTALL_DEPS:="-s"}
# Set TERMUX_INSTALL_DEPS to -s unless set to -i
@ -29,7 +29,7 @@ _show_usage() {
while getopts :a:hdio: option; do
case "$option" in
a) TERMUX_ARCH="$OPTARG";;
d) TERMUX_DEBUG='-d';;
d) TERMUX_DEBUG_BUILD='-d';;
i) TERMUX_INSTALL_DEPS='-i';;
o) TERMUX_DEBDIR="$(realpath -m "$OPTARG")";;
h) _show_usage;;
@ -72,7 +72,7 @@ while read -r PKG PKG_DIR; do
echo -n "Building $PKG... "
BUILD_START=$(date "+%s")
bash -x "$BUILDSCRIPT" -a "$TERMUX_ARCH" $TERMUX_DEBUG \
bash -x "$BUILDSCRIPT" -a "$TERMUX_ARCH" $TERMUX_DEBUG_BUILD \
${TERMUX_DEBDIR+-o $TERMUX_DEBDIR} $TERMUX_INSTALL_DEPS "$PKG_DIR" \
> "$BUILDALL_DIR"/"${PKG}".out 2> "$BUILDALL_DIR"/"${PKG}".err
BUILD_END=$(date "+%s")

View File

@ -278,7 +278,7 @@ while getopts :a:hdDfiIqso: option; do
fi
;;
h) _show_usage;;
d) export TERMUX_DEBUG=true;;
d) export TERMUX_DEBUG_BUILD=true;;
D) TERMUX_IS_DISABLED=true;;
f) TERMUX_FORCE_BUILD=true;;
i)
@ -337,7 +337,7 @@ while (($# > 0)); do
for arch in 'aarch64' 'arm' 'i686' 'x86_64'; do
env TERMUX_ARCH="$arch" TERMUX_BUILD_IGNORE_LOCK=true ./build-package.sh \
${TERMUX_FORCE_BUILD+-f} ${TERMUX_INSTALL_DEPS+-i} ${TERMUX_IS_DISABLED+-D} \
${TERMUX_DEBUG+-d} ${TERMUX_DEBDIR+-o $TERMUX_DEBDIR} "$1"
${TERMUX_DEBUG_BUILD+-d} ${TERMUX_DEBDIR+-o $TERMUX_DEBDIR} "$1"
done
exit
fi

View File

@ -39,7 +39,7 @@ termux_step_configure() {
}
termux_step_post_make_install() {
if $TERMUX_DEBUG; then
if $TERMUX_DEBUG_BUILD; then
install -Dm700 busybox_unstripped $PREFIX/bin/busybox
fi

View File

@ -30,7 +30,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--with-dumping=none
"
if $TERMUX_DEBUG; then
if $TERMUX_DEBUG_BUILD; then
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="
--enable-checking=yes,glyphs
--enable-check-lisp-object-type

View File

@ -26,7 +26,7 @@ mutt_cv_c99_vsnprintf=yes
--with-ssl
"
if $TERMUX_DEBUG; then
if $TERMUX_DEBUG_BUILD; then
export TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="--enable-debug"
fi

View File

@ -35,7 +35,7 @@ termux_step_pre_configure() {
termux_step_configure() {
DEBUG_FLAG=""
$TERMUX_DEBUG && DEBUG_FLAG="--with-debug"
$TERMUX_DEBUG_BUILD && DEBUG_FLAG="--with-debug"
./configure \
--prefix=$TERMUX_PREFIX \

View File

@ -2,7 +2,7 @@ termux_step_configure_cmake() {
termux_setup_cmake
local BUILD_TYPE=Release
[ "$TERMUX_DEBUG" = "true" ] && BUILD_TYPE=Debug
[ "$TERMUX_DEBUG_BUILD" = "true" ] && BUILD_TYPE=Debug
local CMAKE_PROC=$TERMUX_ARCH
test $CMAKE_PROC == "arm" && CMAKE_PROC='armv7-a'

View File

@ -18,7 +18,7 @@ termux_step_massage() {
# Remove world permissions and make sure that user still have read-write permissions.
chmod -Rf u+rw,g-rwx,o-rwx . || true
if [ "$TERMUX_DEBUG" = "false" ]; then
if [ "$TERMUX_DEBUG_BUILD" = "false" ]; then
# Strip binaries. file(1) may fail for certain unusual files, so disable pipefail.
set +e +o pipefail
find . \( -path "./bin/*" -o -path "./lib/*" -o -path "./libexec/*" \) -type f | \

View File

@ -3,7 +3,7 @@ termux_step_patch_package() {
cd "$TERMUX_PKG_SRCDIR"
local DEBUG_PATCHES=""
if [ "$TERMUX_DEBUG" = "true" ]; then
if [ "$TERMUX_DEBUG_BUILD" = "true" ]; then
DEBUG_PATCHES=$(find $TERMUX_PKG_BUILDER_DIR -mindepth 1 -maxdepth 1 -name \*.patch.debug)
fi
if [ "$TERMUX_PKG_QUICK_REBUILD" = "false" ]; then

View File

@ -69,7 +69,7 @@ termux_step_setup_toolchain() {
CFLAGS+=" -fstack-protector-strong"
LDFLAGS+=" -Wl,-z,relro,-z,now"
if [ "$TERMUX_DEBUG" = "true" ]; then
if [ "$TERMUX_DEBUG_BUILD" = "true" ]; then
CFLAGS+=" -g3 -O1"
CPPFLAGS+=" -D_FORTIFY_SOURCE=2 -D__USE_FORTIFY_LEVEL=2"
else

View File

@ -1,7 +1,7 @@
termux_step_setup_variables() {
: "${TERMUX_ARCH:="aarch64"}" # arm, aarch64, i686 or x86_64.
: "${TERMUX_DEBDIR:="${TERMUX_SCRIPTDIR}/debs"}"
: "${TERMUX_DEBUG:="false"}"
: "${TERMUX_DEBUG_BUILD:="false"}"
: "${TERMUX_FORCE_BUILD:="false"}"
: "${TERMUX_INSTALL_DEPS:="false"}"
: "${TERMUX_MAKE_PROCESSES:="$(nproc)"}"

View File

@ -24,7 +24,7 @@ termux_step_start_build() {
TERMUX_PKG_FULLVERSION+="-$TERMUX_PKG_REVISION"
fi
if [ "$TERMUX_DEBUG" = "true" ]; then
if [ "$TERMUX_DEBUG_BUILD" = "true" ]; then
if [ "$TERMUX_PKG_HAS_DEBUG" = "true" ]; then
DEBUG="-dbg"
else
@ -35,7 +35,7 @@ termux_step_start_build() {
DEBUG=""
fi
if [ "$TERMUX_DEBUG" = "false" ] && [ "$TERMUX_FORCE_BUILD" = "false" ]; then
if [ "$TERMUX_DEBUG_BUILD" = "false" ] && [ "$TERMUX_FORCE_BUILD" = "false" ]; then
if [ -e "$TERMUX_BUILT_PACKAGES_DIRECTORY/$TERMUX_PKG_NAME" ] &&
[ "$(cat "$TERMUX_BUILT_PACKAGES_DIRECTORY/$TERMUX_PKG_NAME")" = "$TERMUX_PKG_FULLVERSION" ]; then
echo "$TERMUX_PKG_NAME@$TERMUX_PKG_FULLVERSION built - skipping (rm $TERMUX_BUILT_PACKAGES_DIRECTORY/$TERMUX_PKG_NAME to force rebuild)"

View File

@ -80,7 +80,7 @@ for p in "$TERMUX_SCRIPTDIR"/packages/*; do
TERMUX_ARCH_BITS=64
TERMUX_BUILD_TUPLE=x86_64-pc-linux-gnu
TERMUX_PKG_GIT_BRANCH=""
TERMUX_DEBUG=false
TERMUX_DEBUG_BUILD=false
TERMUX_MAKE_PROCESSES=1
mkdir -p "$TERMUX_PKG_CACHEDIR" "$TERMUX_PKG_TMPDIR" "$TERMUX_PKG_SRCDIR"