Skip to content

Commit a1a0bc5

Browse files
committed
addpkg(main/awscli): 2.32.28
1 parent 7f82fb2 commit a1a0bc5

1 file changed

Lines changed: 93 additions & 0 deletions

File tree

packages/awscli/build.sh

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
TERMUX_PKG_HOMEPAGE=https://aws.amazon.com/cli
2+
TERMUX_PKG_DESCRIPTION="Universal Command Line Interface for Amazon Web Services"
3+
TERMUX_PKG_LICENSE="Apache-2.0"
4+
TERMUX_PKG_MAINTAINER="@termux"
5+
TERMUX_PKG_VERSION="2.32.28"
6+
TERMUX_PKG_SRCURL="https://github.com/aws/aws-cli/archive/refs/tags/$TERMUX_PKG_VERSION.tar.gz"
7+
TERMUX_PKG_SHA256=85ecd5baf4d5cdf4d9e436dd76e023d0126cdcd0e5cbf97a5cd15b33f8829b05
8+
TERMUX_PKG_AUTO_UPDATE=true
9+
TERMUX_PKG_UPDATE_VERSION_REGEXP="\d+.\d+.\d+"
10+
TERMUX_PKG_DEPENDS="libffi, libsqlite"
11+
TERMUX_PKG_RECOMMENDS="groff"
12+
TERMUX_PKG_BUILD_DEPENDS="aosp-libs, python-pip, cmake, ldd"
13+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
14+
--with-install-type=portable-exe
15+
--with-download-deps
16+
PYTHON=$TERMUX_PREFIX/bin/python
17+
"
18+
19+
termux_step_pre_configure() {
20+
export LDFLAGS+=" -lm"
21+
export PIP_NO_BINARY=awscrt
22+
export AWS_CRT_BUILD_FORCE_STATIC_LIBS=1
23+
24+
if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
25+
return
26+
fi
27+
28+
local PYTHON_INCLUDE="$TERMUX_PREFIX/include/python$TERMUX_PYTHON_VERSION"
29+
30+
TERMUX_PROOT_EXTRA_ENV_VARS=" \
31+
LD_PRELOAD= LD_LIBRARY_PATH= \
32+
PIP_NO_BINARY=$PIP_NO_BINARY \
33+
AWS_CRT_BUILD_FORCE_STATIC_LIBS=$AWS_CRT_BUILD_FORCE_STATIC_LIBS \
34+
PIP_NO_INDEX=1 \
35+
CC=$CC \
36+
CXX=$CXX \
37+
AR=$AR \
38+
RANLIB=$RANLIB \
39+
CFLAGS='$CFLAGS -I$PYTHON_INCLUDE' \
40+
CPPFLAGS='$CPPFLAGS -I$PYTHON_INCLUDE' \
41+
CXXFLAGS='$CXXFLAGS' \
42+
LDFLAGS='$LDFLAGS' \
43+
"
44+
}
45+
46+
termux_step_configure() {
47+
if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
48+
termux_step_configure_autotools
49+
return
50+
fi
51+
52+
termux_setup_proot
53+
54+
termux-proot-run "$TERMUX_PKG_SRCDIR/configure" \
55+
--prefix="$TERMUX_PREFIX" \
56+
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS
57+
}
58+
59+
termux_step_make() {
60+
if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
61+
make
62+
return
63+
fi
64+
65+
local WHEELHOUSE="$TERMUX_PKG_BUILDDIR/wheelhouse"
66+
mkdir -p "$WHEELHOUSE"
67+
68+
python3 -m pip download \
69+
--dest "$WHEELHOUSE" \
70+
--platform "linux_$TERMUX_ARCH" \
71+
--python-version "$TERMUX_PYTHON_VERSION" \
72+
--implementation cp \
73+
--abi cp"${TERMUX_PYTHON_VERSION//.}" \
74+
--abi abi3 \
75+
--abi none \
76+
--no-deps \
77+
-r "$TERMUX_PKG_SRCDIR/requirements/download-deps/bootstrap-lock.txt" \
78+
-r "$TERMUX_PKG_SRCDIR/requirements/download-deps/portable-exe-lock.txt"
79+
80+
termux-proot-run \
81+
-b "$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/android:$TERMUX__PREFIX__INCLUDE_DIR/android" \
82+
env PIP_FIND_LINKS="file://$WHEELHOUSE" \
83+
make
84+
}
85+
86+
termux_step_make_install() {
87+
if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
88+
make install
89+
return
90+
fi
91+
92+
termux-proot-run make install
93+
}

0 commit comments

Comments
 (0)