2022-05-26 09:11:34 +00:00
|
|
|
{ lib, callPackage, mkShell }:
|
2019-03-25 16:35:01 +00:00
|
|
|
|
|
|
|
let
|
2023-06-27 11:45:21 +00:00
|
|
|
inherit (lib) getEnvWithDefault attrValues mapAttrs;
|
2020-04-23 18:19:12 +00:00
|
|
|
|
|
|
|
# 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;
|
2022-08-24 13:12:42 +00:00
|
|
|
# FIXME: This should be moved to status-go config.
|
2023-06-27 11:45:21 +00:00
|
|
|
IpfsGatewayURL = getEnvWithDefault "STATUS_GO_IPFS_GATEWAY_URL" "https://ipfs.status.im/";
|
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
|
|
|
|
];
|
2020-04-23 18:19:12 +00:00
|
|
|
in rec {
|
|
|
|
mobile = callPackage ./mobile {
|
2022-06-07 18:38:24 +00:00
|
|
|
inherit meta source goBuildLdFlags;
|
2019-03-25 16:35:01 +00:00
|
|
|
};
|
2019-04-12 07:38:08 +00:00
|
|
|
|
2022-05-19 15:50:41 +00:00
|
|
|
library = callPackage ./library {
|
|
|
|
inherit meta source;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
}
|