Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bounty $$: Termux ReactNative Integration issue support #1983

Closed
simbadMarino opened this issue Mar 28, 2021 · 73 comments
Closed

Bounty $$: Termux ReactNative Integration issue support #1983

simbadMarino opened this issue Mar 28, 2021 · 73 comments

Comments

@simbadMarino
Copy link

Hello termux community! I hope this is the right place to ask for your help. I'm running some issues while trying to integrate the termux app into a React Native app.

Looks like the installation of packages is done OK however I'm getting this error when lauching TermuxActivity:
exec("/data/data/com.justshare/files/usr/bin/login"): No such file or directory

with the following output in the Run window:

I/com.justshare: Background concurrent copying GC freed 5842(2286KB) AllocSpace objects, 0(0B) LOS objects, 17% free, 27MB/33MB, paused 960us total 540.557ms
I/com.justshare: Background young concurrent copying GC freed 89594(5243KB) AllocSpace objects, 0(0B) LOS objects, 15% free, 28MB/33MB, paused 8.651ms total 268.872ms
W/com.justshare: type=1400 audit(0.0:145): avc: granted { execute } for name="login" dev="vdc" ino=82904 scontext=u:r:untrusted_app_27:s0:c140,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c140,c256,c512,c768 tclass=file app=com.justshare
W/com.justshare: Accessing hidden field Ljava/io/FileDescriptor;->descriptor:I (greylist, reflection, allowed)

I'm attaching a brief gif showing the problem:
termuxIntegrationIssue

I have tried lots of different alternatives but I'm getting out of ideas honestly as I'm not a mobile dev expert neither totally understand termux code (even after weeks of study lol)

I'm offering a $40 US dollar bounty in crypto ( Monero, Ripple, TRX, BTT or any TRON token) to whoever finds a solution and publish it here first.

I think it should be a really easy to solve issue for you but honestly cannot see the light now and I'm a bit desperate to find a solution now lol.

Link to the complete repo: https://github.com/simbadMarino/dCloud

Let me know if you need additional info. Thanks and I hope I can your support :)

@agnostic-apollo
Copy link
Member

You are directly using bootstrap.zip from termux-packages releases. Termux binaries are hardcoded to use and must be installed under the /data/data/com.termux/file/usr/ $PREFIX path. You cannot directly use termux compiled binaries in your app. You need to compile them specially for your app with the /data/data/com.justshare/files/usr prefix. Check following for how to build packages for yourself.

https://github.com/termux/termux-packages/wiki/Building-packages

https://github.com/termux/termux-packages/wiki/Termux-file-system-layout

You are currently also targeting sdk 28 so termux will work for now, but if you plan to publish on playstore or target sdk 29 plus then you will face other issues as well which you fine info for at the following link. In that case using android-10 branch app will be wiser.

https://github.com/termux/termux-packages/wiki/Termux-and-Android-10

@simbadMarino
Copy link
Author

simbadMarino commented Apr 3, 2021

Hello @agnostic-apollo , thanks for your support! I've been learning and trying and following the wikis. I'm using your docker termux build environment and managed to create some .deb packages with a customized $PREFIX by running the build-package.sh script. Then I learned that I needed to run the generate-bootstraps.sh script in order to generate the zip file containing the minimal working environment. I edited properties.sh to change the $PREFIX to com.justshare and ran the script, however the script is only generating: etc, tmp and var folders. I was expecting a complete environment like the one available in the termux-app repository (bin, etc, include, lib, libexec, share, tmp, var, SYMLINKs.txt) and the same containing the login script which is the one currently failing to be executed in my app.

As a side note I didn't fully understand the following sentence about having an apt repository in the web server:
image

I used the https://dl.bintray.com/termux/termux-packages-24 repository as it looked to have more than enough packages for my purposes but not sure if running the script like: ./scripts/generate-bootstraps.sh --repository "https://dl.bintray.com/termux/termux-packages-24" should be enough as that's why I did to generate my bootstrap packages

Would you please advice on how to generate such a complete environment using my customized $PREFIX? I could not identify any section in the wiki talking about that.
Thanks a lot in advance!!

@ghost
Copy link

ghost commented Apr 3, 2021

@simbadMarino

  1. Compile packages with your custom prefix.
  2. Create apt repository and push it to either local or remote web server. (you can use aptly to generate apt repository from given deb files)
  3. Run generate-bootstraps.sh script with custom configuration (prefix & url).

It is not possible to use generate-bootstraps.sh without apt repository because it needs some metadata. It is not possible to use official packages to generate bootstrap archives with custom prefix. All three steps shown above are important.

@simbadMarino
Copy link
Author

simbadMarino commented Apr 3, 2021 via email

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Apr 4, 2021

@simbadMarino

Or you can try the following experimental build-bootstraps.sh script to locally cross-compile only the bootstrap package debs and create bootstrap zips. I wrote this a while ago and some stuff has changed in termux build systems by now. However, I have updated the script to work with current system so that you can use it, and it is working for a different PREFIX. There could of course be issues but likely solvable, I only ever did basic testing, didn't get time for more, although openssh works. On-device (termux in mobile) builds are not supported currently, so use PC (cross-compile in docker).

Firstly, you need to pull the latest changes from termux-packages repo, I just committed some stuff. (package source urls got outdated since old versions were removed by respective hosters)

Then

  1. Set the TERMUX_APP_PACKAGE value in properties.sh to your app's package name.
    2. Place the build-bootstraps.sh in termux-packages/scripts directory.
  2. Run cd termux-packages
  3. Run ./scripts/run-docker.sh ./scripts/build-bootstraps.sh &> build.log to compile for all archs. You should find the bootstrap-*.zip in the termux-packages directory. If you want to compile only for a specific arch like aarch64, then run ./scripts/run-docker.sh ./scripts/build-bootstraps.sh --architectures aarch64 &> build.log. You can pass additional comma-separated list of packages that should be included in the bootstrap in addition to the default ones with the -add option.
  4. Replace/place the zips in termux-app/app/src/main/cpp.
  5. Add a return statement at start of downloadBootstrap() function in termux-app/app/build.gradle so that the custom bootstrap-*.zip files don't get replaced with termux ones.
  6. Then build an APK. Untested, but should hopefully work.

It would be better if you ran ./clean.sh before building for a different prefix to start fresh, or pass -f option to build-bootstraps.sh script at least once (for each arch).

If you get curl: (18) transfer closed with x bytes remaining to read. while running build-bootstraps.sh when its downloading a package source, then just run the script again, it should hopefully work.

If you get curl: (22) The requested URL returned error: 410 Gone or something like 404 Not Found while running build-bootstraps.sh when its downloading a package source, then you will have to update the TERMUX_PKG_VERSION, TERMUX_PKG_SRCURL, etc in the build.sh file for the respective package, and fix any *.patch files or apply additional ones if compilation fails, or open an issue in termux-packages.

Good-luck!

build-bootstraps.zip

Edit:

build-bootstrap.sh is officially available in termux-packages repo, check https://github.com/termux/termux-packages/wiki/For-maintainers#build-bootstrap-archives.

@simbadMarino
Copy link
Author

@agnostic-apollo I gotta say THANK YOU!!! The bootstrap package was successfully created and then I managed to make it work in my app. @agnostic-apollo , @xeffyr
Kindly share your Crypto address so I can transfer you what I promised (preferible !

I ran into another issue (Hopefully this is the last time I bother you) I got the following error when trying to install a package using dpkg (I built this package using the build-package.sh script and custom $PREFIX):

Peek 2021-04-04 19-42

I even analyzed the dpkg binary in my bootstrap and could not find any hard-coded com.termux directory. I tried modifying different paths in the manifest and some other java classes but still could not find the root cause of the issue.
Do you know what could be causing that?

P.S. If you prefer I could become a Backer instead of the crypto bounty for some time to support the further development of termux, let me know what do you prefer :)

THANKS AGAIN!!

@ghost
Copy link

ghost commented Apr 6, 2021

I got the following error when trying to install a package using dpkg

Few possible causes:

  • You have built with the default Termux prefix.
  • That's all due to lib-dpkg-path-remove.c.patch which still has hardcoded com.termux.
  • Something went wrong when building bootstraps (e.g. script picked official deb files).

Run grep -r 'com.termux' $PREFIX to see affected binaries.

@agnostic-apollo
Copy link
Member

@xeffyr I don't think the hard coded com.termux is part of the patch in lib-dpkg-path-remove.c.patch, right?

Anyways, @simbadMarino you likely compiled the package with the wrong package name. In my default bootstrap, with additional openssh and sshpass, I compiled with build-package.sh -a aarch64 git and installed git and pcre2 (dependency of git) with dpkg -i pcre2_10.36_aarch64.deb git_2.31.1_aarch64.deb and it installed just fine, even git init works. Moreover, I couldn't fine any hard coded com.termux strings in dpkg and git deb files. So try compiling again I guess.

And you are very welcome! :) I am glad to hear at least the bootstrap worked to start Termux app fork.

