2020-05-07 10:21:39 +00:00
|
|
|
{ lib, pkgs, deps, callPackage, mkShell
|
2020-05-18 10:15:49 +00:00
|
|
|
, status-go, androidPkgs, androidShell }:
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
let
|
2019-11-29 10:20:08 +00:00
|
|
|
# Import a jsbundle compiled out of clojure codebase
|
2020-05-06 10:29:02 +00:00
|
|
|
jsbundle = callPackage ./jsbundle { };
|
2019-06-04 16:50:29 +00:00
|
|
|
|
2019-09-10 09:50:09 +00:00
|
|
|
# Import a patched version of watchman (important for sandboxed builds on macOS)
|
|
|
|
watchmanFactory = callPackage ./watchman.nix { };
|
|
|
|
|
2019-06-04 16:50:29 +00:00
|
|
|
# TARGETS
|
2020-05-07 10:21:39 +00:00
|
|
|
release = callPackage ./release.nix {
|
2020-05-18 10:15:49 +00:00
|
|
|
inherit jsbundle status-go watchmanFactory;
|
2019-06-04 16:50:29 +00:00
|
|
|
};
|
|
|
|
|
2019-11-29 10:20:08 +00:00
|
|
|
in {
|
2019-06-04 16:50:29 +00:00
|
|
|
# TARGETS
|
2020-05-18 10:15:49 +00:00
|
|
|
inherit release jsbundle;
|
2020-05-05 22:48:50 +00:00
|
|
|
|
|
|
|
shell = mkShell {
|
|
|
|
buildInputs = with pkgs; [
|
2020-05-06 13:33:54 +00:00
|
|
|
openjdk
|
|
|
|
gradle
|
2020-05-05 22:48:50 +00:00
|
|
|
lsof # used in start-react-native.sh
|
2020-05-07 10:21:39 +00:00
|
|
|
flock # used in nix/scripts/node_modules.sh
|
2020-05-05 22:48:50 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
inputsFrom = [
|
|
|
|
release
|
|
|
|
androidShell
|
|
|
|
];
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
export ANDROID_SDK_ROOT="${androidPkgs}"
|
|
|
|
export ANDROID_NDK_ROOT="${androidPkgs}/ndk-bundle"
|
|
|
|
|
2020-05-07 10:21:39 +00:00
|
|
|
export STATUSREACT_NIX_MAVEN_REPO="${deps.gradle}"
|
2020-05-07 10:21:39 +00:00
|
|
|
|
2020-05-05 22:48:50 +00:00
|
|
|
# required by some makefile targets
|
|
|
|
export STATUS_GO_ANDROID_LIBDIR=${status-go}
|
|
|
|
|
2020-05-07 10:21:39 +00:00
|
|
|
{
|
|
|
|
cd "$STATUS_REACT_HOME"
|
|
|
|
|
|
|
|
# Set up symlinks to mobile enviroment in project root
|
|
|
|
ln -sf ./mobile/js_files/* ./
|
|
|
|
|
|
|
|
# check if node modules changed and if so install them
|
2020-05-18 10:15:49 +00:00
|
|
|
$STATUS_REACT_HOME/nix/scripts/node_modules.sh ${deps.nodejs-patched}
|
2020-05-07 10:21:39 +00:00
|
|
|
}
|
2020-05-05 22:48:50 +00:00
|
|
|
'';
|
|
|
|
};
|
2019-06-04 16:50:29 +00:00
|
|
|
}
|