termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.29k stars 3.06k forks source link

[Package]: chromium #10073

Open anshiq opened 2 years ago

anshiq commented 2 years ago

Package description

I am very thankfull to you termux developers for xfce4 destop environment. Please add add firefox or chromium atleast any of them in termux repo.

Home page URL

No response

Source code URL

No response

Packaging policy acknowledgement

Additional information

Nothing more thanks

xtkoba commented 2 years ago

Related issues: https://github.com/termux/termux-packages/issues/910 (Headless Chromium), termux/termux-packages#10075 (Firefox).

T-Dynamos commented 2 years ago

Building chromium is nightmare, its repo size is above 1.5gb Firefox

The clone can take from 40 minutes to two hours (depending on your connection) and the repository should be less than 5GB (~ 20GB after the build).
Yisus7u7 commented 2 years ago

@T-Dynamos Try this source:

http://deb.debian.org/debian/pool/main/c/chromium/chromium_100.0.4896.88.orig.tar.xz

jtghph commented 2 years ago

I suggest install Andronix app and from there, install a flavour of Linux within Termux. I have Debian buster installed. Comes with a complete desktop environment. Install Firefox or Chromium there.

Explanation:- A Linux implementation via the Andronix app uses proot within Termux to run a full-blown Linux within Termux. It's wonderful! Once you have it up and running, the actual Andronix app can be uninstalled from your phone as it is only used for the initial system setup.

Andronix isn't a Linux package

tomty89 commented 2 years ago

What it really uses is libudev and it might build just by setting use_udev = false.

tathastu871 commented 2 years ago

when termux proot distros have fully functional firefox and chromium why need to compile for termux

Grimler91 commented 2 years ago

when termux proot distros have fully functional firefox and chromium why need to compile for termux

Because termux/android isn't linux: https://wiki.termux.com/wiki/Differences_from_Linux

macerg commented 2 years ago

Agreed. If you need fully functional Linux, just install your personal favourite flavour within proot-distro.Regards,Richard Mace

licy183 commented 1 year ago

Tried to build chromium headless shell in https://github.com/termux-user-repository/tur/pull/149. As it is shown, due to the time limit of Github Action CI, it is impossible to build chromium using Termux's building system.

I'm not familiar with OpenSUSE building system. But I wonder whether it is possible to build a dummy package, and the building system which is used to build the dummy package triggers git clone and ./build-package.sh -I chromium and generates the .deb file and then includes the .deb file in the dummy package. Termux Maintainer can download the prebuilt .deb file and then extract binaries and repackage it.

T-Dynamos commented 1 year ago

What about using circle ci https://circleci.com/circleci-versus-github-actions/ In free plan it provides

Up to 6,000 build minutes per month
Largest selection: Build for Docker, Windows, Linux, Arm, and macOS or on your own compute with self-hosted runners
Build better: Choose the right resource class size (S⁠–⁠L) to go fast and maximize your build minutes
Fast: Run up to 30 jobs at a time and run your tests in parallel using test splitting

https://circleci.com/pricing/

T-Dynamos commented 1 year ago

I tried building it and here's its building let's see what happens https://app.circleci.com/pipelines/github/T-Dynamos/chromium-build/2/workflows/03fb1905-330f-4fd1-840e-73902dc88c1b/jobs/2

licy183 commented 1 year ago

I tried building it and here's its building let's see what happens https://app.circleci.com/pipelines/github/T-Dynamos/chromium-build/2/workflows/03fb1905-330f-4fd1-840e-73902dc88c1b/jobs/2

Seems that Circle CI's instance does not have enough memory to build chromium.

/home/builder/tur/tur/chromium/build.sh: line 154:  5144 Killed                  ninja -C out/Headless headless_shell
Yisus7u7 commented 1 year ago

I tried building it and here's its building let's see what happens https://app.circleci.com/pipelines/github/T-Dynamos/chromium-build/2/workflows/03fb1905-330f-4fd1-840e-73902dc88c1b/jobs/2

Seems that Circle CI's instance does not have enough memory to build chromium.

/home/builder/tur/tur/chromium/build.sh: line 154:  5144 Killed                  ninja -C out/Headless headless_shell

And openSUSE build service?

T-Dynamos commented 1 year ago

I tried building it and here's its building let's see what happens https://app.circleci.com/pipelines/github/T-Dynamos/chromium-build/2/workflows/03fb1905-330f-4fd1-840e-73902dc88c1b/jobs/2

Seems that Circle CI's instance does not have enough memory to build chromium.

/home/builder/tur/tur/chromium/build.sh: line 154:  5144 Killed                  ninja -C out/Headless headless_shell

