From e8dfc2d72a7071183dfef4bf720dd65021a61f32 Mon Sep 17 00:00:00 2001 From: Van Tuan Vo Date: Sun, 24 Jul 2022 14:32:28 +0200 Subject: [PATCH 1/2] androidenv: fix ndk linking for ndk < 23 --- pkgs/development/mobile/androidenv/ndk-bundle/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix index 5d0e2c2b171f..0f3e7e4faa23 100644 --- a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix +++ b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix @@ -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 From 8b8ac80759b689d4c94676da4d1e1e25b365c4ed Mon Sep 17 00:00:00 2001 From: Van Tuan Vo Date: Sun, 24 Jul 2022 14:33:02 +0200 Subject: [PATCH 2/2] androidenv: fix default ndk linking for ndk > 22 --- .../mobile/androidenv/compose-android-packages.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/mobile/androidenv/compose-android-packages.nix b/pkgs/development/mobile/androidenv/compose-android-packages.nix index c6d838544e9c..217922886df8 100644 --- a/pkgs/development/mobile/androidenv/compose-android-packages.nix +++ b/pkgs/development/mobile/androidenv/compose-android-packages.nix @@ -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