About the bounty, the help is usually free on my part so its not an obligation to give it. But if you still wanna give it, you can check out my donation links here. Currently, I haven't set any cryto though, not sure how I will get it in my bank even, so if one of the payment channels in the link work for you, then great, otherwise no issue. As for being a backer for termux, prioritize backing @xeffyr or @Grimler91 since they do a lot more maintenance than me and have done it for far longer.

Thanks

@ghost
Copy link

ghost commented Apr 6, 2021

I don't think the hard coded com.termux is part of the patch

Ah, just looked over patches with grep, so assumed that was the case.

Then issue perhaps remains that one or more packages are still compiled with wrong prefix, either dpkg or git package which was attempted for installation with dpkg. All debs have files archived with absolute path (or relative to the Android rootfs).

@agnostic-apollo
Copy link
Member

No worries, I was using a text editor.

Yeah, likely, a clean build should hopefully solve the issue.

@simbadMarino
Copy link
Author

Hello @xeffyr I sent the XMR rewards this morning ;) (I had to leave my wallet sync for hours lol) and already sent an email to discuss details to you @agnostic-apollo

In regards of the issue, I removed all my current .deb files in the /deb folder and ran the bootstrap build script again, will check the results today afternoon and will come back with the results.

Thanks!

@ghost
Copy link

ghost commented Apr 6, 2021

I sent the XMR rewards this morning

I see, thanks.

@agnostic-apollo
Copy link
Member

In regards of the issue, I removed all my current .deb files in the /deb folder and ran the bootstrap build script again, will check the results today afternoon and will come back with the results.

Clearing debs is not enough. Already compiled source files will just be repacked as debs again. You need to run clean.sh before building or pass -f to build script so that already built files are cleared first. My build-bootstrap.sh script also supports the -f option, forgot to add text to its --help output.

@simbadMarino
Copy link
Author

yep, I also cleaned everything with clean.sh and just being paranoiac added the -f option ;) . Let's see if it created the file succesfully later today :) (fingers crossed)

@agnostic-apollo
Copy link
Member

Ah, okay, that's fine then. Good luck. May the C be with you :)

@simbadMarino
Copy link
Author

simbadMarino commented Apr 7, 2021

Hey @agnostic-apollo @xeffyr I got the same error when I tried again, however my final use case is to execute an specific binary file and I could finally do it today so I can live with that issue for a while :)

Just in case you notice something in the build log I'm attaching it for you to take a look whenever you have some free time:
build.log

Thanks both again for your great support! I hope I can somehow contribute to termux later on with fixes, mirrors, etc...

@ghost
Copy link

ghost commented Apr 7, 2021

From the log file I see that prefix is custom (/data/data/com.justshare/files/usr), so bootstraps are not the problem. But if you still can't install deb files, try to view their content with dpkg-deb -c filename.deb to verify that deb file has correct prefix.

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Apr 7, 2021

@simbadMarino When you built the bootstrap again after clean.sh, did you also install it in your app or just tried to install the git package? The dpkg is part of bootstrap and if if it was initially built with com.termux prefix, then that could be the reason for the error (considering it's working for me). The dpkg as a dependency of apt is one the first packages that is built, so it may have been built with the wrong prefix, while the rest of the bootstrap packages were correct like bash. This is probably an unlikely scenario, not sure if a rebuild would have been triggered by change in install paths, but just putting it out there. Basically build bootstrap again and install it again after clearing prefix, or reinstall app.

If you already reinstalled the bootstrap again and inspecting contents like xeffyr suggested didn't give anything useful, the maybe compile strace package and extract it manually to prefix since dpkg can't be used for installation. I'm not sure if a static version is built as well or not, which would make extracting easier, otherwise get it from here. then run strace dpkg i git.deb and see if that gives any clues.

I am running dpkg in a background shell and not an interactive shell like you are, so there are probably differences in behaviours.

And you are welcome. And thanks for considering future support. Glad your use case at least works.

@simbadMarino
Copy link
Author

Hello @xeffyr , @agnostic-apollo , so at the end looks like I'll need to solve the dpkg issue cuz I need to compile on device to get my binaries hehe.
I ran dpkg-deb -c git_2.30.1_x86_64.deb and got the following... (clearly something went wrong when building this package)

drwxr-xr-x builder/builder 0 2021-02-09 05:36 ./
drwxr-xr-x builder/builder 0 2021-02-09 05:36 ./data/
drwxr-xr-x builder/builder 0 2021-02-09 05:36 ./data/data/
drwxr-xr-x builder/builder 0 2021-02-09 05:36 ./data/data/com.termux/
drwxr-xr-x builder/builder 0 2021-02-09 05:36 ./data/data/com.termux/files/
drwx------ builder/builder 0 2021-02-09 05:36 ./data/data/com.termux/files/usr/
drwx------ builder/builder 0 2021-02-09 05:36 ./data/data/com.termux/files/usr/bin/
.....
.....

I will re-run the deb building and try again . Will keep you posted thanks!

@simbadMarino
Copy link
Author

Good news!! I rebuild and could install git and pcre:
Looks like indeed cleaning the build environment worked :)

downloads $ dpkg -i pcre2_10.36_x86_64.deb    (Reading database ... 4855 files and directories currently installed.)                          Preparing to unpack pcre2_10.36_x86_64.deb ...  Unpacking pcre2 (10.36) ...                     Setting up pcre2 (10.36) ...                    ~/downloads $ dpkg -i git_2.31.1_x86_64.deb     (Reading database ... 5067 files and directories currently installed.)                          Preparing to unpack git_2.31.1_x86_64.deb ...   Unpacking git (2.31.1) over (2.31.1) ...        Setting up git (2.31.1) ...
~/downloads $ git

Another question... what if I want to manually build for example "clang" but there is no clang build.sh file?

simbad@debian:~/Documents/temp/termux-packages$ ./scripts/run-docker.sh ./build-package.sh -a x86_64 clang
Running container 'termux-package-builder' from image 'termux/package-builder'...
ERROR: No build.sh script at package dir /home/builder/termux-packages/packages/clang!

Is there a way to add the build script to avoid rebuilding the whole bootstrap? (I'll do that anyway in the near future but just for testing purposes )

@ghost
Copy link

ghost commented Apr 9, 2021

what if I want to manually build for example "clang" but there is no clang build.sh file?

clang is a subpackage of libllvm.

@agnostic-apollo
Copy link
Member

Good news!! I rebuild and could install git and pcre:
Looks like indeed cleaning the build environment worked :)

Phew! Congratz! ;)

@simbadMarino
Copy link
Author

hey guys! hope you are doing great! I have 2 questions, everything is running fine with the integration I'm making, however I'd like to improve the way the user will interact with the binary I'm using... so:

  1. Is there a way to copy my termux-compiled binary into the /bin folder in the bootstrap zip file so the user can just type the command name and the terminal auto detects it? I have tried the dirty way just by copying the binary file but it is not recognized so I'm suspecting there is a link file somewhere I'm missing
  2. How can I modify the welcome prompt? I'd like to either remove it or keep it shorter :) (I've tried to modify the motd file but somehow it is still taking the text from somewhere else :octocat:

Thanks and regards!!

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Apr 19, 2021

Is there a way to copy my termux-compiled binary into the /bin folder in the bootstrap zip file so the user can just type the command name and the terminal auto detects it?

Can you explain this a bit more. How have you compiled this binary? And are you trying to place it in the bootstrap zip file manually, so that during installation it is automatically extracted to $PREFIX/bin?

have tried the dirty way just by copying the binary file but it is not recognized

Copied where and how, and what does not "not recognized" mean. Copied into the bootstrap or into $PREFIX/bin?

Note that extraction of bootstrap.zip only takes place once during initial installation of APK. Even updates will not re-extract it, unless $PREFIX has been deleted. So if you are updating the bootstrap, then updating (not installing) the app and hoping to find the binary, it will not work. User data is not modified unless user manually runs apt, pkg commands etc, regardless of if the current app version has a new bootstrap or not.

How can I modify the welcome prompt? I'd like to either remove it or keep it shorter :) (I've tried to modify the motd file but somehow it is still taking the text from somewhere else

I think you are again trying to update the app and hoping for the updated motd to show. Not going to work. You can manually modify the motd in the current termux installation with nano $PREFIX/etc/motd, after this new motd will show for new sessions.

If termux-tools is updated in termux-packages repository by maintainers, with say a new motd, each existing user will have to run pkg install termux-tools to get the new motd. New users with only get it, if the termux-app release they are installing has been built with the bootstrap.zip release that contains that version of termux-tools.

@agnostic-apollo
Copy link
Member

If you don't want to reinstall termux, you can run termux-reset to clear the $PREFIX so that updated bootstrap is installed.

@simbadMarino
Copy link
Author

simbadMarino commented Apr 19, 2021

Is there a way to copy my termux-compiled binary into the /bin folder in the bootstrap zip file so the user can just type the command name and the terminal auto detects it?

