Browse Source

build-package.sh: better support for metapackages

android-5
Leonid Plyushch 6 years ago
parent
commit
f784bb4de0
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 2
      scripts/build/configure/termux_step_configure.sh
  2. 2
      scripts/build/termux_step_create_datatar.sh
  3. 2
      scripts/build/termux_step_extract_package.sh
  4. 3
      scripts/build/termux_step_handle_hostbuild.sh
  5. 2
      scripts/build/termux_step_install_license.sh
  6. 2
      scripts/build/termux_step_make.sh
  7. 2
      scripts/build/termux_step_make_install.sh
  8. 2
      scripts/build/termux_step_massage.sh
  9. 2
      scripts/build/termux_step_patch_package.sh
  10. 2
      scripts/build/termux_step_replace_guess_scripts.sh
  11. 2
      scripts/build/termux_step_setup_toolchain.sh
  12. 1
      scripts/build/termux_step_setup_variables.sh
  13. 10
      scripts/build/termux_step_start_build.sh

2
scripts/build/configure/termux_step_configure.sh

@ -1,4 +1,6 @@
termux_step_configure() {
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
if [ "$TERMUX_PKG_FORCE_CMAKE" = "false" ] && [ -f "$TERMUX_PKG_SRCDIR/configure" ]; then
termux_step_configure_autotools
elif [ -f "$TERMUX_PKG_SRCDIR/CMakeLists.txt" ]; then

2
scripts/build/termux_step_create_datatar.sh

@ -8,7 +8,7 @@ termux_step_create_datatar() {
termux_error_exit "Package contains hard links: $HARDLINKS"
fi
if [ "${TERMUX_PKG_METAPACKAGE-false}" = "true" ]; then
if [ "$TERMUX_PKG_METAPACKAGE" = "true" ]; then
# Metapackage doesn't have data inside.
rm -rf data
else

2
scripts/build/termux_step_extract_package.sh

@ -1,5 +1,5 @@
termux_step_extract_package() {
if [ -z "${TERMUX_PKG_SRCURL:=""}" ] || [ "${TERMUX_PKG_SKIP_SRC_EXTRACT-false}" = "true" ]; then
if [ -z "${TERMUX_PKG_SRCURL:=""}" ] || [ "${TERMUX_PKG_SKIP_SRC_EXTRACT-false}" = "true" ] || [ "$TERMUX_PKG_METAPACKAGE" = "true" ]; then
mkdir -p "$TERMUX_PKG_SRCDIR"
return
fi

3
scripts/build/termux_step_handle_hostbuild.sh

@ -1,5 +1,6 @@
termux_step_handle_hostbuild() {
if [ "$TERMUX_PKG_HOSTBUILD" = "false" ]; then return; fi
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
[ "$TERMUX_PKG_HOSTBUILD" = "false" ] && return
cd "$TERMUX_PKG_SRCDIR"
for patch in $TERMUX_PKG_BUILDER_DIR/*.patch.beforehostbuild; do

2
scripts/build/termux_step_install_license.sh

@ -1,4 +1,6 @@
termux_step_install_license() {
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
mkdir -p "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME"
if [ ! "${TERMUX_PKG_LICENSE_FILE}" = "" ]; then

2
scripts/build/termux_step_make.sh

@ -1,4 +1,6 @@
termux_step_make() {
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
local QUIET_BUILD=
if [ "$TERMUX_QUIET_BUILD" = true ]; then
QUIET_BUILD="-s"

2
scripts/build/termux_step_make_install.sh

@ -1,4 +1,6 @@
termux_step_make_install() {
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
if test -f build.ninja; then
ninja -w dupbuild=warn -j $TERMUX_MAKE_PROCESSES install
elif ls ./*akefile &> /dev/null || [ -n "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then

2
scripts/build/termux_step_massage.sh

@ -1,4 +1,6 @@
termux_step_massage() {
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
cd "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX"
# Remove lib/charset.alias which is installed by gettext-using packages:

2
scripts/build/termux_step_patch_package.sh

@ -1,4 +1,6 @@
termux_step_patch_package() {
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
cd "$TERMUX_PKG_SRCDIR"
local DEBUG_PATCHES=""
if [ "$TERMUX_DEBUG" = "true" ]; then

2
scripts/build/termux_step_replace_guess_scripts.sh

@ -1,4 +1,6 @@
termux_step_replace_guess_scripts() {
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
cd "$TERMUX_PKG_SRCDIR"
find . -name config.sub -exec chmod u+w '{}' \; -exec cp "$TERMUX_SCRIPTDIR/scripts/config.sub" '{}' \;
find . -name config.guess -exec chmod u+w '{}' \; -exec cp "$TERMUX_SCRIPTDIR/scripts/config.guess" '{}' \;

2
scripts/build/termux_step_setup_toolchain.sh

@ -1,4 +1,6 @@
termux_step_setup_toolchain() {
[ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return
export CFLAGS=""
export LDFLAGS="-L${TERMUX_PREFIX}/lib"

1
scripts/build/termux_step_setup_variables.sh

@ -136,6 +136,7 @@ termux_step_setup_variables() {
TERMUX_PKG_FORCE_CMAKE=false # if the package has autotools as well as cmake, then set this to prefer cmake
TERMUX_CMAKE_BUILD=Ninja # Which cmake generator to use
TERMUX_PKG_HAS_DEBUG=true # set to false if debug build doesn't exist or doesn't work, for example for python based packages
TERMUX_PKG_METAPACKAGE=false
unset CFLAGS CPPFLAGS LDFLAGS CXXFLAGS
}

10
scripts/build/termux_step_start_build.sh

@ -2,6 +2,12 @@ termux_step_start_build() {
# shellcheck source=/dev/null
source "$TERMUX_PKG_BUILDER_SCRIPT"
if [ "$TERMUX_PKG_METAPACKAGE" = "true" ]; then
# Metapackage has no sources and therefore platform-independent.
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
fi
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_COMMON_CACHEDIR/android5-r${TERMUX_NDK_VERSION}-api-${TERMUX_PKG_API_LEVEL}"
# Bump the below version if a change is made in toolchain setup to ensure
@ -42,7 +48,7 @@ termux_step_start_build() {
fi
fi
if [ "$TERMUX_SKIP_DEPCHECK" = false ] && [ "$TERMUX_INSTALL_DEPS" = true ]; then
if [ "$TERMUX_SKIP_DEPCHECK" = false ] && [ "$TERMUX_INSTALL_DEPS" = true ] && [ "$TERMUX_PKG_METAPACKAGE" = "false" ]; then
# Download repo files
termux_get_repo_files
@ -88,7 +94,7 @@ termux_step_start_build() {
mkdir -p $TERMUX_BUILT_PACKAGES_DIRECTORY
echo "$DEP_VERSION" > "$TERMUX_BUILT_PACKAGES_DIRECTORY/$PKG"
done<<<$(./scripts/buildorder.py -i "$TERMUX_PKG_BUILDER_DIR" $TERMUX_PACKAGES_DIRECTORIES || echo "ERROR")
elif [ "$TERMUX_SKIP_DEPCHECK" = false ] && [ "$TERMUX_INSTALL_DEPS" = false ]; then
elif [ "$TERMUX_SKIP_DEPCHECK" = false ] && [ "$TERMUX_INSTALL_DEPS" = false ] && [ "$TERMUX_PKG_METAPACKAGE" = "false" ]; then
# Build dependencies
while read PKG PKG_DIR; do
if [ -z $PKG ]; then

Loading…
Cancel
Save