summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pysc2/default.nix
blob: 307bff567d3b869755eb14a5563136f63178aa00 (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
{
  buildPythonPackage,
  lib,
  fetchFromGitHub,
  absl-py,
  future,
  mock,
  mpyq,
  numpy,
  portpicker,
  protobuf,
  pygame,
  s2clientprotocol,
  six,
  websocket-client,
  sc2-headless,
}:

buildPythonPackage rec {
  pname = "pysc2";
  version = "4.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "deepmind";
    repo = "pysc2";
    tag = "v${version}";
    sha256 = "sha256-70Uqs30Dyq1u+e1CTR8mO/rzZangBvgY0ah2l7VJLhQ=";
  };

  patches = [
    ./fix-setup-for-py3.patch
    ./parameterize-runconfig-sc2path.patch
  ];

  postPatch = ''
    substituteInPlace "./pysc2/run_configs/platforms.py" \
      --subst-var-by 'sc2path' '${sc2-headless}'
  '';

  propagatedBuildInputs = [
    absl-py
    future
    mock
    mpyq
    numpy
    portpicker
    protobuf
    pygame
    s2clientprotocol
    six
    websocket-client
    sc2-headless
  ];

  meta = {
    changelog = "https://github.com/google-deepmind/pysc2/releases/tag/${src.tag}";
    description = "Starcraft II environment and library for training agents";
    homepage = "https://github.com/deepmind/pysc2";
    license = lib.licenses.asl20;
    platforms = lib.platforms.linux;
    maintainers = [ ];
  };
}