summaryrefslogtreecommitdiff
path: root/meta/nix/pkgs/blockgame-meta.nix
blob: fe95ffe67ef342d38f2af49eab450db1aed6b354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
  lib,
  buildPythonApplication,
  poetry-core,
  bash,
  cachecontrol,
  requests,
  filelock,
  git,
  openssh,
  packaging,
  pydantic_1,
  python,
  rsync,
}:
buildPythonApplication {
  pname = "blockgame-meta";
  version = "unstable";

  pyproject = true;

  src = with lib.fileset;
    toSource {
      root = ../../.;
      fileset = unions (map (fileName: ../../${fileName}) [
        "meta"
        "init.sh"
        "pyproject.toml"
        "poetry.lock"
        "README.md"
        "update.sh"
      ]);
    };

  nativeBuildInputs = [
    poetry-core
  ];

  buildInputs = [
    bash
  ];

  propagatedBuildInputs = [
    cachecontrol
    requests
    filelock
    packaging
    pydantic_1
  ];

  postInstall = ''
    install -Dm755 $src/update.sh $out/bin/update
    install -Dm755 $src/init.sh $out/bin/init

    wrapProgram $out/bin/update \
      --prefix PYTHONPATH : "$PYTHONPATH" \
      --prefix PATH : ${lib.makeBinPath [git openssh python rsync]}

    wrapProgram $out/bin/init \
      --prefix PATH : ${lib.makeBinPath [git openssh]}
  '';

  meta = with lib; {
    description = "Metadata generator for blockgame launcher.";
    platforms = platforms.linux;
    license = licenses.mspl;
    maintainers = with maintainers; [yongdohyun];
    mainProgram = "update";
  };
}