rhardih / stand Goto Github PK
View Code? Open in Web Editor NEWStandalone Toolchain for Android NDK in Docker
Home Page: https://hub.docker.com/r/rhardih/stand
License: MIT License
Standalone Toolchain for Android NDK in Docker
Home Page: https://hub.docker.com/r/rhardih/stand
License: MIT License
I recently needed BAD to build copies of the GDAL for x86_64 using r18b Android-23, and noticed that STAND didn't have an image for that particular combination. Using STANDBY, I launched a build, but notice it failed with "buildx failed with: ERROR: failed to solve: process "/bin/sh -c ./ndk.sh" did not complete successfully: exit code: 100". I cloned the repo and determined that python2 was unable to be found by the ndk standalone build scripts.
Builds require access to Python2, however in the more recent Ubuntu images, calling "python" will no longer get you the default python interpreter. Instead, we explicitly call whichever version we want (or we install the python-is-python3 metapackage if we are okay with defaulting to python3).
Since we want to explicitly use python2 ('make-standalone-toolchain' script require python2), we need to force the container to see python2 as python. There is no metapackage 'python-is-python2', so that is not an option. I've tried using an alias with the shell option 'expand_aliases', however this also did not work. The solution is to create a simple shell script inside the docker file to redirect to python2.
In the dockerfile, simply add the following after COPY ndk.sh .
:
RUN echo '#!/usr/bin/python2' > /usr/bin/python && chmod +x /usr/bin/python
@rhardih I tested this change locally, and the toolchain build completed successfully. Would you mind testing it and adding it to the repo? I would like to pull that particular stand image for use with BAD in the near future :) I can create a pull request if you feel it's necessary, though it is literally just that single line.
Looks like StandBy (https://standby.rhardih.io/) is having some issues. It is reporting "Service Unhealthy", with the page content of "This service is not ready to serve traffic. If you are the site owner, please check that your service is passing health checks. "
Navigating to the link mentioned in the README.md just results in a page saying "There's nothing here, yet. "
STAND appears to have been built around supporting autotools for building various libraries in BAD. This works fine for many components, but the following have since abandoned autotools for CMAKE:
GEOS (3.10 and later only support CMAKE)
GDAL (3.6.0 only supports CMAKE)
PROJ (Post 8.2.1 only supports CMAKE)
When building with CMAKE (and targeting Android), you need to specify the NDK toolchain file using the following parameters:
-DCMAKE_TOOLCHAIN_FILE=${NDK_ROOT}/build/cmake/android.toolchain.cmake \
-DANDROID_NDK=${NDK_ROOT} \
-DANDROID_ABI=armeabi-v7a \
-DANDROID_PLATFORM=android-19 \
-DANDROID_STL=c++_shared \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${LIB1_DIRECTORY}/libs/armeabi-v7a \
${LIB1_DIRECTORY}
STAND appears to not include the toolchain file, and the NDK directory structure appears to be laid out differently than the source archive (android-ndk-r23c-linux.zip).
Would it be possible to build a set of STAND images which support CMAKE?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.