nix: Move status-go package further down where it is actually used

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2019-05-08 17:07:06 +02:00
parent 84dc94f895
commit a09ff50583
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
5 changed files with 31 additions and 21 deletions

View File

@ -8,8 +8,8 @@ with pkgs;
platform = callPackage ./nix/platform.nix { inherit target-os; }; platform = 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) # 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; _stdenv = stdenvNoCC;
statusDesktop = callPackage ./nix/desktop { inherit target-os; stdenv = _stdenv; }; statusDesktop = callPackage ./nix/desktop { inherit target-os status-go; stdenv = _stdenv; };
statusMobile = callPackage ./nix/mobile { inherit target-os config; stdenv = _stdenv; }; statusMobile = callPackage ./nix/mobile { inherit target-os config status-go; stdenv = _stdenv; };
status-go = callPackage ./nix/status-go { inherit target-os; inherit (xcodeenv) composeXcodeWrapper; inherit (statusMobile) xcodewrapperArgs; androidPkgs = statusMobile.androidComposition; }; status-go = callPackage ./nix/status-go { inherit target-os; inherit (xcodeenv) composeXcodeWrapper; inherit (statusMobile) xcodewrapperArgs; androidPkgs = statusMobile.androidComposition; };
nodejs' = nodejs-10_x; nodejs' = nodejs-10_x;
yarn' = yarn.override { nodejs = nodejs'; }; yarn' = yarn.override { nodejs = nodejs'; };
@ -22,7 +22,7 @@ with pkgs;
nodejs' nodejs'
python27 # for e.g. gyp python27 # for e.g. gyp
yarn' yarn'
] ++ (map (x: nodeInputs."${x}") (builtins.attrNames nodeInputs)); ] ++ (builtins.attrValues nodeInputs);
in _stdenv.mkDerivation rec { in _stdenv.mkDerivation rec {
name = "status-react-build-env"; name = "status-react-build-env";
@ -32,15 +32,13 @@ with pkgs;
leiningen leiningen
maven maven
watchman watchman
] ++ status-go.packages ] ++ nodePkgBuildInputs
++ nodePkgBuildInputs
++ lib.optional isDarwin cocoapods ++ lib.optional isDarwin cocoapods
++ lib.optional (isDarwin && !platform.targetIOS) clang ++ lib.optional (isDarwin && !platform.targetIOS) clang
++ lib.optional (!isDarwin) gcc7 ++ lib.optional (!isDarwin) gcc7
++ lib.optionals platform.targetDesktop statusDesktop.buildInputs ++ lib.optionals platform.targetDesktop statusDesktop.buildInputs
++ lib.optionals platform.targetMobile statusMobile.buildInputs; ++ lib.optionals platform.targetMobile statusMobile.buildInputs;
shellHook = shellHook =
status-go.shellHook +
lib.optionalString platform.targetDesktop statusDesktop.shellHook + lib.optionalString platform.targetDesktop statusDesktop.shellHook +
lib.optionalString platform.targetMobile statusMobile.shellHook; lib.optionalString platform.targetMobile statusMobile.shellHook;
} }

View File

@ -1,12 +1,12 @@
{ stdenv, pkgs, target-os }: { stdenv, pkgs, target-os, status-go }:
with pkgs; with pkgs;
with stdenv; with stdenv;
let let
platform = callPackage ../platform.nix { inherit target-os; }; platform = callPackage ../platform.nix { inherit target-os; };
linuxPlatform = callPackage ./linux { }; linuxPlatform = callPackage ./linux { inherit status-go; };
darwinPlatform = callPackage ./macos { }; darwinPlatform = callPackage ./macos { inherit status-go; };
windowsPlatform = callPackage ./windows { }; windowsPlatform = callPackage ./windows { };
snoreNotifySources = callPackage ./cmake/snorenotify { }; snoreNotifySources = callPackage ./cmake/snorenotify { };
qtkeychainSources = callPackage ./cmake/qtkeychain { }; qtkeychainSources = callPackage ./cmake/qtkeychain { };

View File

@ -1,4 +1,4 @@
{ stdenv, pkgs }: { stdenv, pkgs, status-go }:
with pkgs; with pkgs;
with stdenv; with stdenv;
@ -11,7 +11,14 @@ let
linuxdeployqt = callPackage ./linuxdeployqt { inherit appimagekit; }; linuxdeployqt = callPackage ./linuxdeployqt { inherit appimagekit; };
in { in {
buildInputs = [ appimagekit linuxdeployqt patchelf baseImage ]; buildInputs = [
appimagekit
linuxdeployqt
patchelf
baseImage
] ++ status-go.packages;
inherit (baseImage) shellHook; shellHook =
baseImage.shellHook +
status-go.shellHook;
} }

View File

@ -1,4 +1,4 @@
{ stdenv, pkgs }: { stdenv, pkgs, status-go }:
with pkgs; with pkgs;
with stdenv; with stdenv;
@ -11,11 +11,14 @@ let
in in
{ {
buildInputs = [ baseImage ] ++ buildInputs = [
[ AppKit Cocoa darwin.cf-private Foundation OpenGL ]; baseImage status-go.packages
AppKit Cocoa darwin.cf-private Foundation OpenGL
];
shellHook = '' shellHook =
${baseImage.shellHook} baseImage.shellHook +
status-go.shellHook + ''
export NIX_TARGET_LDFLAGS="-F${CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_TARGET_LDFLAGS" export NIX_TARGET_LDFLAGS="-F${CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_TARGET_LDFLAGS"
''; '';
} }

View File

@ -1,4 +1,4 @@
{ config, stdenv, pkgs, target-os ? "all" }: { config, stdenv, pkgs, target-os ? "all", status-go }:
with pkgs; with pkgs;
with stdenv; with stdenv;
@ -18,8 +18,10 @@ in
inherit xcodewrapperArgs; inherit xcodewrapperArgs;
buildInputs = buildInputs =
lib.optional platform.targetAndroid android.buildInputs ++ status-go.packages ++
lib.optionals platform.targetAndroid android.buildInputs ++
lib.optional (platform.targetIOS && isDarwin) xcodeWrapper; lib.optional (platform.targetIOS && isDarwin) xcodeWrapper;
shellHook = shellHook =
status-go.shellHook +
lib.optionalString platform.targetAndroid android.shellHook; lib.optionalString platform.targetAndroid android.shellHook;
} }