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 ;
2019-06-11 09:44:17 +00:00
go = pkgs . go_1_11 ;
buildGoPackage = pkgs . buildGoPackage . override { inherit go ; } ;
2019-05-22 16:04:45 +00:00
statusDesktop = pkgs . callPackage ./nix/desktop { inherit target-os status-go pkgs ; inherit ( pkgs ) darwin ; stdenv = stdenv' ; nodejs = nodejs' ; } ;
statusMobile = pkgs . callPackage ./nix/mobile { inherit target-os config pkgs status-go gradle ; inherit ( pkgs . xcodeenv ) composeXcodeWrapper ; stdenv = stdenv' ; nodejs = nodejs' ; } ;
2019-06-11 09:44:17 +00:00
status-go = pkgs . callPackage ./nix/status-go { inherit target-os go buildGoPackage ; inherit ( pkgs . xcodeenv ) composeXcodeWrapper ; inherit ( statusMobile ) xcodewrapperArgs ; androidPkgs = statusMobile . androidComposition ; } ;
2019-05-17 08:55:24 +00:00
nodejs' = pkgs . nodejs-10_x ;
yarn' = pkgs . yarn . override { nodejs = nodejs' ; } ;
nodePkgBuildInputs = [
nodejs'
pkgs . python27 # for e.g. gyp
yarn'
2019-05-22 16:04:45 +00:00
] ;
2019-05-17 08:55:24 +00:00
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 ) ;
}