The issues with integrating with termux repo and built packages are
- The Termux package debs has
/data/data/com.myapp/files as the folder path to install in the control.tar.xz inside the deb
- Termux package source code hardcodes the full path to termux and for some packages these paths can be mission critical and hence wont work outside the termux app environment.
- Theres also this issue of modified termux pkg/apt binaries rejecting the calls to termux repos. But this is a client design and can be patched.
There are some options to bypass these like termux already does monkey patching of scripts with termux-exec
For packages where termux hardcoded paths are not critical, you can automate by extracting -> modifying -> repackaging or
preferably dynamically using tar --xform