Can you explain this a bit more. How have you compiled this binary? And are you trying to place it in the bootstrap zip file manually, so that during installation it is automatically extracted to $PREFIX/bin?

Yes, I'm adding the btfs binary file here before a clean install:
image

have tried the dirty way just by copying the binary file but it is not recognized

Copied where and how, and what does not "not recognized" mean. Copied into the bootstrap or into $PREFIX/bin?

Yes, ples check picture above :)

Note that extraction of bootstrap.zip only takes place once during initial installation of APK. Even updates will not re-extract it, unless $PREFIX has been deleted. So if you are updating the bootstrap, then updating (not installing) the app and hoping to find the binary, it will not work. User data is not modified unless user manually runs apt, pkg commands etc, regardless of if the current app version has a new bootstrap or not.

I'm doing a clean install and still not getting te btfs copied in the $PREFIX/bin folder after installation

How can I modify the welcome prompt? I'd like to either remove it or keep it shorter :) (I've tried to modify the motd file but somehow it is still taking the text from somewhere else

I think you are again trying to update the app and hoping for the updated motd to show. Not going to work. You can manually modify the motd in the current termux installation with nano $PREFIX/etc/motd, after this new motd will show for new sessions.

I've tried this and worked, will do this in the meantime :)

If termux-tools is updated in termux-packages repository by maintainers, with say a new motd, each existing user will have to run pkg install termux-tools to get the new motd. New users with only get it, if the termux-app release they are installing has been built with the bootstrap.zip release that contains that version of termux-tools.

Thanks for the reply!

@simbadMarino
Copy link
Author

If you don't want to reinstall termux, you can run termux-reset to clear the $PREFIX so that updated bootstrap is installed.

That's a nice tip! thanks!

@agnostic-apollo
Copy link
Member

Multiple Welcomes!

I'm doing a clean install and still not getting te btfs copied in the $PREFIX/bin folder after installation

Well, that's weird. How are you checking this? ls -A $PREFIX/bin | grep btfs should work. Are you sure you are adding it to the bootstrap matching the architecture of your install target? Otherwise, try adding some Log entries to TermuxInstaller here and see if it gets logged.

And 135MB! I hope you are not planning for a playstore release, cause 100MB is the limit, although, with master branch you can't upload anyways. Not sure if F-Droid has limits. Sideloading should be fine.

@ghost
Copy link

ghost commented Apr 19, 2021

I'm doing a clean install and still not getting te btfs copied in the $PREFIX/bin folder after installation

Bootstrap archives is either overwritten during app build time or changes were made to wrong arch. If not, suggesting to clean all caches and intermediate artifacts (./gradlew clean) before attempting new build.

And 135MB! I hope you are not planning for a playstore release, cause 100MB is the limit,

Bootstrap archives have own size limit, specifically their current implementation through shared library blobs.

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Mar 22, 2022

theres nothing releted bootstraps on termux-package-sources-legacy-24.12.2019.tar

Do you know what bootstrap is or how to build it?

Check bootstrap-archives-legacy-24.12.2019.tar and https://github.com/termux/termux-packages/wiki/For-maintainers#generating-bootstrap-archives as reference. Although, the bootstrap scripts didn't exist at the time of android-5 branch, so will likely not work in current state.

can we use latest bootstraps on termux 79?

No

@ROSbyRaj
Copy link

Do you know what bootstrap is or how to build it?
ans: no, not exactly

@ROSbyRaj
Copy link

so how can i build it.
another question if there is nothing like building bootstrap on android-5 branch then how dev builds bootstrap for android-5 (when termux was campatible with android 5)?

@Grimler91
Copy link
Member

Either adjust the script to work with android-5, or write your own script for it. It's just a zip archive with files and a list of symlinks, it can be created manually if just a few packages are to be included.

Have a look at the bootstraps in bootstrap-archives-legacy-24.12.2019.tar to understand what you are dealing with (as suggested already).

@ROSbyRaj
Copy link

can i use latest custom build bootstrap in my own app(java)?

@agnostic-apollo
Copy link
Member

Yes, as long you comply with GPLv3 licenses of termux-app and termux-packages and any other licenses that apply for individual packages.

@ROSbyRaj
Copy link

yeah thanks
now i am stuck at what packages does bootstraps.zip have default.
i am building it manually.

@Grimler91
Copy link
Member

Original bootstraps should include all packages marked TERMUX_PKG_ESSENTIAL=true

@agnostic-apollo
Copy link
Member

Or check var/lib/dpkg/status for packages status or var/lib/dpkg/info/<package_name>.list for list of files for each package.

https://github.com/termux/termux-packages/blob/08a75bc756eb56c0743fb83910d6652b1d9920a6/scripts/build-bootstraps.sh#L164

status
Package: libandroid-support
Architecture: aarch64
Installed-Size: 196
Maintainer: Fredrik Fornwall @fornwall
Version: 24-6
Homepage: https://github.com/termux/libandroid-support
Pre-Depends: dpkg (>= 1.19.4-3)
Essential: yes
Description: Library extending the Android C library (Bionic) for additional multibyte, locale and math support
Status: install ok installed

Package: libiconv
Architecture: aarch64
Installed-Size: 1140
Maintainer: Fredrik Fornwall @fornwall
Version: 1.16-4
Homepage: https://www.gnu.org/software/libiconv/
Breaks: libandroid-support (<= 24), libiconv-dev, libandroid-support-dev
Replaces: libandroid-support (<= 24), libiconv-dev, libandroid-support-dev
Description: An implementation of iconv()
Status: install ok installed

Package: coreutils
Architecture: aarch64
Installed-Size: 2376
Maintainer: Fredrik Fornwall @fornwall
Version: 8.31-5
Homepage: https://www.gnu.org/software/coreutils/
Breaks: chroot, busybox (<< 1.30.1-4)
Depends: libandroid-support, libiconv
Essential: yes
Replaces: chroot, busybox (<< 1.30.1-4)
Description: Basic file, shell and text manipulation utilities from the GNU project
Status: install ok installed

Package: libbz2
Architecture: aarch64
Installed-Size: 112
Maintainer: Fredrik Fornwall @fornwall
Version: 1.0.8-3
Homepage: http:https://www.bzip.org/
Breaks: libbz2-dev
Essential: yes
Replaces: libbz2-dev
Description: BZ2 format compression library
Status: install ok installed

Package: bzip2
Architecture: aarch64
Installed-Size: 128
Maintainer: Fredrik Fornwall @fornwall
Version: 1.0.8-3
Homepage: http:https://www.bzip.org/
Essential: yes
Depends: libbz2 (= 1.0.8-3)
Description: Tools for working with bzip2 compression
Status: install ok installed

Package: diffutils
Architecture: aarch64
Installed-Size: 556
Maintainer: Fredrik Fornwall @fornwall
Version: 3.7-3
Homepage: https://www.gnu.org/software/diffutils/
Depends: libiconv
Essential: yes
Description: Programs (cmp, diff, diff3 and sdiff) related to finding differences between files
Status: install ok installed

Package: gzip
Architecture: aarch64
Installed-Size: 320
Maintainer: Fredrik Fornwall @fornwall
Version: 1.10-3
Homepage: https://www.gnu.org/software/gzip/
Essential: yes
Description: Standard GNU file compression utilities
Status: install ok installed

Package: ncurses
Architecture: aarch64
Installed-Size: 1496
Maintainer: Fredrik Fornwall @fornwall
Version: 6.1.20190511-8
Homepage: https://invisible-island.net/ncurses/
Breaks: ncurses-dev, ncurses-utils (<< 6.1.20190511-4)
Replaces: ncurses-dev, ncurses-utils (<< 6.1.20190511-4)
Description: Library for text-based user interfaces in a terminal-independent manner
Status: install ok installed

Package: less
Architecture: aarch64
Installed-Size: 252
Maintainer: Fredrik Fornwall @fornwall
Version: 551-2
Homepage: http:https://www.greenwoodsoftware.com/less/
Depends: ncurses
Essential: yes
Description: Terminal pager program used to view the contents of a text file one screen at a time
Status: install ok installed

Package: liblzma
Architecture: aarch64
Installed-Size: 596
Maintainer: Fredrik Fornwall @fornwall
Version: 5.2.4-3
Homepage: https://tukaani.org/xz/
Breaks: liblzma-dev
Essential: yes
Replaces: liblzma-dev
Description: XZ-format compression library
Status: install ok installed

Package: libandroid-glob
Architecture: aarch64
Installed-Size: 64
Maintainer: Fredrik Fornwall @fornwall
Version: 0.6-1
Homepage: http:https://man7.org/linux/man-pages/man3/glob.3.html
Breaks: libandroid-glob-dev
Replaces: libandroid-glob-dev
Description: Shared library for the glob(3) system function
Status: install ok installed

Package: tar
Architecture: aarch64
Installed-Size: 1160
Maintainer: Fredrik Fornwall @fornwall
Version: 1.32-4
Homepage: https://www.gnu.org/software/tar/
Depends: libandroid-glob, libiconv
Essential: yes
Description: GNU tar for manipulating tar archives
Status: install ok installed

