setup-offline-bundle.sh: add support for downloading package sources
This commit is contained in:
parent
468ae7cc1e
commit
195314fe20
16
.gitignore
vendored
16
.gitignore
vendored
@ -1,12 +1,20 @@
|
|||||||
### Vim ###
|
# Vim
|
||||||
[._]*.s[a-w][a-z]
|
[._]*.s[a-w][a-z]
|
||||||
[._]s[a-w][a-z]
|
[._]s[a-w][a-z]
|
||||||
*.un~
|
*.un~
|
||||||
Session.vim
|
Session.vim
|
||||||
.netrwhist
|
.netrwhist
|
||||||
*~
|
*~
|
||||||
/build-tools/
|
|
||||||
/debs/
|
# Vagrant
|
||||||
### Vagrant ###
|
|
||||||
scripts/*.log
|
scripts/*.log
|
||||||
scripts/.vagrant/
|
scripts/.vagrant/
|
||||||
|
|
||||||
|
# Built *.deb files.
|
||||||
|
/debs/
|
||||||
|
|
||||||
|
# Preinstalled build tools.
|
||||||
|
/build-tools/
|
||||||
|
|
||||||
|
# Predownloaded packages sources.
|
||||||
|
/packages/*/cache
|
||||||
|
@ -96,8 +96,14 @@ termux_step_setup_variables() {
|
|||||||
export prefix=${TERMUX_PREFIX}
|
export prefix=${TERMUX_PREFIX}
|
||||||
export PREFIX=${TERMUX_PREFIX}
|
export PREFIX=${TERMUX_PREFIX}
|
||||||
|
|
||||||
|
if [ "${TERMUX_PACKAGES_OFFLINE-false}" = "true" ]; then
|
||||||
|
# In "offline" mode store/pick cache from directory with
|
||||||
|
# build.sh script.
|
||||||
|
TERMUX_PKG_CACHEDIR=$TERMUX_PKG_BUILDER_DIR/cache
|
||||||
|
else
|
||||||
|
TERMUX_PKG_CACHEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/cache
|
||||||
|
fi
|
||||||
TERMUX_PKG_BUILDDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/build
|
TERMUX_PKG_BUILDDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/build
|
||||||
TERMUX_PKG_CACHEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/cache
|
|
||||||
TERMUX_PKG_MASSAGEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/massage
|
TERMUX_PKG_MASSAGEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/massage
|
||||||
TERMUX_PKG_PACKAGEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/package
|
TERMUX_PKG_PACKAGEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/package
|
||||||
TERMUX_PKG_SRCDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/src
|
TERMUX_PKG_SRCDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/src
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
##
|
##
|
||||||
## Download and install all build tools whether applicable now, so
|
## Download all package sources and install all build tools whether possible,
|
||||||
## they will be available later for offline use.
|
## so they will be available offline.
|
||||||
##
|
##
|
||||||
|
|
||||||
set -e -u
|
set -e -u
|
||||||
@ -23,6 +23,7 @@ export CC=gcc CXX=g++ LD=ld AR=ar STRIP=strip PKG_CONFIG=pkg-config
|
|||||||
export CPPFLAGS="" CFLAGS="" CXXFLAGS="" LDFLAGS=""
|
export CPPFLAGS="" CFLAGS="" CXXFLAGS="" LDFLAGS=""
|
||||||
mkdir -p "$TERMUX_PKG_TMPDIR"
|
mkdir -p "$TERMUX_PKG_TMPDIR"
|
||||||
|
|
||||||
|
# Build tools.
|
||||||
. "$TERMUX_SCRIPTDIR"/scripts/build/termux_download.sh
|
. "$TERMUX_SCRIPTDIR"/scripts/build/termux_download.sh
|
||||||
(. "$TERMUX_SCRIPTDIR"/scripts/build/setup/termux_setup_cmake.sh
|
(. "$TERMUX_SCRIPTDIR"/scripts/build/setup/termux_setup_cmake.sh
|
||||||
termux_setup_cmake
|
termux_setup_cmake
|
||||||
@ -47,3 +48,41 @@ mkdir -p "$TERMUX_PKG_TMPDIR"
|
|||||||
# termux_setup_rust
|
# termux_setup_rust
|
||||||
#)
|
#)
|
||||||
rm -rf "${TERMUX_PKG_TMPDIR}"
|
rm -rf "${TERMUX_PKG_TMPDIR}"
|
||||||
|
(test -d "$TERMUX_SCRIPTDIR"/build-tools/android-sdk && test -d "$TERMUX_SCRIPTDIR"/build-tools/android-ndk && exit 0
|
||||||
|
"$TERMUX_SCRIPTDIR"/scripts/setup-android-sdk.sh
|
||||||
|
)
|
||||||
|
|
||||||
|
# Package sources.
|
||||||
|
for p in "$TERMUX_SCRIPTDIR"/packages/*; do
|
||||||
|
(
|
||||||
|
. "$TERMUX_SCRIPTDIR"/scripts/properties.sh
|
||||||
|
. "$TERMUX_SCRIPTDIR"/scripts/build/get_source/termux_step_get_source.sh
|
||||||
|
. "$TERMUX_SCRIPTDIR"/scripts/build/get_source/termux_git_clone_src.sh
|
||||||
|
. "$TERMUX_SCRIPTDIR"/scripts/build/get_source/termux_download_src_archive.sh
|
||||||
|
. "$TERMUX_SCRIPTDIR"/scripts/build/get_source/termux_unpack_src_archive.sh
|
||||||
|
|
||||||
|
TERMUX_PKG_NAME=$(basename "$p")
|
||||||
|
TERMUX_PKG_CACHEDIR="${p}/cache"
|
||||||
|
TERMUX_PKG_METAPACKAGE=false
|
||||||
|
|
||||||
|
# Set some variables to dummy values to avoid errors.
|
||||||
|
TERMUX_PKG_TMPDIR="${TERMUX_PKG_CACHEDIR}/.tmp"
|
||||||
|
TERMUX_PKG_SRCDIR="${TERMUX_PKG_CACHEDIR}/.src"
|
||||||
|
TERMUX_PREFIX=/data/data/com.termux/files/usr
|
||||||
|
TERMUX_ANDROID_HOME=/data/data/com.termux/files/home
|
||||||
|
TERMUX_HOST_PLATFORM=aarch64-linux-android
|
||||||
|
TERMUX_ARCH_BITS=64
|
||||||
|
|
||||||
|
mkdir -p "$TERMUX_PKG_CACHEDIR" "$TERMUX_PKG_TMPDIR" "$TERMUX_PKG_SRCDIR"
|
||||||
|
cd "$TERMUX_PKG_CACHEDIR"
|
||||||
|
|
||||||
|
. "${p}"/build.sh
|
||||||
|
${TERMUX_PKG_METAPACKAGE} && continue
|
||||||
|
|
||||||
|
echo "Downloading sources for '$TERMUX_PKG_NAME'..."
|
||||||
|
termux_step_get_source
|
||||||
|
|
||||||
|
# Delete dummy src and tmp directories.
|
||||||
|
rm -rf "$TERMUX_PKG_TMPDIR" "$TERMUX_PKG_SRCDIR"
|
||||||
|
)
|
||||||
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user