2023-11-23 14:55:13 +00:00
|
|
|
{ config ? {}
|
|
|
|
, pkgs ? import ./pkgs.nix { inherit config; } }:
|
|
|
|
|
|
|
|
let
|
2024-07-04 11:07:05 +00:00
|
|
|
inherit (pkgs) lib stdenv callPackage;
|
2023-11-23 14:55:13 +00:00
|
|
|
/* No Android SDK for Darwin aarch64. */
|
|
|
|
isMacM1 = stdenv.isDarwin && stdenv.isAarch64;
|
2024-07-04 11:07:05 +00:00
|
|
|
|
2023-11-23 14:55:13 +00:00
|
|
|
/* Lock requires Xcode verison. */
|
2024-07-04 11:07:05 +00:00
|
|
|
xcodeWrapper = callPackage ./pkgs/xcodeenv/compose-xcodewrapper.nix { } {
|
|
|
|
versions = ["14.3" "15.1" "15.2" "15.3" "15.4"];
|
2023-11-23 14:55:13 +00:00
|
|
|
};
|
2024-07-04 11:07:05 +00:00
|
|
|
|
2023-11-23 14:55:13 +00:00
|
|
|
/* Gomobile also needs the Xcode wrapper. */
|
|
|
|
gomobileMod = pkgs.gomobile.override {
|
|
|
|
inherit xcodeWrapper;
|
|
|
|
withAndroidPkgs = !isMacM1;
|
|
|
|
};
|
2024-10-25 07:40:47 +00:00
|
|
|
/* Override the default SDK to enable darwin-x86_64 builds */
|
|
|
|
appleSdk11Stdenv = pkgs.overrideSDK pkgs.stdenv "11.0";
|
|
|
|
sdk11mkShell = pkgs.mkShell.override { stdenv = appleSdk11Stdenv; };
|
|
|
|
mkShell = if stdenv.isDarwin then sdk11mkShell else pkgs.mkShell;
|
|
|
|
|
|
|
|
in mkShell {
|
2023-11-23 14:55:13 +00:00
|
|
|
name = "status-go-shell";
|
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
git jq which
|
2024-09-30 11:53:20 +00:00
|
|
|
go golangci-lint go-junit-report gopls go-bindata gomobileMod codecov-cli go-generate-fast
|
2024-05-08 08:25:01 +00:00
|
|
|
mockgen protobuf3_20 protoc-gen-go gotestsum go-modvendor openjdk cc-test-reporter
|
2023-11-23 14:55:13 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin) [ xcodeWrapper ];
|
|
|
|
|
|
|
|
shellHook = lib.optionalString (!isMacM1) ''
|
|
|
|
ANDROID_HOME=${pkgs.androidPkgs.androidsdk}/libexec/android-sdk
|
|
|
|
ANDROID_NDK=$ANDROID_HOME/ndk-bundle
|
|
|
|
ANDROID_SDK_ROOT=$ANDROID_HOME
|
|
|
|
ANDROID_NDK_HOME=$ANDROID_NDK
|
|
|
|
'';
|
|
|
|
# Sandbox causes Xcode issues on MacOS. Requires sandbox=relaxed.
|
|
|
|
# https://github.com/status-im/status-mobile/pull/13912
|
|
|
|
__noChroot = stdenv.isDarwin;
|
|
|
|
}
|
|
|
|
|