Package: xz-utils
Architecture: aarch64
Installed-Size: 220
Maintainer: Fredrik Fornwall @fornwall
Version: 5.2.4-3
Homepage: https://tukaani.org/xz/
Essential: yes
Depends: liblzma (= 5.2.4-3)
Description: XZ-format compression tools
Status: install ok installed

Package: zlib
Architecture: aarch64
Installed-Size: 256
Maintainer: Fredrik Fornwall @fornwall
Version: 1.2.11-2
Homepage: https://www.zlib.net/
Breaks: ndk-sysroot (<< 19b-3), zlib-dev
Replaces: ndk-sysroot (<< 19b-3), zlib-dev
Description: Compression library implementing the deflate compression method found in gzip and PKZIP
Status: install ok installed

Package: dpkg
Architecture: aarch64
Installed-Size: 932
Maintainer: Fredrik Fornwall @fornwall
Version: 1.19.7-5
Homepage: https://packages.debian.org/dpkg
Breaks: dpkg-dev
Depends: bzip2, coreutils, diffutils, gzip, less, libbz2, liblzma, tar, xz-utils, zlib
Essential: yes
Replaces: dpkg-dev
Description: Debian package management system
Status: install ok installed

Package: findutils
Architecture: aarch64
Installed-Size: 812
Maintainer: Fredrik Fornwall @fornwall
Version: 4.7.0-1
Homepage: https://www.gnu.org/software/findutils/
Depends: libandroid-support
Essential: yes
Description: Utilities to find files meeting specified criteria and perform various actions on the files which are found
Status: install ok installed

Package: libgpg-error
Architecture: aarch64
Installed-Size: 504
Maintainer: Fredrik Fornwall @fornwall
Version: 1.36-2
Homepage: https://www.gnupg.org/related_software/libgpg-error/
Breaks: libgpg-error-dev
Replaces: libgpg-error-dev
Description: Small library that defines common error values for all GnuPG components
Status: install ok installed

Package: libgcrypt
Architecture: aarch64
Installed-Size: 1176
Maintainer: Fredrik Fornwall @fornwall
Version: 1.8.5-1
Homepage: https://www.gnu.org/software/libgcrypt/
Breaks: libgcrypt-dev
Depends: libgpg-error
Replaces: libgcrypt-dev
Description: General purpose cryptographic library based on the code from GnuPG
Status: install ok installed

Package: gpgv
Architecture: aarch64
Installed-Size: 368
Maintainer: Fredrik Fornwall @fornwall
Version: 2.2.17-2
Homepage: https://www.gnupg.org/
Depends: libbz2, libgcrypt, libgpg-error, zlib
Description: GNU privacy guard - signature verification tool
Status: install ok installed

Package: pcre
Architecture: aarch64
Installed-Size: 2696
Maintainer: Fredrik Fornwall @fornwall
Version: 8.43-4
Homepage: https://www.pcre.org
Breaks: pcre-dev
Replaces: pcre-dev
Description: Library implementing regular expression pattern matching using the same syntax and semantics as Perl 5
Status: install ok installed

Package: grep
Architecture: aarch64
Installed-Size: 360
Maintainer: Fredrik Fornwall @fornwall
Version: 3.3-3
Homepage: https://www.gnu.org/software/grep/
Depends: libandroid-support, pcre
Essential: yes
Description: Command which searches one or more input files for lines containing a match to a specified pattern
Status: install ok installed

Package: libc++
Architecture: aarch64
Installed-Size: 956
Maintainer: Fredrik Fornwall @fornwall
Version: 20-3
Homepage: https://libcxx.llvm.org/
Essential: yes
Description: C++ Standard Library
Status: install ok installed

Package: libnghttp2
Architecture: aarch64
Installed-Size: 432
Maintainer: Fredrik Fornwall @fornwall
Version: 1.39.2-1
Homepage: https://nghttp2.org/
Breaks: libnghttp2-dev
Replaces: libnghttp2-dev
Description: nghttp HTTP 2.0 library
Status: install ok installed

Package: ca-certificates
Architecture: all
Installed-Size: 264
Maintainer: Fredrik Fornwall @fornwall
Version: 20191129
Homepage: https://curl.haxx.se/docs/caextract.html
Description: Common CA certificates
Status: install ok installed

Package: openssl
Architecture: aarch64
Installed-Size: 4184
Maintainer: Fredrik Fornwall @fornwall
Version: 1.1.1d-2
Homepage: https://www.openssl.org/
Breaks: openssl-tool (<< 1.1.1b-1), openssl-dev
Depends: ca-certificates
Conflicts: libcurl (<< 7.61.0-1)
Replaces: openssl-tool (<< 1.1.1b-1), openssl-dev
Description: Library implementing the SSL and TLS protocols as well as general purpose cryptography functions
Status: install ok installed

Package: libcurl
Architecture: aarch64
Installed-Size: 2512
Maintainer: Fredrik Fornwall @fornwall
Version: 7.67.0-1
Homepage: https://curl.haxx.se/
Breaks: libcurl-dev
Depends: libnghttp2, openssl (>= 1.1.1), zlib
Essential: yes
Conflicts: apt (<< 1.4.8-8)
Replaces: libcurl-dev
Description: Easy-to-use client-side URL transfer library
Status: install ok installed

Package: sed
Architecture: aarch64
Installed-Size: 388
Maintainer: Fredrik Fornwall @fornwall
Version: 4.7-2
Homepage: https://www.gnu.org/software/sed/
Essential: yes
Description: GNU stream editor for filtering/transforming text
Status: install ok installed

Package: termux-licenses
Architecture: all
Installed-Size: 404
Maintainer: Fredrik Fornwall @fornwall
Version: 1.0-1
Homepage: https://termux.com
Essential: yes
Description: Contains LICENSE files for common licenses
Status: install ok installed

Package: apt
Architecture: aarch64
Installed-Size: 2756
Maintainer: Fredrik Fornwall @fornwall
Version: 1.4.9-12
Homepage: https://packages.debian.org/apt
Depends: coreutils, dpkg, findutils, gpgv, grep, libc++, libcurl, liblzma, sed, termux-licenses, zlib
Essential: yes
Conflicts: apt-transport-https
Recommends: game-repo, science-repo
Replaces: apt-transport-https
Suggests: gnupg
Description: Front-end for the dpkg package manager
Status: install ok installed

Package: termux-keyring
Architecture: all
Installed-Size: 76
Maintainer: Fredrik Fornwall @fornwall
Version: 1.1-1
Homepage: https://github.com/termux
Description: GPG public keys for the official Termux repositories
Status: install ok installed

Package: game-repo
Architecture: all
Installed-Size: 52
Maintainer: Henrik Grimler @Grimler91
Version: 1.0-1
Homepage: https://github.com/termux/game-packages
Depends: termux-keyring
Description: Package repository containing games for termux
Status: install ok installed

Package: science-repo
Architecture: all
Installed-Size: 52
Maintainer: Henrik Grimler @Grimler91
Version: 1.0-1
Homepage: https://github.com/termux/science-packages
Depends: termux-keyring
Description: Package repository containing science software
Status: install ok installed

Package: readline
Architecture: aarch64
Installed-Size: 1084
Maintainer: Fredrik Fornwall @fornwall
Version: 8.0.1-1
Homepage: https://tiswww.case.edu/php/chet/readline/rltop.html
Breaks: bash (<< 5.0), readline-dev
Depends: libandroid-support, ncurses
Replaces: readline-dev
Description: Library that allow users to edit command lines as they are typed in
Status: install ok installed

Package: curl
Architecture: aarch64
Installed-Size: 244
Maintainer: Fredrik Fornwall @fornwall
Version: 7.67.0-1
Homepage: https://curl.haxx.se/
Essential: yes
Depends: libcurl (= 7.67.0-1)
Description: Command line tool for transferring data with URL syntax
Status: install ok installed

Package: dash
Architecture: aarch64
Installed-Size: 172
Maintainer: Fredrik Fornwall @fornwall
Version: 0.5.10.2-3
Homepage: http:https://gondor.apana.org.au/~herbert/dash/
Essential: yes
Description: Small POSIX-compliant implementation of /bin/sh
Status: install ok installed

Package: libgmp
Architecture: aarch64
Installed-Size: 1172
Maintainer: Fredrik Fornwall @fornwall
Version: 6.1.2-5
Homepage: https://gmplib.org/
Breaks: libgmp-dev
Replaces: libgmp-dev
Description: Library for arbitrary precision arithmetic
Status: install ok installed

Package: libmpfr
Architecture: aarch64
Installed-Size: 916
Maintainer: Fredrik Fornwall @fornwall
Version: 4.0.2-2
Homepage: https://www.mpfr.org/
Breaks: libmpfr-dev
Depends: libgmp
Replaces: libmpfr-dev
Description: C library for multiple-precision floating-point computations with correct rounding
Status: install ok installed

