2019-04-03 11:06:42 +00:00
{ system ? builtins . currentSystem
2019-04-11 12:48:53 +00:00
, config ? { android_sdk . accept_license = true ; } , overlays ? [ ]
2019-04-03 11:06:42 +00:00
, pkgs ? ( import <nixpkgs> { inherit system config overlays ; } )
, target-os } :
with pkgs ;
let
2019-05-02 18:13:16 +00:00
platform = callPackage ./nix/platform.nix { inherit target-os ; } ;
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 ;
2019-05-08 15:07:06 +00:00
statusDesktop = callPackage ./nix/desktop { inherit target-os status-go ; stdenv = _stdenv ; } ;
statusMobile = callPackage ./nix/mobile { inherit target-os config status-go ; stdenv = _stdenv ; } ;
2019-05-02 18:13:16 +00:00
status-go = callPackage ./nix/status-go { inherit target-os ; inherit ( xcodeenv ) composeXcodeWrapper ; inherit ( statusMobile ) xcodewrapperArgs ; androidPkgs = statusMobile . androidComposition ; } ;
nodejs' = nodejs-10_x ;
2019-04-11 15:04:43 +00:00
yarn' = yarn . override { nodejs = nodejs' ; } ;
2019-04-03 11:06:42 +00:00
nodeInputs = import ./nix/global-node-packages/output {
# The remaining dependencies come from Nixpkgs
2019-04-11 15:04:43 +00:00
inherit pkgs ;
nodejs = nodejs' ;
2019-04-03 11:06:42 +00:00
} ;
2019-04-11 15:04:43 +00:00
nodePkgBuildInputs = [
nodejs'
2019-04-03 11:06:42 +00:00
python27 # for e.g. gyp
2019-04-11 15:04:43 +00:00
yarn'
2019-05-08 15:07:06 +00:00
] ++ ( builtins . attrValues nodeInputs ) ;
2019-04-03 11:06:42 +00:00
in _stdenv . mkDerivation rec {
name = " s t a t u s - r e a c t - b u i l d - e n v " ;
buildInputs = with _stdenv ; [
clojure
leiningen
maven
watchman
2019-05-08 15:07:06 +00:00
] ++ nodePkgBuildInputs
2019-04-03 11:06:42 +00:00
++ lib . optional isDarwin cocoapods
2019-05-07 06:43:53 +00:00
++ lib . optional ( isDarwin && ! platform . targetIOS ) clang
2019-04-03 11:06:42 +00:00
++ lib . optional ( ! isDarwin ) gcc7
2019-05-02 18:13:16 +00:00
++ lib . optionals platform . targetDesktop statusDesktop . buildInputs
++ lib . optionals platform . targetMobile statusMobile . buildInputs ;
2019-04-03 11:06:42 +00:00
shellHook =
2019-05-02 18:13:16 +00:00
lib . optionalString platform . targetDesktop statusDesktop . shellHook +
lib . optionalString platform . targetMobile statusMobile . shellHook ;
2019-04-03 11:06:42 +00:00
}