Giter Club home page Giter Club logo

Comments (27)

lygstate avatar lygstate commented on August 23, 2024 1

Please refer to https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/6509

from alpine-chrome.

pxlrbt avatar pxlrbt commented on August 23, 2024 1

@jlandure I'm currently building chromium as @lygstate suggested. Will create a PR if I succeed.

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

Hi @lygstate 👋

Thanks for your feedback.
I'm interested to help you.

Can you describe a usecase with some code and the error you get?

Is it something like describe on this image here?

from alpine-chrome.

lygstate avatar lygstate commented on August 23, 2024

I found that only need pack swiftshader libegl and libglesv2

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

Hi @lygstate
Thanks for the update. 👍

Do you think it could be useful for the community to get a zenika/alpine-chrome:with-webgl adding the missing packages ? Can you share a tiny example that works well?

Thanks for your contribution 🙌

from alpine-chrome.

lygstate avatar lygstate commented on August 23, 2024

@jlandure Need pacth the upstrem chromium packages:)
https://git.alpinelinux.org/aports/tree/community/chromium

But don't know where to start, patch file added

@@ -294,6 +269,11 @@ package() {
 	done
 	paxmark -m "$pkgdir"/usr/lib/$pkgname/chrome
 
+	install -Dm4755 libEGL.so "$pkgdir"/usr/lib/$pkgname/libEGL.so
+	install -Dm4755 libGLESv2.so "$pkgdir"/usr/lib/$pkgname/libGLESv2.so
+
+	install -Dm4755 swiftshader/libEGL.so "$pkgdir"/usr/lib/$pkgname/swiftshader/libEGL.so
+	install -Dm4755 swiftshader/libGLESv2.so "$pkgdir"/usr/lib/$pkgname/swiftshader/libGLESv2.so
 	install -Dm4755 chrome_sandbox "$pkgdir"/usr/lib/$pkgname/chrome-sandbox
 	install -m644 icudtl.dat "$pkgdir"/usr/lib/$pkgname/icudtl.dat

from alpine-chrome.

maxcct avatar maxcct commented on August 23, 2024

I've also come here looking for the same thing! A zenika/alpine-chrome:with-webgl would be perfect and very much appreciated.

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

Hi @maxcct @lygstate 👋
I've tried several things today to add webgl support to the headless chrome.
Here is the PullRequest #29

But It's not working...
I would like to get these outputs

chromium-browser --headless --disable-dev-shm-usage --no-sandbox --screenshot --hide-scrollbars https://webglfundamentals.org/webgl/webgl-fundamentals.html

Got

webgl-fundamentals

and expected is

webgl-fundamentals-expected

chromium-browser --headless --disable-dev-shm-usage --no-sandbox --screenshot --hide-scrollbars https://browserleaks.com/webgl

Got

webgl-activated

and expected is

webgl-activated-expected

Can you help me to make this zenika/alpine-chrome:with-webgl working? 👍

You can also launch these tests using puppeteer with:
node src/webgl.js

from alpine-chrome.

lygstate avatar lygstate commented on August 23, 2024

@jlandure you need recompile chrome, use mesa gles not working, I've tried.

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

Hi @lygstate 😊

Sorry for the delay.
I didn't achieve with success to recompile Chrome for the webgl support. 😣
Can you help me giving me the commands to recompile Chromium? 😇
Thanks!

from alpine-chrome.

freedev avatar freedev commented on August 23, 2024

I'm struggling with the same problem, any update on this?

from alpine-chrome.

lygstate avatar lygstate commented on August 23, 2024

Sorry, wait a minute

from alpine-chrome.

lygstate avatar lygstate commented on August 23, 2024

Change the APKBUILD file


package() {
	cd "$builddir"/out/$_buildtype
	local bin pak
	# paxmark inside chroot too
	paxmark -m mksnapshot

	# Installed files refere to
	# https://launchpad.net/ubuntu/disco/amd64/chromium-browser
	# https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
	# https://www.slimjet.com/chrome/google-chrome-old-version.php

	for bin in chrome chromedriver *.bin; do
		install -Dm755 $bin "$pkgdir"/usr/lib/$pkgname/$bin
	done
	paxmark -m "$pkgdir"/usr/lib/$pkgname/chrome

	install -Dm755 swiftshader/libEGL.so "$pkgdir"/usr/lib/$pkgname/swiftshader/libEGL.so
	install -Dm755 swiftshader/libGLESv2.so "$pkgdir"/usr/lib/$pkgname/swiftshader/libGLESv2.so

	install -Dm4755 chrome_sandbox "$pkgdir"/usr/lib/$pkgname/chrome-sandbox
	install -m644 icudtl.dat "$pkgdir"/usr/lib/$pkgname/icudtl.dat

	install -Dm755 xdg-mime "$pkgdir"/usr/lib/$pkgname/xdg-mime
	install -Dm755 xdg-settings "$pkgdir"/usr/lib/$pkgname/xdg-settings

	for pak in *.pak; do
		install -Dm644 $pak "$pkgdir"/usr/lib/$pkgname/$pak
	done

	install -Dm755 "$srcdir"/chromium-launcher.sh \
		"$pkgdir"/usr/lib/$pkgname/chromium-launcher.sh

	cp -a locales "$pkgdir"/usr/lib/$pkgname/
	cp -a MEIPreload "$pkgdir"/usr/lib/$pkgname/

	# It is important that we name the target "chromium-browser",
	# xdg-utils expect it; bug #355517.
	mkdir -p "$pkgdir"/usr/bin
	cd "$pkgdir"/usr/bin
	ln -sf /usr/lib/$pkgname/chromium-launcher.sh chromium-browser
	ln -sf /usr/lib/$pkgname/chromedriver "$pkgdir"/usr/bin/

	install -Dm644 "$srcdir"/chromium.conf \
		"$pkgdir"/etc/chromium/chromium.conf

	install -Dm644 "$srcdir"/chromium.desktop \
		"$pkgdir"/usr/share/applications/chromium.desktop

	cd "$builddir"
	for size in 24 48 64 128 256; do
		install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
			"$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
	done

	for size in 16 32; do
		install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
			"$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
	done
}

from alpine-chrome.

lygstate avatar lygstate commented on August 23, 2024

Basically,copy the file content of swiftshader

install -Dm755 swiftshader/libEGL.so "$pkgdir"/usr/lib/$pkgname/swiftshader/libEGL.so
install -Dm755 swiftshader/libGLESv2.so "$pkgdir"/usr/lib/$pkgname/swiftshader/libGLESv2.so

from alpine-chrome.

pxlrbt avatar pxlrbt commented on August 23, 2024

@lygstate You got it working? Would you mind creating a PR with a working Dockerfile?

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

@lygstate Please help us with this problem 👍
Open a PR or update the branch of the #29

from alpine-chrome.

mlovatonv avatar mlovatonv commented on August 23, 2024

@lygstate you got it working? I copied the file content of swiftshader but it still doesn't work for me. How did you recompile chromium?

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

Any news @lygstate @pxlrbt ? 👍

from alpine-chrome.

pxlrbt avatar pxlrbt commented on August 23, 2024

@jlandure It's still building on my machine. And if it's successful I still need to integrate it into your Dockerfile. Somehow I could install alpine-sdk yesterday which is required.

from alpine-chrome.

pxlrbt avatar pxlrbt commented on August 23, 2024

@jlandure Compilation is finally done and it worked with the example chromium-browser --headless --disable-dev-shm-usage --no-sandbox --screenshot --hide-scrollbars https://webglfundamentals.org/webgl/webgl-fundamentals.html.
I will check how to fix the issue with alpine-sdk after the weekend. Then I can update the Dockerfile.

from alpine-chrome.

pxlrbt avatar pxlrbt commented on August 23, 2024

@jlandure I got all issues before compilation step fixed within the Dockerfile. I am currently running a build on Docker Hub since last build took about 1,5 days on my machine. Maybe it's faster, maybe it will be aborted. Will create a PR if build is successfull.

from alpine-chrome.

pxlrbt avatar pxlrbt commented on August 23, 2024

@jlandure I created a PR with a prebuilt and a build from source version here: #50

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

Hi @pxlrbt

Thanks for your work! 🙌 How much times does it take to compile Chromium?
I will have a look.

FYI, I think there is a way to use multi-stage build to create the binary and NOT storing in the repository 🤔

And... I have to create a contributor section to reward the contribution 👍
Thanks again.

from alpine-chrome.

pxlrbt avatar pxlrbt commented on August 23, 2024

@jlandure It took around 1.5 days to compile chromium on my machine. Probably should have a look at @lygstates solutions here #51
I didn't test his result, but it looks way cleaner since he only add the missing libraries and there is no need to recompile chromium again when new versions are released.

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

@all-contributors please add @pxlrbt for question

from alpine-chrome.

allcontributors avatar allcontributors commented on August 23, 2024

@jlandure

I've put up a pull request to add @pxlrbt! 🎉

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

✅ This issue can be closed since this commit b5e7e1d 🎉

from alpine-chrome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.