Package: gawk
Architecture: aarch64
Installed-Size: 2868
Maintainer: Fredrik Fornwall @fornwall
Version: 5.0.1-5
Homepage: https://www.gnu.org/software/gawk/
Breaks: gawk-dev
Depends: libandroid-support, libgmp, libmpfr, readline
Essential: yes
Replaces: gawk-dev
Description: Programming language designed for text processing
Status: install ok installed

Package: procps
Architecture: aarch64
Installed-Size: 708
Maintainer: Fredrik Fornwall @fornwall
Version: 3.3.15-7
Homepage: https://gitlab.com/procps-ng/procps
Breaks: procps-dev
Depends: ncurses
Essential: yes
Replaces: procps-dev
Description: Utilities that give information about processes using the /proc filesystem
Status: install ok installed

Package: psmisc
Architecture: aarch64
Installed-Size: 192
Maintainer: Fredrik Fornwall @fornwall
Version: 23.2-2
Homepage: https://gitlab.com/psmisc/psmisc
Depends: ncurses
Essential: yes
Description: Some small useful utilities that use the proc filesystem
Status: install ok installed

Package: termux-am
Architecture: all
Installed-Size: 72
Maintainer: Michal Bednarski @michalbednarski
Version: 0.3-1
Homepage: https://github.com/termux/TermuxAm
Conflicts: termux-tools (<< 0.51)
Description: Android Oreo-compatible am command reimplementation
Status: install ok installed

Package: termux-exec
Architecture: aarch64
Installed-Size: 52
Maintainer: Fredrik Fornwall @fornwall
Version: 0.4-2
Homepage: https://github.com/termux/termux-exec
Essential: yes
Description: An execve() wrapper to make /bin and /usr/bin shebangs work
Status: install ok installed

Package: termux-tools
Architecture: all
Installed-Size: 148
Maintainer: Fredrik Fornwall @fornwall
Version: 0.75
Homepage: https://termux.com/
Depends: bzip2, coreutils, curl, dash, diffutils, findutils, gawk, grep, gzip, less, procps, psmisc, sed, tar, termux-am, termux-exec, xz-utils
Essential: yes
Conflicts: procps (<< 3.3.15-2)
Recommends: ed, dos2unix, inetutils, net-tools, patch, unzip, util-linux
Suggests: termux-api
Description: Basic system tools for Termux
Status: install ok installed

Package: bash
Architecture: aarch64
Installed-Size: 3940
Maintainer: Fredrik Fornwall @fornwall
Version: 5.0.11-1
Homepage: https://www.gnu.org/software/bash/
Breaks: bash-dev
Depends: libandroid-support, libiconv, ncurses, readline (>= 8.0), termux-tools
Essential: yes
Recommends: command-not-found
Replaces: bash-dev
Description: A sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh)
Status: install ok installed

Package: command-not-found
Architecture: aarch64
Installed-Size: 232
Maintainer: Fredrik Fornwall @fornwall
Version: 1.42.1
Homepage: https://github.com/termux/command-not-found
Description: Suggest installation of packages in interactive shell sessions
Status: install ok installed

Package: busybox
Architecture: aarch64
Installed-Size: 916
Maintainer: Fredrik Fornwall @fornwall
Version: 1.31.1-1
Homepage: https://busybox.net/
Conflicts: coreutils (<< 8.25-4)
Description: Tiny versions of many common UNIX utilities into a single small executable
Status: install ok installed

Package: ed
Architecture: aarch64
Installed-Size: 168
Maintainer: Oliver Schmidhauser @Neo-Oli
Version: 1.15-1
Homepage: https://www.gnu.org/software/ed/
Description: Classic UNIX line editor
Status: install ok installed

Package: dos2unix
Architecture: aarch64
Installed-Size: 332
Maintainer: Fredrik Fornwall @fornwall
Version: 7.4.1-1
Homepage: https://waterlan.home.xs4all.nl/dos2unix.html
Depends: libandroid-support
Description: Converts between DOS and Unix text files
Status: install ok installed

Package: libutil
Architecture: aarch64
Installed-Size: 52
Maintainer: Fredrik Fornwall @fornwall
Version: 0.4-1
Homepage: https://refspecs.linuxbase.org/LSB_2.1.0/LSB-generic/LSB-generic/libutil.html
Description: Library with terminal functions
Status: install ok installed

Package: inetutils
Architecture: aarch64
Installed-Size: 1124
Maintainer: Fredrik Fornwall @fornwall
Version: 1.9.4-7
Homepage: https://www.gnu.org/software/inetutils/
Depends: readline, libutil
Description: Collection of common network programs
Status: install ok installed

Package: net-tools
Architecture: aarch64
Installed-Size: 580
Maintainer: Fredrik Fornwall @fornwall
Version: 1.60.2017.02.21-3
Homepage: http:https://net-tools.sourceforge.net/
Description: Configuration tools for Linux networking
Status: install ok installed

Package: patch
Architecture: aarch64
Installed-Size: 216
Maintainer: Fredrik Fornwall @fornwall
Version: 2.7.6-4
Homepage: https://savannah.gnu.org/projects/patch/
Description: GNU patch which applies diff files to create patched files
Status: install ok installed

Package: unzip
Architecture: aarch64
Installed-Size: 328
Maintainer: Fredrik Fornwall @fornwall
Version: 6.0-6
Homepage: http:https://www.info-zip.org/
Depends: libbz2
Description: Tools for working with zip files
Status: install ok installed

Package: libcrypt
Architecture: aarch64
Installed-Size: 72
Maintainer: Fredrik Fornwall @fornwall
Version: 0.2-3
Homepage: http:https://michael.dipperstein.com/crypt/
Breaks: libcrypt-dev
Depends: openssl
Replaces: libcrypt-dev
Description: A crypt(3) implementation
Status: install ok installed

Package: util-linux
Architecture: aarch64
Installed-Size: 3412
Maintainer: Fredrik Fornwall @fornwall
Version: 2.34-3
Homepage: https://en.wikipedia.org/wiki/Util-linux
Breaks: util-linux-dev
Depends: ncurses, libutil, libcrypt, zlib
Replaces: util-linux-dev
Description: Miscellaneous system utilities
Status: install ok installed

@ROSbyRaj
Copy link

Or check var/lib/dpkg/status for packages status or var/lib/dpkg/info/<package_name>.list for list of files for each package.

https://github.com/termux/termux-packages/blob/08a75bc756eb56c0743fb83910d6652b1d9920a6/scripts/build-bootstraps.sh#L164

status

Package: libandroid-support
Architecture: aarch64
Installed-Size: 196
Maintainer: Fredrik Fornwall @fornwall
Version: 24-6
Homepage: https://github.com/termux/libandroid-support
Pre-Depends: dpkg (>= 1.19.4-3)
Essential: yes
Description: Library extending the Android C library (Bionic) for additional multibyte, locale and math support
Status: install ok installed

Package: libiconv
Architecture: aarch64
Installed-Size: 1140
Maintainer: Fredrik Fornwall @fornwall
Version: 1.16-4
Homepage: https://www.gnu.org/software/libiconv/
Breaks: libandroid-support (<= 24), libiconv-dev, libandroid-support-dev
Replaces: libandroid-support (<= 24), libiconv-dev, libandroid-support-dev
Description: An implementation of iconv()
Status: install ok installed

Package: coreutils
Architecture: aarch64
Installed-Size: 2376
Maintainer: Fredrik Fornwall @fornwall
Version: 8.31-5
Homepage: https://www.gnu.org/software/coreutils/
Breaks: chroot, busybox (<< 1.30.1-4)
Depends: libandroid-support, libiconv
Essential: yes
Replaces: chroot, busybox (<< 1.30.1-4)
Description: Basic file, shell and text manipulation utilities from the GNU project
Status: install ok installed

Package: libbz2
Architecture: aarch64
Installed-Size: 112
Maintainer: Fredrik Fornwall @fornwall
Version: 1.0.8-3
Homepage: http:https://www.bzip.org/
Breaks: libbz2-dev
Essential: yes
Replaces: libbz2-dev
Description: BZ2 format compression library
Status: install ok installed

Package: bzip2
Architecture: aarch64
Installed-Size: 128
Maintainer: Fredrik Fornwall @fornwall
Version: 1.0.8-3
Homepage: http:https://www.bzip.org/
Essential: yes
Depends: libbz2 (= 1.0.8-3)
Description: Tools for working with bzip2 compression
Status: install ok installed

Package: diffutils
Architecture: aarch64
Installed-Size: 556
Maintainer: Fredrik Fornwall @fornwall
Version: 3.7-3
Homepage: https://www.gnu.org/software/diffutils/
Depends: libiconv
Essential: yes
Description: Programs (cmp, diff, diff3 and sdiff) related to finding differences between files
Status: install ok installed

Package: gzip
Architecture: aarch64
Installed-Size: 320
Maintainer: Fredrik Fornwall @fornwall
Version: 1.10-3
Homepage: https://www.gnu.org/software/gzip/
Essential: yes
Description: Standard GNU file compression utilities
Status: install ok installed

