2019-04-03 11:06:42 +00:00
{ pkgs ? import <nixpkgs> { } ,
target-os ? " a l l " } :
with pkgs ;
let
projectDeps = import ./default.nix { inherit target-os ; } ;
2019-05-02 18:13:16 +00:00
platform = callPackage ./nix/platform.nix { inherit target-os ; } ;
useFastlanePkg = ( platform . targetAndroid && ! _stdenv . isDarwin ) ;
2019-04-03 11:06:42 +00:00
# TODO: Try to use stdenv for iOS. The problem is with building iOS as the build is trying to pass parameters to Apple's ld that are meant for GNU's ld (e.g. -dynamiclib)
_stdenv = stdenvNoCC ;
_mkShell = mkShell . override { stdenv = _stdenv ; } ;
2019-04-03 20:12:31 +00:00
_fastlane = callPackage ./fastlane {
bundlerEnv = _ : pkgs . bundlerEnv {
name = " f a s t l a n e - g e m s " ;
gemdir = ./fastlane ;
} ;
} ;
2019-04-03 11:06:42 +00:00
in _mkShell {
buildInputs = [
# utilities
bash
curl
2019-04-29 16:33:40 +00:00
file
2019-04-03 11:06:42 +00:00
git
2019-04-29 16:33:40 +00:00
gnumake
2019-04-03 11:06:42 +00:00
jq
ncurses
lsof # used in scripts/start-react-native.sh
ps # used in scripts/start-react-native.sh
unzip
wget
2019-04-03 20:12:31 +00:00
] ++
2019-05-02 18:13:16 +00:00
( if useFastlanePkg then [ _fastlane . package ] else lib . optionals platform . targetMobile [ bundler ruby ] ) ; # bundler/ruby used for fastlane on macOS
2019-04-03 11:06:42 +00:00
inputsFrom = [ projectDeps ] ;
2019-04-12 14:38:08 +00:00
TARGET_OS = target-os ;
2019-04-03 11:06:42 +00:00
shellHook =
''
set - e
2019-04-29 16:33:40 +00:00
STATUS_REACT_HOME = $ ( git rev-parse - - show-toplevel )
2019-04-03 20:12:31 +00:00
$ { projectDeps . shellHook }
$ { lib . optionalString useFastlanePkg _fastlane . shellHook }
2019-04-29 16:33:40 +00:00
if [ ! - f $ STATUS_REACT_HOME/.ran-setup ] ; then
$ STATUS_REACT_HOME/scripts/setup
touch $ STATUS_REACT_HOME/.ran-setup
2019-04-03 11:06:42 +00:00
fi
set + e
'' ;
}