1{
2 lib,
3 stdenvNoCC,
4 fetchFromGitHub,
5 fetchYarnDeps,
6 yarnConfigHook,
7 yarnBuildHook,
8 nodejs,
9 jq,
10}:
11stdenvNoCC.mkDerivation (finalAttrs: {
12 pname = "eas-cli";
13 version = "16.4.0";
14
15 src = fetchFromGitHub {
16 owner = "expo";
17 repo = "eas-cli";
18 rev = "v${finalAttrs.version}";
19 hash = "sha256-cHayMBhqiLY//t/ljjwJm4qMuVn531z7x2cqJE4z6hQ=";
20 };
21
22 yarnOfflineCache = fetchYarnDeps {
23 yarnLock = finalAttrs.src + "/yarn.lock"; # Point to the root lockfile
24 hash = "sha256-qDUwAdShpKjIUyYvtA6/hgGdO1z1xLqdsJkL3oqkMSw=";
25 };
26
27 nativeBuildInputs = [
28 yarnConfigHook
29 yarnBuildHook
30 nodejs
31 jq
32 ];
33
34 # yarnInstallHook strips out build outputs within packages/eas-cli resulting in most commands missing from eas-cli.
35 installPhase = ''
36 runHook preInstall
37
38 mkdir -p $out/lib/node_modules/eas-cli-root
39 cp -r . $out/lib/node_modules/eas-cli-root
40
41 runHook postInstall
42 '';
43
44 # postFixup is used to override the symlink created in the fixupPhase
45 postFixup = ''
46 mkdir -p $out/bin
47 ln -sf $out/lib/node_modules/eas-cli-root/packages/eas-cli/bin/run $out/bin/eas
48 '';
49
50 meta = {
51 changelog = "https://github.com/expo/eas-cli/releases/tag/v${finalAttrs.version}";
52 description = "EAS command line tool from submodule";
53 homepage = "https://github.com/expo/eas-cli";
54 license = lib.licenses.mit;
55 maintainers = with lib.maintainers; [ zestsystem ];
56 };
57})