Package: ncurses
Architecture: aarch64
Installed-Size: 1496
Maintainer: Fredrik Fornwall @fornwall
Version: 6.1.20190511-8
Homepage: https://invisible-island.net/ncurses/
Breaks: ncurses-dev, ncurses-utils (<< 6.1.20190511-4)
Replaces: ncurses-dev, ncurses-utils (<< 6.1.20190511-4)
Description: Library for text-based user interfaces in a terminal-independent manner
Status: install ok installed

Package: less
Architecture: aarch64
Installed-Size: 252
Maintainer: Fredrik Fornwall @fornwall
Version: 551-2
Homepage: http:https://www.greenwoodsoftware.com/less/
Depends: ncurses
Essential: yes
Description: Terminal pager program used to view the contents of a text file one screen at a time
Status: install ok installed

Package: liblzma
Architecture: aarch64
Installed-Size: 596
Maintainer: Fredrik Fornwall @fornwall
Version: 5.2.4-3
Homepage: https://tukaani.org/xz/
Breaks: liblzma-dev
Essential: yes
Replaces: liblzma-dev
Description: XZ-format compression library
Status: install ok installed

Package: libandroid-glob
Architecture: aarch64
Installed-Size: 64
Maintainer: Fredrik Fornwall @fornwall
Version: 0.6-1
Homepage: http:https://man7.org/linux/man-pages/man3/glob.3.html
Breaks: libandroid-glob-dev
Replaces: libandroid-glob-dev
Description: Shared library for the glob(3) system function
Status: install ok installed

Package: tar
Architecture: aarch64
Installed-Size: 1160
Maintainer: Fredrik Fornwall @fornwall
Version: 1.32-4
Homepage: https://www.gnu.org/software/tar/
Depends: libandroid-glob, libiconv
Essential: yes
Description: GNU tar for manipulating tar archives
Status: install ok installed

Package: xz-utils
Architecture: aarch64
Installed-Size: 220
Maintainer: Fredrik Fornwall @fornwall
Version: 5.2.4-3
Homepage: https://tukaani.org/xz/
Essential: yes
Depends: liblzma (= 5.2.4-3)
Description: XZ-format compression tools
Status: install ok installed

Package: zlib
Architecture: aarch64
Installed-Size: 256
Maintainer: Fredrik Fornwall @fornwall
Version: 1.2.11-2
Homepage: https://www.zlib.net/
Breaks: ndk-sysroot (<< 19b-3), zlib-dev
Replaces: ndk-sysroot (<< 19b-3), zlib-dev
Description: Compression library implementing the deflate compression method found in gzip and PKZIP
Status: install ok installed

Package: dpkg
Architecture: aarch64
Installed-Size: 932
Maintainer: Fredrik Fornwall @fornwall
Version: 1.19.7-5
Homepage: https://packages.debian.org/dpkg
Breaks: dpkg-dev
Depends: bzip2, coreutils, diffutils, gzip, less, libbz2, liblzma, tar, xz-utils, zlib
Essential: yes
Replaces: dpkg-dev
Description: Debian package management system
Status: install ok installed

Package: findutils
Architecture: aarch64
Installed-Size: 812
Maintainer: Fredrik Fornwall @fornwall
Version: 4.7.0-1
Homepage: https://www.gnu.org/software/findutils/
Depends: libandroid-support
Essential: yes
Description: Utilities to find files meeting specified criteria and perform various actions on the files which are found
Status: install ok installed

Package: libgpg-error
Architecture: aarch64
Installed-Size: 504
Maintainer: Fredrik Fornwall @fornwall
Version: 1.36-2
Homepage: https://www.gnupg.org/related_software/libgpg-error/
Breaks: libgpg-error-dev
Replaces: libgpg-error-dev
Description: Small library that defines common error values for all GnuPG components
Status: install ok installed

Package: libgcrypt
Architecture: aarch64
Installed-Size: 1176
Maintainer: Fredrik Fornwall @fornwall
Version: 1.8.5-1
Homepage: https://www.gnu.org/software/libgcrypt/
Breaks: libgcrypt-dev
Depends: libgpg-error
Replaces: libgcrypt-dev
Description: General purpose cryptographic library based on the code from GnuPG
Status: install ok installed

Package: gpgv
Architecture: aarch64
Installed-Size: 368
Maintainer: Fredrik Fornwall @fornwall
Version: 2.2.17-2
Homepage: https://www.gnupg.org/
Depends: libbz2, libgcrypt, libgpg-error, zlib
Description: GNU privacy guard - signature verification tool
Status: install ok installed

Package: pcre
Architecture: aarch64
Installed-Size: 2696
Maintainer: Fredrik Fornwall @fornwall
Version: 8.43-4
Homepage: https://www.pcre.org
Breaks: pcre-dev
Replaces: pcre-dev
Description: Library implementing regular expression pattern matching using the same syntax and semantics as Perl 5
Status: install ok installed

Package: grep
Architecture: aarch64
Installed-Size: 360
Maintainer: Fredrik Fornwall @fornwall
Version: 3.3-3
Homepage: https://www.gnu.org/software/grep/
Depends: libandroid-support, pcre
Essential: yes
Description: Command which searches one or more input files for lines containing a match to a specified pattern
Status: install ok installed

Package: libc++
Architecture: aarch64
Installed-Size: 956
Maintainer: Fredrik Fornwall @fornwall
Version: 20-3
Homepage: https://libcxx.llvm.org/
Essential: yes
Description: C++ Standard Library
Status: install ok installed

Package: libnghttp2
Architecture: aarch64
Installed-Size: 432
Maintainer: Fredrik Fornwall @fornwall
Version: 1.39.2-1
Homepage: https://nghttp2.org/
Breaks: libnghttp2-dev
Replaces: libnghttp2-dev
Description: nghttp HTTP 2.0 library
Status: install ok installed

Package: ca-certificates
Architecture: all
Installed-Size: 264
Maintainer: Fredrik Fornwall @fornwall
Version: 20191129
Homepage: https://curl.haxx.se/docs/caextract.html
Description: Common CA certificates
Status: install ok installed

Package: openssl
Architecture: aarch64
Installed-Size: 4184
Maintainer: Fredrik Fornwall @fornwall
Version: 1.1.1d-2
Homepage: https://www.openssl.org/
Breaks: openssl-tool (<< 1.1.1b-1), openssl-dev
Depends: ca-certificates
Conflicts: libcurl (<< 7.61.0-1)
Replaces: openssl-tool (<< 1.1.1b-1), openssl-dev
Description: Library implementing the SSL and TLS protocols as well as general purpose cryptography functions
Status: install ok installed

Package: libcurl
Architecture: aarch64
Installed-Size: 2512
Maintainer: Fredrik Fornwall @fornwall
Version: 7.67.0-1
Homepage: https://curl.haxx.se/
Breaks: libcurl-dev
Depends: libnghttp2, openssl (>= 1.1.1), zlib
Essential: yes
Conflicts: apt (<< 1.4.8-8)
Replaces: libcurl-dev
Description: Easy-to-use client-side URL transfer library
Status: install ok installed

Package: sed
Architecture: aarch64
Installed-Size: 388
Maintainer: Fredrik Fornwall @fornwall
Version: 4.7-2
Homepage: https://www.gnu.org/software/sed/
Essential: yes
Description: GNU stream editor for filtering/transforming text
Status: install ok installed

Package: termux-licenses
Architecture: all
Installed-Size: 404
Maintainer: Fredrik Fornwall @fornwall
Version: 1.0-1
Homepage: https://termux.com
Essential: yes
Description: Contains LICENSE files for common licenses
Status: install ok installed

Package: apt
Architecture: aarch64
Installed-Size: 2756
Maintainer: Fredrik Fornwall @fornwall
Version: 1.4.9-12
Homepage: https://packages.debian.org/apt
Depends: coreutils, dpkg, findutils, gpgv, grep, libc++, libcurl, liblzma, sed, termux-licenses, zlib
Essential: yes
Conflicts: apt-transport-https
Recommends: game-repo, science-repo
Replaces: apt-transport-https
Suggests: gnupg
Description: Front-end for the dpkg package manager
Status: install ok installed

Package: termux-keyring
Architecture: all
Installed-Size: 76
Maintainer: Fredrik Fornwall @fornwall
Version: 1.1-1
Homepage: https://github.com/termux
Description: GPG public keys for the official Termux repositories
Status: install ok installed

Package: game-repo
Architecture: all
Installed-Size: 52
Maintainer: Henrik Grimler @Grimler91
Version: 1.0-1
Homepage: https://github.com/termux/game-packages
Depends: termux-keyring
Description: Package repository containing games for termux
Status: install ok installed

Package: science-repo
Architecture: all
Installed-Size: 52
Maintainer: Henrik Grimler @Grimler91
Version: 1.0-1
Homepage: https://github.com/termux/science-packages
Depends: termux-keyring
Description: Package repository containing science software
Status: install ok installed

