2022-12-02 18:03:35 +00:00
|
|
|
{
|
|
|
|
/* This should match Nixpkgs commit in status-mobile. */
|
|
|
|
source ? builtins.fetchTarball {
|
2023-06-30 09:13:16 +00:00
|
|
|
url = "https://github.com/NixOS/nixpkgs/archive/e7603eba51f2c7820c0a182c6bbb351181caa8e7.tar.gz";
|
|
|
|
sha256 = "sha256:0mwck8jyr74wh1b7g6nac1mxy6a0rkppz8n12andsffybsipz5jw";
|
2022-12-02 18:03:35 +00:00
|
|
|
},
|
|
|
|
pkgs ? import (source){
|
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
android_sdk.accept_license = true;
|
|
|
|
};
|
|
|
|
overlays = [
|
2024-01-18 18:54:54 +00:00
|
|
|
(self: super: {
|
|
|
|
androidPkgs = pkgs.androidenv.composeAndroidPackages {
|
2022-12-02 18:03:35 +00:00
|
|
|
toolsVersion = "26.1.1";
|
2023-05-04 11:31:40 +00:00
|
|
|
platformToolsVersion = "33.0.3";
|
2022-12-02 18:03:35 +00:00
|
|
|
buildToolsVersions = [ "31.0.0" ];
|
|
|
|
platformVersions = [ "31" ];
|
|
|
|
cmakeVersions = [ "3.18.1" ];
|
|
|
|
ndkVersion = "22.1.7171670";
|
|
|
|
includeNDK = true;
|
|
|
|
includeExtras = [
|
|
|
|
"extras;android;m2repository"
|
|
|
|
"extras;google;m2repository"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}:
|
|
|
|
|
2023-01-16 13:32:56 +00:00
|
|
|
let
|
|
|
|
inherit (pkgs) lib stdenv;
|
|
|
|
|
|
|
|
/* No Android SDK for Darwin aarch64. */
|
|
|
|
isMacM1 = stdenv.isDarwin && stdenv.isAarch64;
|
|
|
|
/* Lock requires Xcode verison. */
|
2023-05-04 11:31:40 +00:00
|
|
|
xcodeWrapper = pkgs.xcodeenv.composeXcodeWrapper {
|
|
|
|
version = "14.3";
|
|
|
|
allowHigher = true;
|
|
|
|
};
|
2023-01-16 13:32:56 +00:00
|
|
|
/* Gomobile also needs the Xcode wrapper. */
|
|
|
|
gomobileMod = pkgs.gomobile.override {
|
|
|
|
inherit xcodeWrapper;
|
|
|
|
withAndroidPkgs = !isMacM1;
|
|
|
|
};
|
|
|
|
in pkgs.mkShell {
|
2022-12-02 18:03:35 +00:00
|
|
|
name = "status-go-shell";
|
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
git jq which
|
2024-01-18 18:54:54 +00:00
|
|
|
go_1_19 golangci-lint go-junit-report gopls go-bindata gomobileMod
|
2023-06-30 09:13:16 +00:00
|
|
|
mockgen protobuf3_20 protoc-gen-go
|
2023-01-16 13:32:56 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin xcodeWrapper;
|
2022-12-02 18:03:35 +00:00
|
|
|
|
2023-01-16 13:32:56 +00:00
|
|
|
shellHook = lib.optionalString (!isMacM1) ''
|
|
|
|
ANDROID_HOME=${pkgs.androidPkgs.androidsdk}/libexec/android-sdk
|
|
|
|
ANDROID_NDK=$ANDROID_HOME/ndk-bundle
|
2022-12-02 18:03:35 +00:00
|
|
|
ANDROID_SDK_ROOT=$ANDROID_HOME
|
|
|
|
ANDROID_NDK_HOME=$ANDROID_NDK
|
|
|
|
'';
|
2023-01-03 14:58:17 +00:00
|
|
|
|
|
|
|
# Sandbox causes Xcode issues on MacOS. Requires sandbox=relaxed.
|
|
|
|
# https://github.com/status-im/status-mobile/pull/13912
|
2023-01-16 13:32:56 +00:00
|
|
|
__noChroot = stdenv.isDarwin;
|
2024-01-18 18:54:54 +00:00
|
|
|
}
|