Merge pull request #182697 from vtuan10/fix-android-ndk

This commit is contained in:
Sandro 2022-07-25 15:09:28 +02:00 committed by GitHub
commit cd56fc47c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -222,6 +222,12 @@ rec {
'') plugins}
'';
# Function that automatically links the default NDK plugin.
linkNdkPlugin = {name, plugin, check}:
lib.optionalString check ''
ln -s ${plugin}/libexec/android-sdk/${name} ${name}
'';
# Function that automatically links a plugin for which only one version exists
linkPlugin = {name, plugin, check ? true}:
lib.optionalString check ''
@ -259,7 +265,7 @@ rec {
${linkPlatformPlugins { name = "sources"; plugins = sources; check = includeSources; }}
${linkPlugins { name = "cmake"; plugins = cmake; }}
${linkNdkPlugins { name = "ndk-bundle"; rootName = "ndk"; plugins = ndk-bundles; }}
${linkPlugin { name = "ndk-bundle"; plugin = ndk-bundle; check = includeNDK; }}
${linkNdkPlugin { name = "ndk-bundle"; plugin = ndk-bundle; check = includeNDK; }}
${lib.optionalString includeSystemImages ''
mkdir -p system-images

View File

@ -23,7 +23,7 @@ deployAndroidPackage {
# to still support the old standalone toolchains builds.
if [ -d $out/libexec/android-sdk/ndk ] && [ ! -d $out/libexec/android-sdk/ndk-bundle ]; then
ln -sf $out/libexec/android-sdk/ndk/${package.revision} $out/libexec/android-sdk/ndk-bundle
else
elif [ ! -d $out/libexec/android-sdk/ndk-bundle ]; then
echo "The ndk-bundle layout has changed. The nix expressions have to be updated!"
exit 1
fi