2019-06-04 16:50:29 +00:00
{ config , stdenv , stdenvNoCC , callPackage , mkShell ,
xcodeWrapper , mkFilter , fetchurl , nodejs , bash , zlib , procps ,
status-go , projectNodePackage } :
let
inherit ( stdenv . lib ) catAttrs concatStrings unique ;
createMobileFilesSymlinks = root : ''
# Set up symlinks to mobile enviroment in project root
ln - sf $ { root } /mobile_files/package.json.orig $ { root } /package.json
ln - sf $ { root } /mobile_files/metro.config.js $ { root } /metro.config.js
ln - sf $ { root } /mobile_files/yarn.lock $ { root } /yarn.lock
'' ;
src =
let path = ./../../.. ;
in builtins . path { # We use builtins.path so that we can name the resulting derivation, otherwise the name would be taken from the checkout directory, which is outside of our control
inherit path ;
2019-07-15 16:34:33 +00:00
name = " s t a t u s - r e a c t - s o u r c e - n p m - d e p s " ;
2019-06-04 16:50:29 +00:00
filter =
# Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size
mkFilter {
dirRootsToInclude = [ " m o b i l e _ f i l e s " ] ;
dirsToExclude = [ " . g i t " " . s v n " " C V S " " . h g " ] ;
filesToInclude = [ " . b a b e l r c " ] ;
root = path ;
} ;
} ;
selectedSources = [ status-go ] ;
# TARGETS
shell = mkShell {
buildInputs = [ xcodeWrapper ] ;
} ;
in {
inherit xcodeWrapper ;
buildInputs = unique ( [ xcodeWrapper procps ] ++ catAttrs " b u i l d I n p u t s " selectedSources ) ;
shellHook = ''
$ { status-go . shellHook }
$ { createMobileFilesSymlinks " $ S T A T U S _ R E A C T _ H O M E " }
$ STATUS_REACT_HOME/nix/mobile/reset-node_modules.sh " ${ projectNodePackage } " && \
$ STATUS_REACT_HOME/nix/mobile/ios/install-pods-and-status-go.sh || \
exit
'' ;
# TARGETS
inherit shell ;
}