nix: rafactor android-sdk to provide sdk/ndk outputs
This makes path shorter. Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
2095b41eee
commit
88dc152e73
|
@ -34,8 +34,8 @@ in {
|
|||
];
|
||||
|
||||
shellHook = ''
|
||||
export ANDROID_SDK_ROOT="${androidPkgs}"
|
||||
export ANDROID_NDK_ROOT="${androidPkgs}/ndk-bundle"
|
||||
export ANDROID_SDK_ROOT="${androidPkgs.sdk}"
|
||||
export ANDROID_NDK_ROOT="${androidPkgs.ndk}"
|
||||
|
||||
export STATUS_NIX_MAVEN_REPO="${deps.gradle}"
|
||||
|
||||
|
|
|
@ -80,8 +80,8 @@ in stdenv.mkDerivation rec {
|
|||
ANDROID_ABI_INCLUDE = androidAbiInclude;
|
||||
|
||||
# Android SDK/NDK for use by Gradle
|
||||
ANDROID_SDK_ROOT = "${androidPkgs}";
|
||||
ANDROID_NDK_ROOT = "${androidPkgs}/ndk-bundle";
|
||||
ANDROID_SDK_ROOT = "${androidPkgs.sdk}";
|
||||
ANDROID_NDK_ROOT = "${androidPkgs.ndk}";
|
||||
|
||||
# Used by the Android Gradle build script in android/build.gradle
|
||||
STATUS_GO_ANDROID_LIBDIR = "${status-go}";
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
#
|
||||
# This derivation simply symlinks some stuff to get
|
||||
# shorter paths as libexec/android-sdk is quite the mouthful.
|
||||
# With this you can just do `androidPkgs.sdk` and `androidPkgs.ndk`.
|
||||
#
|
||||
stdenv.mkDerivation {
|
||||
name = "${compose.androidsdk.name}-mod";
|
||||
phases = [ "symlinkPhase" ];
|
||||
outputs = [ "out" "sdk" "ndk" ];
|
||||
symlinkPhase = ''
|
||||
mkdir -p $out
|
||||
ln -s "${compose.androidsdk}/bin" $out/bin
|
||||
for d in ${compose.androidsdk}/libexec/android-sdk/*; do
|
||||
ln -s $d $out/$(basename $d)
|
||||
done
|
||||
ln -s ${compose.androidsdk} $out
|
||||
ln -s ${compose.androidsdk}/libexec/android-sdk $sdk
|
||||
ln -s ${compose.androidsdk}/libexec/android-sdk/ndk-bundle $ndk
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ mkShell {
|
|||
shellHook = ''
|
||||
export JAVA_HOME="${openjdk}"
|
||||
|
||||
export ANDROID_HOME="${androidPkgs}"
|
||||
export ANDROID_SDK_ROOT="${androidPkgs}"
|
||||
export ANDROID_NDK_ROOT="${androidPkgs}/ndk-bundle"
|
||||
export ANDROID_HOME="${androidPkgs.sdk}"
|
||||
export ANDROID_NDK_ROOT="${androidPkgs.ndk}"
|
||||
export ANDROID_SDK_ROOT="$ANDROID_HOME"
|
||||
|
||||
export PATH="$ANDROID_HOME/bin:$PATH"
|
||||
export PATH="$ANDROID_NDK_ROOT:$PATH"
|
||||
|
|
|
@ -40,8 +40,8 @@ buildGo116Module {
|
|||
wrapProgram $out/bin/gomobile \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}" \
|
||||
--prefix PATH : "${androidPkgs}/bin" \
|
||||
--set ANDROID_NDK_HOME "${androidPkgs}/ndk-bundle" \
|
||||
--set ANDROID_HOME "${androidPkgs}"
|
||||
--set ANDROID_NDK_ROOT "${androidPkgs.ndk}" \
|
||||
--set ANDROID_HOME "${androidPkgs.sdk}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
|
|
@ -46,10 +46,9 @@ in buildGo116Package {
|
|||
export GO111MODULE=off
|
||||
export GOPATH=${gomobile}:$GOPATH
|
||||
export NIX_GOWORKDIR=${NIX_GOWORKDIR}
|
||||
|
||||
'' + optionalString (platform == "android") ''
|
||||
export ANDROID_HOME=${androidPkgs}
|
||||
export ANDROID_NDK_HOME=${androidPkgs}/ndk-bundle
|
||||
export ANDROID_SDK_ROOT="${androidPkgs.sdk}"
|
||||
export ANDROID_NDK_HOME="${androidPkgs.ndk}"
|
||||
export PATH="${makeBinPath [ openjdk ]}:$PATH"
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in New Issue