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