lovell / sharp-libvips

Packaging scripts to prebuild libvips and its dependencies - you're probably looking for https://github.com/lovell/sharp
Apache License 2.0
176 stars 98 forks source link

Android prebuilds? #38

Open christianbundy opened 4 years ago

christianbundy commented 4 years ago

Hi there! I'd like to run Sharp on Android, but Android doesn't support libvips by default. I've tried to install libvips via Termux, but the package hasn't been ported. Would you be opening to creating prebuilds for Android? I saw this workaround, but I'm concerned about compatibility (for Sharp and other native modules).

Thanks!

lovell commented 4 years ago

I guess these would need to use the bionic libc and be cross-compiled for ARMv7 and ARM64v8. Happy to accept a PR with Dockerfiles that create suitable cross-build environments for this.

christianbundy commented 4 years ago

Works for me! Out of curiosity, I've noticed that lots of other projects use prebuild, which maintains its own Dockerfiles for a bunch of platforms -- is that something you've explored, or would be interested in using?

lovell commented 4 years ago

sharp already uses prebuild, this repo is to prebuild libvips for sharp, but we might be able to use the same base images it uses though - see https://github.com/dockcross/dockcross

kleisauke commented 3 years ago

Note that supporting Android devices would require libvips to be cross-compiled with an Android-compatible toolchain such as NDK. It looks like Termux has succeeded in this, see PR https://github.com/termux/termux-packages/pull/6325.

fwiw, as an experiment I tried to reuse the Linux ARM64v8 glibc binaries on Android (with Xamarin), but that doesn't seem to work.

Details ```xml $(PkgNetVips)\runtimes\linux\lib\netstandard2.0\NetVips.dll arm64-v8a ``` ``` [monodroid-assembly] Trying to load shared library '/data/app/nl.kleisauke.netvips/lib/arm64/libvips.so.42' [monodroid-assembly] Failed to load shared library '/data/app/nl.kleisauke.netvips/lib/arm64/libvips.so.42'. dlopen failed: library "libpthread.so.0" not found: needed by /data/app/nl.kleisauke.netvips/lib/arm64/libvips.so.42 in namespace classloader-namespace ```