2021-08-24 08:22:54 +02:00
|
|
|
termux_step_setup_build_folders() {
|
2021-09-03 17:56:57 +02:00
|
|
|
# Following directories may contain files with read-only
|
|
|
|
# permissions which makes them undeletable. We need to fix
|
|
|
|
# that.
|
2021-08-24 08:22:54 +02:00
|
|
|
[ -d "$TERMUX_PKG_BUILDDIR" ] && chmod +w -R "$TERMUX_PKG_BUILDDIR"
|
|
|
|
[ -d "$TERMUX_PKG_SRCDIR" ] && chmod +w -R "$TERMUX_PKG_SRCDIR"
|
2021-09-03 17:56:57 +02:00
|
|
|
if [ "$TERMUX_SKIP_DEPCHECK" = false ] && \
|
|
|
|
[ "$TERMUX_INSTALL_DEPS" = true ] && \
|
|
|
|
[ "$TERMUX_PKG_METAPACKAGE" = false ] && \
|
|
|
|
[ "$TERMUX_NO_CLEAN" = false ] && \
|
|
|
|
[ "$TERMUX_ON_DEVICE_BUILD" = false ]; then
|
|
|
|
# Remove all previously extracted/built files from
|
|
|
|
# $TERMUX_PREFIX:
|
|
|
|
rm -rf $TERMUX_PREFIX
|
|
|
|
rm -f $TERMUX_BUILT_PACKAGES_DIRECTORY/*
|
|
|
|
fi
|
2021-08-24 08:22:54 +02:00
|
|
|
|
|
|
|
# Cleanup old build state:
|
|
|
|
rm -Rf "$TERMUX_PKG_BUILDDIR" \
|
|
|
|
"$TERMUX_PKG_SRCDIR"
|
|
|
|
|
|
|
|
# Cleanup old packaging state:
|
|
|
|
rm -Rf "$TERMUX_PKG_PACKAGEDIR" \
|
|
|
|
"$TERMUX_PKG_TMPDIR" \
|
|
|
|
"$TERMUX_PKG_MASSAGEDIR"
|
|
|
|
|
2021-09-03 17:56:57 +02:00
|
|
|
# Ensure folders present (but not $TERMUX_PKG_SRCDIR, it will
|
|
|
|
# be created in build)
|
2021-08-24 08:22:54 +02:00
|
|
|
mkdir -p "$TERMUX_COMMON_CACHEDIR" \
|
2021-09-03 17:56:57 +02:00
|
|
|
"$TERMUX_COMMON_CACHEDIR-$TERMUX_ARCH" \
|
2021-08-25 22:38:00 +02:00
|
|
|
"$TERMUX_COMMON_CACHEDIR-all" \
|
2021-09-10 18:10:02 +02:00
|
|
|
"$TERMUX_OUTPUT_DIR" \
|
2021-08-24 08:22:54 +02:00
|
|
|
"$TERMUX_PKG_BUILDDIR" \
|
|
|
|
"$TERMUX_PKG_PACKAGEDIR" \
|
|
|
|
"$TERMUX_PKG_TMPDIR" \
|
|
|
|
"$TERMUX_PKG_CACHEDIR" \
|
|
|
|
"$TERMUX_PKG_MASSAGEDIR" \
|
|
|
|
$TERMUX_PREFIX/{bin,etc,lib,libexec,share,share/LICENSES,tmp,include}
|
|
|
|
}
|