Browse Source

build-package.sh: for on-device builds termux-elf-cleaner should be installed with apt

It throws compilation errors when being built without custom elf.h on
devices using API 21 repository.
android-5
Leonid Plyushch 6 years ago
parent
commit
abca76df18
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 9
      scripts/build/termux_step_start_build.sh
  2. 1
      scripts/setup-termux.sh

9
scripts/build/termux_step_start_build.sh

@ -124,9 +124,10 @@ termux_step_start_build() {
"$TERMUX_PKG_MASSAGEDIR" \
$TERMUX_PREFIX/{bin,etc,lib,libexec,share,share/LICENSES,tmp,include}
if [ -z "$TERMUX_ON_DEVICE_BUILD" ]; then
# Make $TERMUX_PREFIX/bin/sh executable on the builder, so that build
# scripts can assume that it works on both builder and host later on:
[ -z "$TERMUX_ON_DEVICE_BUILD" ] && ln -sf /bin/sh "$TERMUX_PREFIX/bin/sh"
ln -sf /bin/sh "$TERMUX_PREFIX/bin/sh"
local TERMUX_ELF_CLEANER_SRC=$TERMUX_COMMON_CACHEDIR/termux-elf-cleaner.cpp
local TERMUX_ELF_CLEANER_VERSION
@ -139,6 +140,12 @@ termux_step_start_build() {
g++ -std=c++11 -Wall -Wextra -pedantic -Os -D__ANDROID_API__=$TERMUX_PKG_API_LEVEL \
"$TERMUX_ELF_CLEANER_SRC" -o "$TERMUX_ELF_CLEANER"
fi
else
# Ensure that termux-elf-cleaner is always installed.
if [ "$(dpkg-query -W -f '${db:Status-Status}\n' termux-elf-cleaner 2>/dev/null)" != "installed" ]; then
apt update && apt install -y termux-elf-cleaner
fi
fi
if [ -n "$TERMUX_PKG_BUILD_IN_SRC" ]; then
echo "Building in src due to TERMUX_PKG_BUILD_IN_SRC being set" > "$TERMUX_PKG_BUILDDIR/BUILDING_IN_SRC.txt"

1
scripts/setup-termux.sh

@ -36,6 +36,7 @@ PACKAGES+=" python2"
PACKAGES+=" rust"
PACKAGES+=" sed"
PACKAGES+=" tar"
PACKAGES+=" termux-elf-cleaner"
PACKAGES+=" texinfo"
PACKAGES+=" unzip"
PACKAGES+=" xz-utils"

Loading…
Cancel
Save