Skip to content

addpkg(main/awscli): 2.32.28#28092

Merged
robertkirkman merged 1 commit intotermux:masterfrom
Kapral67:main
Jan 21, 2026
Merged

addpkg(main/awscli): 2.32.28#28092
robertkirkman merged 1 commit intotermux:masterfrom
Kapral67:main

Conversation

@Kapral67
Copy link
Contributor

Issue #23129

tested on x86_64 + aarch64

Copy link
Member

@TomJo2000 TomJo2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This build script does, a lot...
And I feel like most of it is gonna need more elaboration.
What makes this package so troublesome?

@TomJo2000
Copy link
Member

I'm gonna tag in @robertkirkman for some additional Python and proot expertise on this because I feel like a lot of what this build is doing is going over my head.

@robertkirkman
Copy link
Member

robertkirkman commented Jan 19, 2026

@Kapral67 could you describe what went wrong when you last tried to add this to TUR-on-device?

you mentioned: "Every workflow seems to fail with an error that I am unable to reproduce locally"

were the errors not reproducible when you were using only Termux App locally, or were they also not reproducible when using termux-docker locally?

If you try opening the PR to TUR-on-device again, does it still fail, and can you use that to show me what error occurred?

I have a PR open which can cause the behavior of termux-docker to be closer to the behavior of Termux App. I am wondering if that might help you, or not.

@Kapral67
Copy link
Contributor Author

Kapral67 commented Jan 19, 2026

@Kapral67 could you describe what went wrong when you last tried to add this to TUR-on-device?

