1{
2 buildPythonPackage,
3 lib,
4 fetchFromGitHub,
5 absl-py,
6 future,
7 mock,
8 mpyq,
9 numpy,
10 portpicker,
11 protobuf,
12 pygame,
13 s2clientprotocol,
14 six,
15 websocket-client,
16 sc2-headless,
17}:
18
19buildPythonPackage rec {
20 pname = "pysc2";
21 version = "4.0";
22 format = "setuptools";
23
24 src = fetchFromGitHub {
25 owner = "deepmind";
26 repo = "pysc2";
27 tag = "v${version}";
28 sha256 = "sha256-70Uqs30Dyq1u+e1CTR8mO/rzZangBvgY0ah2l7VJLhQ=";
29 };
30
31 patches = [
32 ./fix-setup-for-py3.patch
33 ./parameterize-runconfig-sc2path.patch
34 ];
35
36 postPatch = ''
37 substituteInPlace "./pysc2/run_configs/platforms.py" \
38 --subst-var-by 'sc2path' '${sc2-headless}'
39 '';
40
41 propagatedBuildInputs = [
42 absl-py
43 future
44 mock
45 mpyq
46 numpy
47 portpicker
48 protobuf
49 pygame
50 s2clientprotocol
51 six
52 websocket-client
53 sc2-headless
54 ];
55
56 meta = {
57 changelog = "https://github.com/google-deepmind/pysc2/releases/tag/${src.tag}";
58 description = "Starcraft II environment and library for training agents";
59 homepage = "https://github.com/deepmind/pysc2";
60 license = lib.licenses.asl20;
61 platforms = lib.platforms.linux;
62 maintainers = [ ];
63 };
64}