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 } :
2019-05-17 08:55:24 +00:00
let
platform = pkgs . callPackage ./nix/platform.nix { inherit target-os ; } ;
# 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' = pkgs . stdenvNoCC ;
gradle = pkgs . gradle_4_10 ;
statusDesktop = pkgs . callPackage ./nix/desktop { inherit target-os status-go ; inherit ( pkgs ) darwin ; stdenv = stdenv' ; } ;
statusMobile = pkgs . callPackage ./nix/mobile { inherit target-os config status-go gradle ; inherit ( pkgs . xcodeenv ) composeXcodeWrapper ; stdenv = stdenv' ; } ;
status-go = pkgs . callPackage ./nix/status-go { inherit target-os ; inherit ( pkgs . xcodeenv ) composeXcodeWrapper ; inherit ( statusMobile ) xcodewrapperArgs ; androidPkgs = statusMobile . androidComposition ; } ;
nodejs' = pkgs . nodejs-10_x ;
yarn' = pkgs . yarn . override { nodejs = nodejs' ; } ;
nodeInputs = import ./nix/global-node-packages/output {
# The remaining dependencies come from Nixpkgs
inherit pkgs ;
nodejs = nodejs' ;
} ;
nodePkgBuildInputs = [
nodejs'
pkgs . python27 # for e.g. gyp
yarn'
] ++ ( builtins . attrValues nodeInputs ) ;
selectedSources =
stdenv' . lib . optional platform . targetDesktop statusDesktop ++
stdenv' . lib . optional platform . targetMobile statusMobile ;
2019-04-03 11:06:42 +00:00
2019-05-17 08:55:24 +00:00
in with stdenv' ; stdenv' . mkDerivation rec {
name = " s t a t u s - r e a c t - b u i l d - e n v " ;
2019-04-03 11:06:42 +00:00
2019-05-17 08:55:24 +00:00
buildInputs = with pkgs ; [
clojure
leiningen
maven
watchman
] ++ nodePkgBuildInputs
++ lib . optional isDarwin cocoapods
++ lib . optional ( isDarwin && ! platform . targetIOS ) clang
++ lib . optional ( ! isDarwin ) gcc7
++ lib . catAttrs " b u i l d I n p u t s " selectedSources ;
shellHook = lib . concatStrings ( lib . catAttrs " s h e l l H o o k " selectedSources ) ;
}