2020-05-07 10:21:39 +00:00
|
|
|
{ lib, pkgs, callPackage, mkShell
|
|
|
|
, status-go, gradle, 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
|
|
|
# Import a local patched version of node_modules, together with a local version of the Maven repo
|
2020-05-05 22:48:50 +00:00
|
|
|
mavenAndNpmDeps = callPackage ./maven-and-npm-deps { };
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
# TARGETS
|
2019-11-29 10:20:08 +00:00
|
|
|
release = callPackage ./targets/release-android.nix {
|
2020-05-05 22:48:50 +00:00
|
|
|
inherit gradle mavenAndNpmDeps 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-07 10:21:39 +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
|
|
|
|
flock # used in reset-node_modules.sh
|
2020-05-07 10:21:39 +00:00
|
|
|
mavenAndNpmDeps
|
2020-05-05 22:48:50 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
inputsFrom = [
|
|
|
|
gradle
|
|
|
|
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="${mavenAndNpmDeps}/.m2/repository"
|
|
|
|
|
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
|
|
|
|
$STATUS_REACT_HOME/nix/mobile/reset-node_modules.sh ${mavenAndNpmDeps}/project
|
|
|
|
}
|
2020-05-05 22:48:50 +00:00
|
|
|
'';
|
|
|
|
};
|
2019-06-04 16:50:29 +00:00
|
|
|
}
|