mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 10:42:53 +00:00
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 = ''
|
shellHook = ''
|
||||||
export ANDROID_SDK_ROOT="${androidPkgs}"
|
export ANDROID_SDK_ROOT="${androidPkgs.sdk}"
|
||||||
export ANDROID_NDK_ROOT="${androidPkgs}/ndk-bundle"
|
export ANDROID_NDK_ROOT="${androidPkgs.ndk}"
|
||||||
|
|
||||||
export STATUS_NIX_MAVEN_REPO="${deps.gradle}"
|
export STATUS_NIX_MAVEN_REPO="${deps.gradle}"
|
||||||
|
|
||||||
|
@ -80,8 +80,8 @@ in stdenv.mkDerivation rec {
|
|||||||
ANDROID_ABI_INCLUDE = androidAbiInclude;
|
ANDROID_ABI_INCLUDE = androidAbiInclude;
|
||||||
|
|
||||||
# Android SDK/NDK for use by Gradle
|
# Android SDK/NDK for use by Gradle
|
||||||
ANDROID_SDK_ROOT = "${androidPkgs}";
|
ANDROID_SDK_ROOT = "${androidPkgs.sdk}";
|
||||||
ANDROID_NDK_ROOT = "${androidPkgs}/ndk-bundle";
|
ANDROID_NDK_ROOT = "${androidPkgs.ndk}";
|
||||||
|
|
||||||
# Used by the Android Gradle build script in android/build.gradle
|
# Used by the Android Gradle build script in android/build.gradle
|
||||||
STATUS_GO_ANDROID_LIBDIR = "${status-go}";
|
STATUS_GO_ANDROID_LIBDIR = "${status-go}";
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
#
|
#
|
||||||
# This derivation simply symlinks some stuff to get
|
# This derivation simply symlinks some stuff to get
|
||||||
# shorter paths as libexec/android-sdk is quite the mouthful.
|
# shorter paths as libexec/android-sdk is quite the mouthful.
|
||||||
|
# With this you can just do `androidPkgs.sdk` and `androidPkgs.ndk`.
|
||||||
#
|
#
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "${compose.androidsdk.name}-mod";
|
name = "${compose.androidsdk.name}-mod";
|
||||||
phases = [ "symlinkPhase" ];
|
phases = [ "symlinkPhase" ];
|
||||||
|
outputs = [ "out" "sdk" "ndk" ];
|
||||||
symlinkPhase = ''
|
symlinkPhase = ''
|
||||||
mkdir -p $out
|
ln -s ${compose.androidsdk} $out
|
||||||
ln -s "${compose.androidsdk}/bin" $out/bin
|
ln -s ${compose.androidsdk}/libexec/android-sdk $sdk
|
||||||
for d in ${compose.androidsdk}/libexec/android-sdk/*; do
|
ln -s ${compose.androidsdk}/libexec/android-sdk/ndk-bundle $ndk
|
||||||
ln -s $d $out/$(basename $d)
|
|
||||||
done
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,9 @@ mkShell {
|
|||||||
shellHook = ''
|
shellHook = ''
|
||||||
export JAVA_HOME="${openjdk}"
|
export JAVA_HOME="${openjdk}"
|
||||||
|
|
||||||
export ANDROID_HOME="${androidPkgs}"
|
export ANDROID_HOME="${androidPkgs.sdk}"
|
||||||
export ANDROID_SDK_ROOT="${androidPkgs}"
|
export ANDROID_NDK_ROOT="${androidPkgs.ndk}"
|
||||||
export ANDROID_NDK_ROOT="${androidPkgs}/ndk-bundle"
|
export ANDROID_SDK_ROOT="$ANDROID_HOME"
|
||||||
|
|
||||||
export PATH="$ANDROID_HOME/bin:$PATH"
|
export PATH="$ANDROID_HOME/bin:$PATH"
|
||||||
export PATH="$ANDROID_NDK_ROOT:$PATH"
|
export PATH="$ANDROID_NDK_ROOT:$PATH"
|
||||||
|
@ -40,8 +40,8 @@ buildGo116Module {
|
|||||||
wrapProgram $out/bin/gomobile \
|
wrapProgram $out/bin/gomobile \
|
||||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}" \
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}" \
|
||||||
--prefix PATH : "${androidPkgs}/bin" \
|
--prefix PATH : "${androidPkgs}/bin" \
|
||||||
--set ANDROID_NDK_HOME "${androidPkgs}/ndk-bundle" \
|
--set ANDROID_NDK_ROOT "${androidPkgs.ndk}" \
|
||||||
--set ANDROID_HOME "${androidPkgs}"
|
--set ANDROID_HOME "${androidPkgs.sdk}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -46,10 +46,9 @@ in buildGo116Package {
|
|||||||
export GO111MODULE=off
|
export GO111MODULE=off
|
||||||
export GOPATH=${gomobile}:$GOPATH
|
export GOPATH=${gomobile}:$GOPATH
|
||||||
export NIX_GOWORKDIR=${NIX_GOWORKDIR}
|
export NIX_GOWORKDIR=${NIX_GOWORKDIR}
|
||||||
|
|
||||||
'' + optionalString (platform == "android") ''
|
'' + optionalString (platform == "android") ''
|
||||||
export ANDROID_HOME=${androidPkgs}
|
export ANDROID_SDK_ROOT="${androidPkgs.sdk}"
|
||||||
export ANDROID_NDK_HOME=${androidPkgs}/ndk-bundle
|
export ANDROID_NDK_HOME="${androidPkgs.ndk}"
|
||||||
export PATH="${makeBinPath [ openjdk ]}:$PATH"
|
export PATH="${makeBinPath [ openjdk ]}:$PATH"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user