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 ;
statusDesktop = callPackage ./nix/desktop { inherit target-os ; stdenv = _stdenv ; } ;
2019-05-02 18:13:16 +00:00
statusMobile = callPackage ./nix/mobile { inherit target-os config ; stdenv = _stdenv ; } ;
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-04-03 11:06:42 +00:00
] ++ ( map ( x : nodeInputs . " ${ x } " ) ( builtins . attrNames nodeInputs ) ) ;
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-02 18:13:16 +00:00
] ++ status-go . packages
++ nodePkgBuildInputs
2019-04-03 11:06:42 +00:00
++ lib . optional isDarwin cocoapods
++ 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 =
status-go . 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
}