Package: readline
Architecture: aarch64
Installed-Size: 1084
Maintainer: Fredrik Fornwall @fornwall
Version: 8.0.1-1
Homepage: https://tiswww.case.edu/php/chet/readline/rltop.html
Breaks: bash (<< 5.0), readline-dev
Depends: libandroid-support, ncurses
Replaces: readline-dev
Description: Library that allow users to edit command lines as they are typed in
Status: install ok installed

Package: curl
Architecture: aarch64
Installed-Size: 244
Maintainer: Fredrik Fornwall @fornwall
Version: 7.67.0-1
Homepage: https://curl.haxx.se/
Essential: yes
Depends: libcurl (= 7.67.0-1)
Description: Command line tool for transferring data with URL syntax
Status: install ok installed

Package: dash
Architecture: aarch64
Installed-Size: 172
Maintainer: Fredrik Fornwall @fornwall
Version: 0.5.10.2-3
Homepage: http:https://gondor.apana.org.au/~herbert/dash/
Essential: yes
Description: Small POSIX-compliant implementation of /bin/sh
Status: install ok installed

Package: libgmp
Architecture: aarch64
Installed-Size: 1172
Maintainer: Fredrik Fornwall @fornwall
Version: 6.1.2-5
Homepage: https://gmplib.org/
Breaks: libgmp-dev
Replaces: libgmp-dev
Description: Library for arbitrary precision arithmetic
Status: install ok installed

Package: libmpfr
Architecture: aarch64
Installed-Size: 916
Maintainer: Fredrik Fornwall @fornwall
Version: 4.0.2-2
Homepage: https://www.mpfr.org/
Breaks: libmpfr-dev
Depends: libgmp
Replaces: libmpfr-dev
Description: C library for multiple-precision floating-point computations with correct rounding
Status: install ok installed

Package: gawk
Architecture: aarch64
Installed-Size: 2868
Maintainer: Fredrik Fornwall @fornwall
Version: 5.0.1-5
Homepage: https://www.gnu.org/software/gawk/
Breaks: gawk-dev
Depends: libandroid-support, libgmp, libmpfr, readline
Essential: yes
Replaces: gawk-dev
Description: Programming language designed for text processing
Status: install ok installed

Package: procps
Architecture: aarch64
Installed-Size: 708
Maintainer: Fredrik Fornwall @fornwall
Version: 3.3.15-7
Homepage: https://gitlab.com/procps-ng/procps
Breaks: procps-dev
Depends: ncurses
Essential: yes
Replaces: procps-dev
Description: Utilities that give information about processes using the /proc filesystem
Status: install ok installed

Package: psmisc
Architecture: aarch64
Installed-Size: 192
Maintainer: Fredrik Fornwall @fornwall
Version: 23.2-2
Homepage: https://gitlab.com/psmisc/psmisc
Depends: ncurses
Essential: yes
Description: Some small useful utilities that use the proc filesystem
Status: install ok installed

Package: termux-am
Architecture: all
Installed-Size: 72
Maintainer: Michal Bednarski @michalbednarski
Version: 0.3-1
Homepage: https://github.com/termux/TermuxAm
Conflicts: termux-tools (<< 0.51)
Description: Android Oreo-compatible am command reimplementation
Status: install ok installed

Package: termux-exec
Architecture: aarch64
Installed-Size: 52
Maintainer: Fredrik Fornwall @fornwall
Version: 0.4-2
Homepage: https://github.com/termux/termux-exec
Essential: yes
Description: An execve() wrapper to make /bin and /usr/bin shebangs work
Status: install ok installed

Package: termux-tools
Architecture: all
Installed-Size: 148
Maintainer: Fredrik Fornwall @fornwall
Version: 0.75
Homepage: https://termux.com/
Depends: bzip2, coreutils, curl, dash, diffutils, findutils, gawk, grep, gzip, less, procps, psmisc, sed, tar, termux-am, termux-exec, xz-utils
Essential: yes
Conflicts: procps (<< 3.3.15-2)
Recommends: ed, dos2unix, inetutils, net-tools, patch, unzip, util-linux
Suggests: termux-api
Description: Basic system tools for Termux
Status: install ok installed

Package: bash
Architecture: aarch64
Installed-Size: 3940
Maintainer: Fredrik Fornwall @fornwall
Version: 5.0.11-1
Homepage: https://www.gnu.org/software/bash/
Breaks: bash-dev
Depends: libandroid-support, libiconv, ncurses, readline (>= 8.0), termux-tools
Essential: yes
Recommends: command-not-found
Replaces: bash-dev
Description: A sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh)
Status: install ok installed

Package: command-not-found
Architecture: aarch64
Installed-Size: 232
Maintainer: Fredrik Fornwall @fornwall
Version: 1.42.1
Homepage: https://github.com/termux/command-not-found
Description: Suggest installation of packages in interactive shell sessions
Status: install ok installed

Package: busybox
Architecture: aarch64
Installed-Size: 916
Maintainer: Fredrik Fornwall @fornwall
Version: 1.31.1-1
Homepage: https://busybox.net/
Conflicts: coreutils (<< 8.25-4)
Description: Tiny versions of many common UNIX utilities into a single small executable
Status: install ok installed

Package: ed
Architecture: aarch64
Installed-Size: 168
Maintainer: Oliver Schmidhauser @Neo-Oli
Version: 1.15-1
Homepage: https://www.gnu.org/software/ed/
Description: Classic UNIX line editor
Status: install ok installed

Package: dos2unix
Architecture: aarch64
Installed-Size: 332
Maintainer: Fredrik Fornwall @fornwall
Version: 7.4.1-1
Homepage: https://waterlan.home.xs4all.nl/dos2unix.html
Depends: libandroid-support
Description: Converts between DOS and Unix text files
Status: install ok installed

Package: libutil
Architecture: aarch64
Installed-Size: 52
Maintainer: Fredrik Fornwall @fornwall
Version: 0.4-1
Homepage: https://refspecs.linuxbase.org/LSB_2.1.0/LSB-generic/LSB-generic/libutil.html
Description: Library with terminal functions
Status: install ok installed

Package: inetutils
Architecture: aarch64
Installed-Size: 1124
Maintainer: Fredrik Fornwall @fornwall
Version: 1.9.4-7
Homepage: https://www.gnu.org/software/inetutils/
Depends: readline, libutil
Description: Collection of common network programs
Status: install ok installed

Package: net-tools
Architecture: aarch64
Installed-Size: 580
Maintainer: Fredrik Fornwall @fornwall
Version: 1.60.2017.02.21-3
Homepage: http:https://net-tools.sourceforge.net/
Description: Configuration tools for Linux networking
Status: install ok installed

Package: patch
Architecture: aarch64
Installed-Size: 216
Maintainer: Fredrik Fornwall @fornwall
Version: 2.7.6-4
Homepage: https://savannah.gnu.org/projects/patch/
Description: GNU patch which applies diff files to create patched files
Status: install ok installed

Package: unzip
Architecture: aarch64
Installed-Size: 328
Maintainer: Fredrik Fornwall @fornwall
Version: 6.0-6
Homepage: http:https://www.info-zip.org/
Depends: libbz2
Description: Tools for working with zip files
Status: install ok installed

Package: libcrypt
Architecture: aarch64
Installed-Size: 72
Maintainer: Fredrik Fornwall @fornwall
Version: 0.2-3
Homepage: http:https://michael.dipperstein.com/crypt/
Breaks: libcrypt-dev
Depends: openssl
Replaces: libcrypt-dev
Description: A crypt(3) implementation
Status: install ok installed

Package: util-linux
Architecture: aarch64
Installed-Size: 3412
Maintainer: Fredrik Fornwall @fornwall
Version: 2.34-3
Homepage: https://en.wikipedia.org/wiki/Util-linux
Breaks: util-linux-dev
Depends: ncurses, libutil, libcrypt, zlib
Replaces: util-linux-dev
Description: Miscellaneous system utilities
Status: install ok installed

Thanks Bro Very Much Thanks

@Cymmer
Copy link

Cymmer commented Aug 25, 2022

@agnostic-apollo

Or you can try the following experimental build-bootstraps.sh script to locally cross-compile only the bootstrap package debs and create bootstrap zips. I wrote this a while ago and some stuff has changed in termux build systems by now. However, I have updated the script to work with current system so that you can use it, and it is working for a different PREFIX. There could of course be issues but likely solvable, I only ever did basic testing, didn't get time for more, although openssh works. On-device (termux in mobile) builds are not supported currently, so use PC (cross-compile in docker).

Firstly, you need to pull the latest changes from termux-packages repo, I just committed some stuff. (package source urls got outdated since old versions were removed by respective hosters)

