about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pysc2/default.nix
blob: 10040928ad244696a0d76d2faab3dd1f38a5db29 (plain) (blame)
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
{ buildPythonPackage
, lib
, fetchFromGitHub
, absl-py
, enum34
, future
, mock
, mpyq
, numpy
, portpicker
, protobuf
, pygame
, s2clientprotocol
, six
, websocket-client
, sc2-headless
}:

buildPythonPackage {
  pname = "PySC2";
  version = "1.2";

  src = fetchFromGitHub {
    owner = "deepmind";
    repo = "pysc2";
    rev = "39f84b01d662eb58b3d95791f59208c210afd4e7";
    sha256 = "0dfbc2krd2rys1ji75ng2nl0ki8nhnylxljcp287bfb8qyz2m25p";
  };

  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
    enum34
    future
    mock
    mpyq
    numpy
    portpicker
    protobuf
    pygame
    s2clientprotocol
    six
    websocket-client
    sc2-headless
  ];

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