I don't Know if it's possible : What if we just mount some amount of swap space Like

fallocate -l 8G /swapfile.swap &&  chmod 700 /swapfile.swap &&  mkswap /swapfile.swap &&  swapon /swapfile.swap 
licy183 commented 1 year ago

I tried building it and here's its building let's see what happens https://app.circleci.com/pipelines/github/T-Dynamos/chromium-build/2/workflows/03fb1905-330f-4fd1-840e-73902dc88c1b/jobs/2

Seems that Circle CI's instance does not have enough memory to build chromium.

/home/builder/tur/tur/chromium/build.sh: line 154:  5144 Killed                  ninja -C out/Headless headless_shell

And openSUSE build service?

The instance of openSUSE cannot connect to Internet during the building, so it cannot be used. Anyway I've successfully built headless chromium. During the build, CI will automatically cache the build state (the build, src and tmp folder in ~/.termux-build/package-name) and upload it if the build is not completed yet. This is inspired by the build method of ungoogled-chromium-archlinux.

licy183 commented 1 year ago

Now chromium with GUI support should also be available in TUR, see https://github.com/termux-user-repository/tur/commit/2e17cdb423d04a2fd6461c1a0e291cc8552f24b4. Next step, I will try to enable ffmpeg support for chromium.

SunPodder commented 1 year ago

@xtkoba mark this as completed?

licy183 commented 1 year ago

@xtkoba mark this as completed?

Emmm... I don't think this issue should be closed. I think it should be held open until we could find a way to compile chromium within 6 hours.

licy183 commented 7 months ago

I refactored the CI. Now all the chromium binaries could be found in https://github.com/termux-user-repository/chromium-builder.

I wonder if it is acceptable to add this prebuilt binary to the main repository. Its size is about 200MB.

twaik commented 7 months ago

How can github action work more than 6 hours? I thought it is restricted.

licy183 commented 7 months ago

It will take more than a day to compile chromium directly using GitHub Action. I divided the build process into many steps, and the execution time limit for each step is 6 hours. At the beginning of each step, the status of the previous step will be downloaded; at the end of each step, the status of this compilation will be uploaded. The workflow file and the build script can be found in https://github.com/termux-user-repository/tur/blob/master/.github/workflows/package_continuous.yml and https://github.com/termux-user-repository/tur/blob/master/continuous-build-wrapper.sh. It is inspired by the run.sh in ungoogled-chromium-archlinux.

agnostic-apollo commented 7 months ago

I wonder if it is acceptable to add this prebuilt binary to the main repository.

Have you heard anything about xz-utils recently? Probably not the best day to ask this question ;)

And prebuilt binaries existed for big packages like qt (IIRC) in the past, but were removed eventually, not a good idea to have them in a source repo. It would be better to add continuous/step build process to termux-packages instead as a temp measure or we could maybe add support to build on our server instead.

twaik commented 7 months ago

We may have separate repo for chromium in termux org configured to upload package to a main-repo via aptly directly. It still will be built with action, inside termux org, but outside of the termux-packages repo.

agnostic-apollo commented 7 months ago

Separate repo could be done too but if it's internal, then can use design for other packages as well instead of having to create a repo for each such package.

twaik commented 7 months ago

As far as I can see package_continuous workflow is triggered mostly for chromium. I think it is safe to have special case for chromium. Currently there are no other packages that require such amount of resources (time, CPU, memory) for building.

agnostic-apollo commented 7 months ago

As a short term measure that should be fine too, especially if devs don't have time. However, it is good development practice to design things with future in mind, otherwise you waste more time in future refactoring.

twaik commented 1 month ago

I think chromium is an exceptional case. There is are only few packages which require a lot of disk space, RAM and CPU time to be compiled, and only chromium needs more than 6 hours to be compiled. Probably we can make a single exception for this package.

tathastu871 commented 1 month ago

I mean why do people need native build of browsers proot distros have both chromium and firefox. besides for development and debug purposes you can use adb as android browsers app expose remote host on 9222 port atleast kiwi does, chrome and brave have stopped that

kiwi+termux-adb+selenium or node packges you can do

Developers of terminal application are all done for there are,

if someone has to build try to port javascript engine embeddanle and usable on browsers like lynx elinks w3m, but no devs nowadays unlike old time will be willing tontake such project,

twaik commented 4 weeks ago

proot-distro has lower performance compared to native builds.

tathastu871 commented 3 weeks ago

I mean why do you use browser on termux inside vnc

when variety of app browser available now kiwi and lemur browser both have devtools and extension support