1{
2 lib,
3 mkYarnPackage,
4 fetchFromGitHub,
5 fetchYarnDeps,
6}:
7
8mkYarnPackage rec {
9 pname = "react-static";
10 version = "7.6.2";
11
12 src = fetchFromGitHub {
13 owner = "react-static";
14 repo = "react-static";
15 rev = "v${version}";
16 hash = "sha256-dlYmD0vgEqWxYf7E0VYstZMAuNDGvQP7xDgHo/wmlUs=";
17 };
18
19 packageJSON = ./package.json;
20
21 offlineCache = fetchYarnDeps {
22 yarnLock = "${src}/yarn.lock";
23 hash = "sha256-SNnJPUzv+l2HXfA6NKYpJvn/DCX3a42JQ3N0+XYKbd8=";
24 };
25
26 buildPhase = ''
27 runHook preBuild
28
29 yarn --cwd deps/react-static/packages/react-static --offline build
30
31 runHook postBuild
32 '';
33
34 doDist = false;
35
36 installPhase = ''
37 runHook preInstall
38
39 mkdir -p "$out/lib/node_modules"
40 mv deps/react-static/packages/react-static "$out/lib/node_modules"
41 mv node_modules "$out/lib/node_modules/react-static"
42
43 ln -s "$out/lib/node_modules/react-static/bin" "$out"
44
45 runHook postInstall
46 '';
47
48 meta = {
49 changelog = "https://github.com/react-static/react-static/blob/${src.rev}/CHANGELOG.md";
50 description = "Progressive static site generator for React";
51 homepage = "https://github.com/react-static/react-static";
52 license = lib.licenses.mit;
53 mainProgram = "react-static";
54 maintainers = [ ];
55 };
56}