Then

  1. Set the TERMUX_APP_PACKAGE value in properties.sh to your app's package name.
    2. Place the build-bootstraps.sh in termux-packages/scripts directory.
  2. Run cd termux-packages
  3. Run ./scripts/run-docker.sh ./scripts/build-bootstraps.sh &> build.log to compile for all archs. You should find the bootstrap-*.zip in the termux-packages directory. If you want to compile only for a specific arch like aarch64, then run ./scripts/run-docker.sh ./scripts/build-bootstraps.sh --architectures aarch64 &> build.log. You can pass additional comma-separated list of packages that should be included in the bootstrap in addition to the default ones with the -add option.
  4. Replace/place the zips in termux-app/app/src/main/cpp.
  5. Add a return statement at start of downloadBootstrap() function in termux-app/app/build.gradle so that the custom bootstrap-*.zip files don't get replaced with termux ones.
  6. Then build an APK. Untested, but should hopefully work.

It would be better if you ran ./clean.sh before building for a different prefix to start fresh, or pass -f option to build-bootstraps.sh script at least once (for each arch).

If you get curl: (18) transfer closed with x bytes remaining to read. while running build-bootstraps.sh when its downloading a package source, then just run the script again, it should hopefully work.

If you get curl: (22) The requested URL returned error: 410 Gone or something like 404 Not Found while running build-bootstraps.sh when its downloading a package source, then you will have to update the TERMUX_PKG_VERSION, TERMUX_PKG_SRCURL, etc in the build.sh file for the respective package, and fix any *.patch files or apply additional ones if compilation fails, or open an issue in termux-packages.

Good-luck!

build-bootstraps.zip

Edit:

build-bootstrap.sh is officially available in termux-packages repo, check https://github.com/termux/termux-packages/wiki/For-maintainers#build-bootstrap-archives.

Hi @agnostic-apollo, I have been trying to follow these steps but when I run ./scripts/build-bootstraps.sh, some packages are not found in certain like bzip2 in i686 (See attachment). Is there some configuration that I need to do?

Here are the specific steps that I did:

  1. Cloned the latest termux-package repo
  2. Ran ./scripts/run-docker.sh
  3. Ran ./build-package.sh nodejs which produces a .deb file in the output/ folder
  4. Ran ./scripts/build-bootstraps.sh --architectures i686

image

P.S. I am not really an expert, especially in mobile dev. I have just started learning it and I wanted to bundle Termux with our app

@agnostic-apollo
Copy link
Member

@Cymmer
Copy link

Cymmer commented Aug 27, 2022

Add changes from https://github.com/termux/termux-packages/pull/10540/files#diff-92400a23a9c2f5f898037ad3689ca303eb2f5b3d0d09801713d573ef8777ffc1R87 and it should likely work.

@agnostic-apollo , sorry for the late reply, it took me almost 2 days to build one package and build the bootstraps. Unfortunately, it didn't work. So I tried to re-set up everything.

Here are the steps I did:

  1. Ran ./scripts/run-docker.sh
  2. Ran ./scripts/setup-android-sdk.sh (because it results a NDK error)
  3. Ran ./scripts/build-bootstraps.sh

And still, it did not work. Here's the build.log
build.log

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Aug 27, 2022

libgcrypt is failing with /usr/bin/as: unrecognized option '-EL', check termux/termux-packages@035c918

You need to pull latest changes of termux-packages master branch.

And if took two days to just build the relatively small apt dependencies in the build.log, your device must be really really slow, and it would probably take weeks to build libllvm, which also gets unnecessarily built as a dependency. Check #2892 (comment)

I suggest you use a github workflow to run the build.bootstraps.sh.

Also to skip libllvm from being built, maybe add following after https://github.com/termux/termux-packages/blob/4381b4d7cb439a237f46bd9e7addf4df86bbfa08/build-package.sh#L487. If i am not mistaken, that should work.

if [[ "$TERMUX_PKG_NAME" == "dpkg-perl" ]]; then
    echo "Skipping build for dpkg-perl"
    exit 0
fi

@Cymmer
Copy link

Cymmer commented Aug 27, 2022

@agnostic-apollo , I should have bought a better laptop 🤣 . I would probably make a cloud VM with very high specs to compensate for the long building process. Anyway, thank you for this! Will update you if ever this already works.

@agnostic-apollo
Copy link
Member

Lolz, a much better laptop. Good luck though.

@Cymmer
Copy link

Cymmer commented Aug 29, 2022

Hi @agnostic-apollo , just set up a powerful VM and it's done building in less than an hour 😆. However, the build still failed. I'm on the latest master branch of termux-packages. I also made changes to build-bootstraps.sh and build-package.sh from your replies.

Here are the steps I made:

  1. git clone https://github.com/termux/termux-packages
  2. cd termux-packages
  3. Edited ./build-package.sh (Bounty $$: Termux ReactNative Integration issue support #1983 (comment))
  4. Edited ./scripts/build-bootstraps.sh (Bounty $$: Termux ReactNative Integration issue support #1983 (comment))
  5. Ran ./build-package.sh vim (Successful)
  6. Ran ./scripts/build-bootstraps.sh (Failed)

Attached is the build.log.
build.log

P.S. I'm really grateful for taking the time to help me. Thank you so much!

@agnostic-apollo
Copy link
Member

@Grimler91 libevent package is failing to build with our latest docker. May be fixable with CMAKE flags. Could you or other packages "people" take a look? Thanks.

alicevision/geogram#2 (comment)

https://stackoverflow.com/questions/54587052/cmake-on-mac-could-not-find-threads-missing-threads-found

agnostic-apollo/termux-packages@8548865

https://github.com/agnostic-apollo/termux-packages/runs/8076472144

 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
CMake Error at /home/builder/.termux-build/_cache/cmake-3.24.1/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /home/builder/.termux-build/_cache/cmake-3.24.1/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /home/builder/.termux-build/_cache/cmake-3.24.1/share/cmake-3.24/Modules/FindThreads.cmake:230 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:862 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/builder/.termux-build/libevent/build/CMakeFiles/CMakeOutput.log".
See also "/home/builder/.termux-build/libevent/build/CMakeFiles/CMakeError.log".

@Grimler91
Copy link
Member

Grimler91 commented Aug 30, 2022

Seems cmake's scripts for finding pthread no longer supports android. I suppose it started with this 2 yo commit, so a bit weird that we have not seen it before.

"Fixed" in termux/termux-packages@af3d7b8.

@agnostic-apollo
Copy link
Member

Ah, interesting. Thanks a lot for the fix. @Cymmer you can go ahead and pull latest changes in termux-packages now and hopefully no more errors.

@Cymmer
Copy link

Cymmer commented Aug 30, 2022

Thank you, everyone! @agnostic-apollo I just finished trying to build the bootstraps again. Unfortunately, there's another error, something on inetutils package. Attached is the build.log.

build.log

@agnostic-apollo
Copy link
Member

You are just a curse, ain't you!

@Cymmer
Copy link

Cymmer commented Aug 30, 2022

You are just a curse, ain't you!

I'm really sorry hahaha 😆

@agnostic-apollo
Copy link
Member

Yeah, I am are really sorry to meet you too! :D

Should be fixed in termux/termux-packages@6e75ec41

And thanks for the bug reports. But one more and insta-block!

And @Grimler91 maybe we should consider building bootstrap packages without the -I flag once in a while or packages when NDK/Ubuntu is bumped.

@Grimler91
Copy link
Member

And @Grimler91 maybe we should consider building bootstrap packages without the -I flag once in a while or packages when NDK/Ubuntu is bumped.

Sounds like a good idea. I should probably write a checklist on stuff to do on ndk updates, this can be one of the things to check

@agnostic-apollo
Copy link
Member

Cool. Will look into writing a github workflow for build-boostrap.sh which also takes user input for arguments when I work on it.

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs

@Cymmer
Copy link

Cymmer commented Sep 2, 2022

@agnostic-apollo Sorry for the late reply. Been out for a while

And thanks for the bug reports. But one more and insta-block!
awww don't be like that hahahaha.

So far, I just finished the build and it failed :( . But this time it's on me because I just allocated a small amount of storage on my cloud VM hahahaha. So far, it's working already. It has built the bootstraps for all architectures except for x86_64 due to my storage hahaha (see attachment). Will try again later.

image

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Sep 2, 2022

No need for apologies for late replies.

Ha, serves you right!

Adding an option to run clean.sh before building bootstrap for each arch would be helpful for this kinda thing. Will do that later.

@Cymmer
Copy link

Cymmer commented Sep 5, 2022

Hi @agnostic-apollo , I have successfully built the bootstraps! Thank you so much.

However, when I tried to use the bootstraps in the latest master branch of termux-app, it shows this error during build. Something about Java heap size. Probably because of getting the zip files. Do you have any idea how to solve this?
build-error-log.txt

Steps made:

  1. Placed the zip files to termux-app/app/src/main/cpp/. Each zip file size is about 272MB.
  2. Edited app's build.gradle to return in downloadBootstrap() task right away.
  3. Built the app.

@agnostic-apollo
Copy link
Member

Searching on the internet for gradle build OutOfMemoryError should tell you what is wrong. Your bootstraps size is too large, causing allowed memory to run out. You "may" also get similar errors on device, specially low ram ones, while extracting bootstrap to $PREFIX.

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

No branches or pull requests

5 participants