* [new package(tur-on-device): awscli termux-user-repository/tur#863](https://github.com/termux-user-repository/tur/pull/863)

you mentioned: "Every workflow seems to fail with an error that I am unable to reproduce locally"

were the errors not reproducible when you were using only Termux App locally, or were they also not reproducible when using termux-docker locally?

If you try opening the PR to TUR-on-device again, does it still fail, and can you use that to show me what error occurred?

I have a PR open which can cause the behavior of termux-docker to be closer to the behavior of Termux App. I am wondering if that might help you, or not.

previously I tried to use cross-pip to cross compile this but pyinstaller needs to run in an environment more closely mimic the target system otherwise it gets a incorrect closure

this pr uses a new strategy with proot

@TomJo2000
Copy link
Member

Please make sure to use a git rebase to update your PR.
Our CI does not handle merge commits will and throw a warning about them.

@robertkirkman
Copy link
Member

previously I tried to use cross-pip to cross compile this but pyinstaller needs to run in an environment more closely mimic the target system otherwise it gets a incorrect closure

this pr uses a new strategy with proot

but TUR-on-device does not require cross-pip, cross-compilation, or proot, as you remember.

I have an impression that if the TUR-on-device build you tried could be fixed, it would be significantly more easily maintainable than the version in this PR.

TERMUX_PKG_GIT_BRANCH="$TERMUX_PKG_VERSION"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="libffi, libsqlite, groff"
TERMUX_PKG_BUILD_DEPENDS="aosp-libs, python, python-pip, clang, make, cmake, binutils, ndk-sysroot, ldd"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ndk-sysroot in TERMUX_PKG_BUILD_DEPENDS has no effect, and that is why you had to use NDK_SYSROOT="$TERMUX_STANDALONE_TOOLCHAIN/sysroot" and mount it inside proot, so if you want to continue with this version, I think you can remove ndk-sysroot from TERMUX_PKG_BUILD_DEPENDS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it still be needed in case for on-device builds?

Copy link
Member

@robertkirkman robertkirkman Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because:

  • clang depends on ndk-sysroot so it will always be installed when clang is installed (in the case of on-device builds)
  • Additionally, clang is already in scripts/setup-termux.sh, so clang does not need to be in TERMUX_PKG_BUILD_DEPENDS for the case of on-device building either.
  • (however, if you do use /data/data/com.termux/files/usr/bin/clang during the build in the Ubuntu container, then clang does need to stay in TERMUX_PKG_BUILD_DEPENDS in that case)

Also, I wanted to ask,

do you think it's absolutely necessary for you to use the /data/data/com.termux/files/usr/bin/clang during the build in the Ubuntu container?

There is a way to get script operations to run within proot, but still use the compiler /home/builder/.termux-build/_cache/android-r29-api-24-v3/bin/aarch64-linux-android-clang instead of /data/data/com.termux/files/usr/bin/clang.

I did that here, for one example:

# build SBCL inside a proot that runs bionic-libc $TERMUX_PREFIX/bin/uname,
# some other bionic-libc commands, and bionic-libc build artifacts,
# but runs the host cross-compiler and the host sbcl binary to compile
# bootstrapping lisp code and compile the C-based runtime code.
termux-proot-run env LD_PRELOAD= LD_LIBRARY_PATH= \
CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LINKFLAGS="$LDFLAGS" \
sh make.sh \
--xc-host="${TERMUX_PKG_HOSTBUILD_DIR}/bin/sbcl --norc" \

if you manage to do that, it should speed up the build, because of the compiler not having to run inside QEMU, and also, it would remove the requirement for having /data/data/com.termux/files/usr/bin/clang installed during build.

have you tried that yet in this, of if you did, did you encounter a problem with that?

@Kapral67
Copy link
Contributor Author

this one termux/termux-docker#72 ? I think it would help, I can try tur again

set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(CMAKE_SYSROOT "$NDK_SYSROOT")
set(CMAKE_C_COMPILER "$_PROOT_CC")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see you do appear to specify /home/builder/.termux-build/_cache/android-r29-api-24-v3/bin/aarch64-linux-android-clang, here. So, what goes wrong if /data/data/com.termux/files/usr/bin/clang is removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean, removed from where?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you remove clang from TERMUX_PKG_BUILD_DEPENDS, what goes wrong?

@robertkirkman
Copy link
Member

this one termux/termux-docker#72 ? I think it would help, I can try tur again

Yes, that's my PR which can cause termux-docker to have closer behavior to Termux App.

However, it's not merged yet, so it's not affecting TUR-on-device or anything else currently,

But I would be interested, yes, if you could try TUR-on-device again, and check what the error you had was, and if it's still happening, then I can check if it's reproducible by locally running the current official termux-docker, and if it's still reproducible there, then I can check if it's still reproducible if using my PR version of termux-docker.

@Kapral67
Copy link
Contributor Author

Seems that tur works except arm, not sure why
termux-user-repository/tur#2183

@Kapral67 Kapral67 force-pushed the main branch 2 times, most recently from 992fe8e to c97cf34 Compare January 20, 2026 05:38
CXXFLAGS='$CXXFLAGS $SYSROOT_FLAG' CPPFLAGS='$CPPFLAGS -I$PYTHON_INCLUDE' \
LDFLAGS='$LDFLAGS $SYSROOT_FLAG -L$NDK_LIB -L$CLANG_LIB -L$TERMUX_PREFIX/lib'"

ln -s "$NDK_SYSROOT/usr/include/android" "$TERMUX__PREFIX__INCLUDE_DIR/android"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! you improved this version, I think, by removing unnecessary things.

However, is this line also needed? What error happens if you remove this line? I wondered because: this line causes this unusual file to appear in the .deb file when it finishes building:

Image

Also, there might be other things not needed, like possibly CLANG_LIB and SYSROOT_FLAG, but I thought to ask about this line first.

Copy link
Contributor Author

@Kapral67 Kapral67 Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is after removing the soft link

  Building wheel for awscrt (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for awscrt (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [224 lines of output]
      /home/builder/.termux-build/awscli/build/build/venv/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
      !!
      
              ********************************************************************************
              Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).
      
              By 2026-Feb-18, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        corresp(dist, value, root_dir)
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/__init__.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/_test.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/auth.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/cbor.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/checksums.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/common.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/crypto.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/exceptions.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/http.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/io.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/mqtt.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/mqtt5.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/mqtt_request_response.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/s3.py -> build/lib.linux-x86_64-cpython-312/awscrt
      copying awscrt/websocket.py -> build/lib.linux-x86_64-cpython-312/awscrt
      creating build/lib.linux-x86_64-cpython-312/awscrt/aio
      copying awscrt/aio/__init__.py -> build/lib.linux-x86_64-cpython-312/awscrt/aio
      copying awscrt/aio/http.py -> build/lib.linux-x86_64-cpython-312/awscrt/aio
      creating build/lib.linux-x86_64-cpython-312/awscrt/eventstream
      copying awscrt/eventstream/__init__.py -> build/lib.linux-x86_64-cpython-312/awscrt/eventstream
      copying awscrt/eventstream/rpc.py -> build/lib.linux-x86_64-cpython-312/awscrt/eventstream
      running egg_info
      writing awscrt.egg-info/PKG-INFO
      writing dependency_links to awscrt.egg-info/dependency_links.txt
      writing requirements to awscrt.egg-info/requires.txt
      writing top-level names to awscrt.egg-info/top_level.txt
      reading manifest file 'awscrt.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '.git*' found anywhere in distribution
      warning: no previously-included files matching '.git*/**' found anywhere in distribution
      warning: no previously-included files matching '.travis*' found anywhere in distribution
      warning: no previously-included files matching '.travis/**' found anywhere in distribution
      warning: no previously-included files matching '.builder/**' found anywhere in distribution
      warning: no previously-included files matching 'format-check.py' found anywhere in distribution
      warning: no previously-included files matching 'builder.json' found anywhere in distribution
      warning: no previously-included files matching 'codebuild/**' found anywhere in distribution
      warning: no previously-included files matching '.clang-format' found anywhere in distribution
      warning: no previously-included files matching '.clang-tidy' found anywhere in distribution
      warning: no previously-included files matching 'crt/*/verification/**' found anywhere in distribution
      warning: no previously-included files matching 'crt/*/docs/**' found anywhere in distribution
      warning: no previously-included files matching 'crt/*/bin/**' found anywhere in distribution
      warning: no previously-included files matching 'crt/*/scripts/**' found anywhere in distribution
      warning: no previously-included files matching 'docker-images/**' found anywhere in distribution
      warning: no previously-included files matching 'crt/aws-lc/**/crypto_test_data*' found anywhere in distribution
      no previously-included directories found matching 'crt/**/AWSCRTAndroidTestRunner'
      no previously-included directories found matching 'crt/aws-c-auth/tests'
      no previously-included directories found matching 'crt/aws-c-cal/tests'
      no previously-included directories found matching 'crt/aws-c-common/tests'
      no previously-included directories found matching 'crt/aws-c-compression/tests'
      no previously-included directories found matching 'crt/aws-c-io/tests'
      no previously-included directories found matching 'crt/aws-c-mqtt/tests'
      no previously-included directories found matching 'crt/aws-c-s3/tests'
      no previously-included directories found matching 'crt/aws-c-sdkutils/tests'
      no previously-included directories found matching 'crt/aws-c-cal/ecdsa-fuzz-corpus'
      no previously-included directories found matching 'crt/aws-c-s3/benchmarks'
      no previously-included directories found matching 'crt/s2n/tests'
      no previously-included directories found matching 'crt/s2n/compliance/specs'
      warning: no previously-included files found matching 'crt/aws-lc/**/*test*.go'
      warning: no previously-included files found matching 'crt/aws-lc/**/*test*.json'
      warning: no previously-included files found matching 'crt/aws-lc/**/*test*.py'
      warning: no previously-included files found matching 'crt/aws-lc/**/*test*.txt'
      no previously-included directories found matching 'crt/aws-lc/fuzz'
      no previously-included directories found matching 'crt/aws-lc/ssl'
      no previously-included directories found matching 'crt/aws-lc/third_party/jitterentropy/tests'
      no previously-included directories found matching 'crt/aws-lc/third_party/jitterentropy/doc'
      no previously-included directories found matching 'crt/aws-lc/tool'
      adding license file 'LICENSE'
      adding license file 'NOTICE'
      writing manifest file 'awscrt.egg-info/SOURCES.txt'
      warning: build_py: byte-compiling is disabled, skipping.
      
      running build_ext
      CMake Error at /data/data/com.termux/files/usr/share/cmake-4.2/Modules/CMakeDetermineSystem.cmake:35 (file):
        file failed to open for reading (No such file or directory):
      
          /data/data/com.termux/files/usr/include/android/api-level.h
      Call Stack (most recent call first):
        CMakeLists.txt:10 (project)
      
      
      -- The C compiler identification is Clang 21.0.0
      -- The CXX compiler identification is Clang 21.0.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /home/builder/.termux-build/_cache/android-r29-api-24-v3/bin/x86_64-linux-android-clang - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /home/builder/.termux-build/_cache/android-r29-api-24-v3/bin/x86_64-linux-android-clang++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- cmake command for dependency AWSLC: /data/data/com.termux/files/usr/bin/cmake;-DCMAKE_CXX_COMPILER=/home/builder/.termux-build/_cache/android-r29-api-24-v3/bin/x86_64-linux-android-clang++;-DCMAKE_CXX_FLAGS=-fstack-protector-strong -Oz --sysroot=/home/builder/.termux-build/_cache/android-r29-api-24-v3/sysroot;-DCMAKE_CXX_FLAGS_DEBUG=-g;-DCMAKE_CXX_FLAGS_MINSIZEREL=-Os -DNDEBUG;-DCMAKE_CXX_FLAGS_RELEASE=-O3 -DNDEBUG;-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O2 -g1 -DNDEBUG;-DCMAKE_C_COMPILER=/home/builder/.termux-build/_cache/android-r29-api-24-v3/bin/x86_64-linux-android-clang;-DCMAKE_C_FLAGS=-fstack-protector-strong -Oz --sysroot=/home/builder/.termux-build/_cache/android-r29-api-24-v3/sysroot -I/data/data/com.termux/files/usr/include/python3.12;-DCMAKE_C_FLAGS_DEBUG=-g;-DCMAKE_C_FLAGS_MINSIZEREL=-Os -DNDEBUG;-DCMAKE_C_FLAGS_RELEASE=-O3 -DNDEBUG;-DCMAKE_C_FLAGS_RELWITHDEBINFO=-O2 -g1 -DNDEBUG;-DCMAKE_EXE_LINKER_FLAGS=-L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -lm --sysroot=/home/builder/.termux-build/_cache/android-r29-api-24-v3/sysroot -L/home/builder/.termux-build/_cache/android-r29-api-24-v3/sysroot/usr/lib/x86_64-linux-android/24 -L/home/builder/.termux-build/_cache/android-r29-api-24-v3/lib/clang/21/lib/linux/x86_64 -L/data/data/com.termux/files/usr/lib;-DCMAKE_GENERATOR=Unix Makefiles;-DCMAKE_MAKE_PROGRAM=/usr/bin/gmake;-DCMAKE_MODULE_LINKER_FLAGS=-L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -lm --sysroot=/home/builder/.termux-build/_cache/android-r29-api-24-v3/sysroot -L/home/builder/.termux-build/_cache/android-r29-api-24-v3/sysroot/usr/lib/x86_64-linux-android/24 -L/home/builder/.termux-build/_cache/android-r29-api-24-v3/lib/clang/21/lib/linux/x86_64 -L/data/data/com.termux/files/usr/lib;-DCMAKE_SHARED_LINKER_FLAGS=-L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -lm --sysroot=/home/builder/.termux-build/_cache/android-r29-api-24-v3/sysroot -L/home/builder/.termux-build/_cache/android-r29-api-24-v3/sysroot/usr/lib/x86_64-linux-android/24 -L/home/builder/.termux-build/_cache/android-r29-api-24-v3/lib/clang/21/lib/linux/x86_64 -L/data/data/com.termux/files/usr/lib;-H/data/data/com.termux/files/usr/tmp/pip-install-jc_gvq5p/awscrt_520b6a5a42424118a1101e5b8ddf7075/crt/aws-lc;-B/data/data/com.termux/files/usr/tmp/pip-install-jc_gvq5p/awscrt_520b6a5a42424118a1101e5b8ddf7075/build/temp.linux-x86_64-cpython-312/deps/deps/AWSLC;-DCMAKE_BUILD_TYPE=RelWithDebInfo;-DCMAKE_PREFIX_PATH=;-DCMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr/tmp/pip-install-jc_gvq5p/awscrt_520b6a5a42424118a1101e5b8ddf7075/build/temp.linux-x86_64-cpython-312/deps/deps/AWSLC/install;-DCMAKE_INSTALL_RPATH=;-DBUILD_SHARED_LIBS=OFF;-GUnix Makefiles;-DDISABLE_GO=ON;-DDISABLE_PERL=ON;-DBUILD_LIBSSL=OFF;-DBUILD_TESTING=OFF;-DCMAKE_BUILD_TYPE=RelWithDebInfo
      CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
        Compatibility with CMake < 3.10 will be removed from a future version of
        CMake.
      
        Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
        to tell CMake that the project requires at least <min> but has been updated
        to work with policies introduced by <max> or earlier.
      
      
      CMake Error at /data/data/com.termux/files/usr/share/cmake-4.2/Modules/CMakeDetermineSystem.cmake:35 (file):
        file failed to open for reading (No such file or directory):
      
          /data/data/com.termux/files/usr/include/android/api-level.h
      Call Stack (most recent call first):
        CMakeLists.txt:20 (project)
      
      
      -- ENABLE_PRE_SONAME_BUILD: ON
      -- PERFORM_SONAME_BUILD: 0
      -- The C compiler identification is Clang 21.0.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /home/builder/.termux-build/_cache/android-r29-api-24-v3/bin/x86_64-linux-android-clang - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Entropy source configured: Dynamic (default: CPU Jitter)
      -- Go not found. Disabling some code generation and using pre-generated code in generated-src/
      -- Perl not found. Disabling some code generation and using pre-generated code in generated-src/
      -- Setting CMAKE_C_STANDARD=11
      -- Performing Test HAVE_C_FLAG__Wno_cast_function_type
      -- Performing Test HAVE_C_FLAG__Wno_cast_function_type - Success
      -- Compiler supports '-Wno-cast-function-type', adding to CMAKE_C_FLAGS
      -- Performing Test HAVE_C_FLAG__Wstring_concatenation
      -- Performing Test HAVE_C_FLAG__Wstring_concatenation - Success
      -- Compiler supports '-Wstring-concatenation', adding to C_CXX_FLAGS
      -- Performing Test HAVE_C_FLAG__Wimplicit_fallthrough
      -- Performing Test HAVE_C_FLAG__Wimplicit_fallthrough - Success
      -- Compiler supports '-Wimplicit-fallthrough', adding to C_CXX_FLAGS
      -- linux_random_h.c probe is positive, enabling HAVE_LINUX_RANDOM_H
      -- stdalign_check.c probe is positive, enabling AWS_LC_STDALIGN_AVAILABLE
      -- builtin_swap_check.c probe is positive, enabling AWS_LC_BUILTIN_SWAP_SUPPORTED
      -- Performing Test HAVE_C_FLAG__Wshadow
      -- Performing Test HAVE_C_FLAG__Wshadow - Success
      -- Compiler supports '-Wshadow', adding to C_CXX_FLAGS
      -- The ASM compiler identification is Clang with GNU-like command-line
      -- Found assembler: /home/builder/.termux-build/_cache/android-r29-api-24-v3/bin/x86_64-linux-android-clang
      Copying platform assembly files from /data/data/com.termux/files/usr/tmp/pip-install-jc_gvq5p/awscrt_520b6a5a42424118a1101e5b8ddf7075/crt/aws-lc/generated-src/linux-x86_64/crypto/ to /data/data/com.termux/files/usr/tmp/pip-install-jc_gvq5p/awscrt_520b6a5a42424118a1101e5b8ddf7075/build/temp.linux-x86_64-cpython-312/deps/deps/AWSLC/crypto
      -- Configuring incomplete, errors occurred!
      CMake Error at aws-c-common/cmake/AwsPrebuildDependency.cmake:65 (message):
        Configuration failed for dependency project AWSLC
      Call Stack (most recent call first):
        CMakeLists.txt:65 (aws_prebuild_dependency)
      
      
      -- Configuring incomplete, errors occurred!
      > /data/data/com.termux/files/usr/bin/cmake -H/data/data/com.termux/files/usr/tmp/pip-install-jc_gvq5p/awscrt_520b6a5a42424118a1101e5b8ddf7075/crt -Bbuild/temp.linux-x86_64-cpython-312/deps -DCMAKE_INSTALL_PREFIX=build/temp.linux-x86_64-cpython-312/deps/install -DCMAKE_BUILD_TYPE=RelWithDebInfo -DAWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE=ON

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! you improved this version, I think, by removing unnecessary things.

However, is this line also needed? What error happens if you remove this line? I wondered because: this line causes this unusual file to appear in the .deb file when it finishes building:
Image

Also, there might be other things not needed, like possibly CLANG_LIB and SYSROOT_FLAG, but I thought to ask about this line first.

I wonder if this can cause conflict with ndk-sysroot package? I believe it puts headers at this path

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, could you try adding a -b argument maybe like this, instead of a symbolic link?

-b "$NDK_SYSROOT/usr/include/android:$TERMUX__PREFIX__INCLUDE_DIR/android"

because, yes having this directory symbolically linked here can probably cause problems, especially for building other packages, and even if it's removed after the build finishes, the container could get messed up if the build fails before it can be removed, I think you get the idea.


termux-proot-run \
-b "$TERMUX_STANDALONE_TOOLCHAIN:$TERMUX_STANDALONE_TOOLCHAIN" \
-b "$WHEELHOUSE:$WHEELHOUSE" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you remove these two -b, arguments, it should still work, but let me know if it doesn't work

CXXFLAGS='$CXXFLAGS $SYSROOT_FLAG' CPPFLAGS='$CPPFLAGS -I$PYTHON_INCLUDE' \
LDFLAGS='$LDFLAGS $SYSROOT_FLAG -L$NDK_LIB -L$CLANG_LIB -L$TERMUX_PREFIX/lib'"

ln -s "$NDK_SYSROOT/usr/include/android" "$TERMUX__PREFIX__INCLUDE_DIR/android"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, could you try adding a -b argument maybe like this, instead of a symbolic link?

-b "$NDK_SYSROOT/usr/include/android:$TERMUX__PREFIX__INCLUDE_DIR/android"

because, yes having this directory symbolically linked here can probably cause problems, especially for building other packages, and even if it's removed after the build finishes, the container could get messed up if the build fails before it can be removed, I think you get the idea.

@robertkirkman
Copy link
Member

robertkirkman commented Jan 20, 2026

@Kapral67 I edited the build.sh some more and tested it, and when I remove some more variables, it keeps working, this is working for me:

TERMUX_PKG_HOMEPAGE=https://aws.amazon.com/cli
TERMUX_PKG_DESCRIPTION="Universal Command Line Interface for Amazon Web Services"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="2.32.28"
TERMUX_PKG_SRCURL="https://github.com/aws/aws-cli/archive/refs/tags/$TERMUX_PKG_VERSION.tar.gz"
TERMUX_PKG_SHA256=85ecd5baf4d5cdf4d9e436dd76e023d0126cdcd0e5cbf97a5cd15b33f8829b05
TERMUX_PKG_UPDATE_VERSION_REGEXP="\d+.\d+.\d+"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="libffi, libsqlite, groff"
TERMUX_PKG_BUILD_DEPENDS="aosp-libs, python-pip, cmake, ldd"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--with-install-type=portable-exe
--with-download-deps
PYTHON=$TERMUX_PREFIX/bin/python
"

termux_step_pre_configure() {
	export LDFLAGS+=" -lm"
	export PIP_NO_BINARY=awscrt
	export AWS_CRT_BUILD_FORCE_STATIC_LIBS=1

	if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
		return
	fi

	local PYTHON_INCLUDE="$TERMUX_PREFIX/include/python$TERMUX_PYTHON_VERSION"

	TERMUX_PROOT_EXTRA_ENV_VARS="
	LD_PRELOAD= LD_LIBRARY_PATH= \
	PIP_NO_BINARY=$PIP_NO_BINARY \
	AWS_CRT_BUILD_FORCE_STATIC_LIBS=$AWS_CRT_BUILD_FORCE_STATIC_LIBS \
	PIP_NO_INDEX=1 \
	CC=$CC \
	CXX=$CXX \
	AR=$AR \
	RANLIB=$RANLIB \
	CFLAGS='$CFLAGS -I$PYTHON_INCLUDE' \
	CPPFLAGS='$CPPFLAGS -I$PYTHON_INCLUDE' \
	CXXFLAGS='$CXXFLAGS' \
	LDFLAGS='$LDFLAGS'
	"
}

termux_step_configure() {
	if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
		termux_step_configure_autotools
		return
	fi

	termux_setup_proot

	termux-proot-run "$TERMUX_PKG_SRCDIR/configure" \
		--prefix="$TERMUX_PREFIX" \
		$TERMUX_PKG_EXTRA_CONFIGURE_ARGS
}

termux_step_make() {
	if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
		make
		return
	fi

	local WHEELHOUSE="$TERMUX_PKG_BUILDDIR/wheelhouse"
	mkdir -p "$WHEELHOUSE"

	python3 -m pip download \
		--dest "$WHEELHOUSE" \
		--platform "linux_$TERMUX_ARCH" \
		--python-version "$TERMUX_PYTHON_VERSION" \
		--implementation cp \
		--abi cp"${TERMUX_PYTHON_VERSION//.}" \
		--abi abi3 \
		--abi none \
		--no-deps \
		-r "$TERMUX_PKG_SRCDIR/requirements/download-deps/bootstrap-lock.txt" \
		-r "$TERMUX_PKG_SRCDIR/requirements/download-deps/portable-exe-lock.txt"

	termux-proot-run \
		-b "$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/android:$TERMUX__PREFIX__INCLUDE_DIR/android" \
		env PIP_FIND_LINKS="file://$WHEELHOUSE" \
		make
}

termux_step_make_install() {
	if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
		make install
		return
	fi

	termux-proot-run make install
}

I just removed everything that looked unnecessary to me. Do you know why it had all those things that I removed, and did I remove anything that's actually important?

@Kapral67
Copy link
Contributor Author

what architecture did you run on? I was having issues with aarch64 when I did not set cmake variables for system processor, c compiler and assembler.

I would get undefined symbols related to aes hw cryptography in the compiled libcrypto.a

@robertkirkman
Copy link
Member

Oh, I tested with x86_64, I will test again with aarch64

Copy link
Member

@TomJo2000 TomJo2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you this build script is looking much more like what'd I expected now.

Just have some minor leftovers.

@robertkirkman
Copy link
Member

robertkirkman commented Jan 20, 2026

@Kapral67 On my computer (64-bit x86 GNU/Linux) I tested the build.sh I sent with scripts/run-docker.sh ./build-package.sh -I -f -a aarch64 awscli, and it also built without errors, and when I install the resulting build on my phone, the aws command looks like it's working?

Could you try it, and see if it builds in GitHub Actions also? Maybe something changed that caused the extra variables to not be necessary anymore.

@Kapral67
Copy link
Contributor Author

Kapral67 commented Jan 20, 2026

@robertkirkman I tried your version and it seems working now without explicitly setting the CMAKE related vars
Detected CMAKE_SYSTEM_PROCESSOR as aarch64

They are running in gh actions over at https://github.com/termux-user-repository/tur/actions/runs/21179658020/job/60918154715?pr=2187

Copy link
Member

@robertkirkman robertkirkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems good to me now! Good job!

@Kapral67
Copy link
Contributor Author

Kapral67 commented Jan 21, 2026

It seems good to me now! Good job!

thank you for your help

@robertkirkman robertkirkman merged commit 8f2e930 into termux:master Jan 21, 2026
21 checks passed
@Kapral67 Kapral67 mentioned this pull request Jan 22, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants