2020-04-23 18:19:12 +00:00
|
|
|
{ lib, callPackage, mkShell, openjdk, androidPkgs }:
|
2019-03-25 16:35:01 +00:00
|
|
|
|
|
|
|
let
|
2020-04-23 18:19:12 +00:00
|
|
|
inherit (lib)
|
|
|
|
catAttrs concatStrings concatStringsSep fileContents makeBinPath
|
|
|
|
getConfig optional attrValues mapAttrs attrByPath;
|
|
|
|
|
|
|
|
# Metadata common to all builds of status-go
|
|
|
|
meta = {
|
|
|
|
description = "The Status Go module that consumes go-ethereum.";
|
|
|
|
license = lib.licenses.mpl20;
|
|
|
|
platforms = with lib.platforms; linux ++ darwin;
|
2019-04-09 20:04:45 +00:00
|
|
|
};
|
2019-05-02 18:13:16 +00:00
|
|
|
|
2020-04-23 18:19:12 +00:00
|
|
|
# Source can be changed with a local override from config
|
|
|
|
source = callPackage ./source.nix { };
|
|
|
|
|
|
|
|
# Params to be set at build time, important for About section and metrics
|
2019-10-22 11:56:13 +00:00
|
|
|
goBuildParams = {
|
2020-04-23 18:19:12 +00:00
|
|
|
GitCommit = source.rev;
|
|
|
|
Version = source.cleanVersion;
|
2019-10-22 11:56:13 +00:00
|
|
|
};
|
2020-04-23 18:19:12 +00:00
|
|
|
|
2019-10-22 11:56:13 +00:00
|
|
|
# These are necessary for status-go to show correct version
|
|
|
|
paramsLdFlags = attrValues (mapAttrs (name: value:
|
|
|
|
"-X github.com/status-im/status-go/params.${name}=${value}"
|
|
|
|
) goBuildParams);
|
|
|
|
|
|
|
|
goBuildLdFlags = paramsLdFlags ++ [
|
|
|
|
"-s" # -s disabled symbol table
|
|
|
|
"-w" # -w disables DWARF debugging information
|
|
|
|
];
|
2019-03-25 16:35:01 +00:00
|
|
|
|
2020-04-23 18:19:12 +00:00
|
|
|
goBuildFlags = [ "-v" ];
|
2019-05-02 18:13:16 +00:00
|
|
|
|
2020-04-23 18:19:12 +00:00
|
|
|
in rec {
|
|
|
|
mobile = callPackage ./mobile {
|
|
|
|
inherit meta source goBuildFlags goBuildLdFlags;
|
2019-03-25 16:35:01 +00:00
|
|
|
};
|
2019-04-12 07:38:08 +00:00
|
|
|
|
2020-05-15 10:19:51 +00:00
|
|
|
shell = mkShell {
|
2020-07-01 19:45:39 +00:00
|
|
|
inputsFrom = [ mobile.android mobile.ios ];
|
2020-05-15 10:19:51 +00:00
|
|
|
};
|
2019-03-25 16:35:01 +00:00
|
|
|
}
|