This repository was forked from the official NDK Ports repository. It provides instructions and tools for building and publishing C++ library ports for use with the Android NDK.
The goal of this repository is to streamline publishing NDK ports for C++ libraries, enabling seamless integration on Android and React Native. The builds are managed via GitHub Actions, ensuring transparency and traceability in each step.
The following libraries are currently set up to be built with this project:
blst
curl
gmp
jsoncpp
libpng
openssl
utf8proc
zlib
sodium
You can manage library inclusion by adjusting the settings.gradle.kts
file.
Follow these steps to build a port with ndkports
.
Ensure you have all necessary dependencies, particularly:
- Android NDK path configured if running locally
If you prefer to build within a Docker container, use the provided Dockerfile
to ensure all dependencies are managed consistently. Inside Docker, the following command runs the main build script:
./scripts/build_release.sh
This script compiles all specified libraries in settings.gradle.kts.
To run the build locally, use the following Gradle command and set the NDK path:
./gradlew -PndkPath="/Users/username/Library/Android/sdk/ndk/26.1.10909125" -Prelease release
This command will build all libraries specified in settings.gradle.kts for the release configuration.
If you wish to build only a specific library (e.g., libpng), you can target it directly with Gradle:
./gradlew :openssl:distZip -PndkPath="/Users/username/Library/Android/sdk/ndk/26.1.10909125"
Replace openssl with the desired library name to customize the build further.