Merge branch 'master' into staging

* master: (293 commits)
  go_1_9: skip flaky TestServerCancelsReadTimeoutWhenIdle
  qsyncthingtray: fix build
  qt56.qtwebengine: fix build
  stdman: d860212 -> 2017.04.02
  jackett: use mono50
  hg-git: disable with python3
  hg-git: 0.8.5 -> 0.8.10
  xfce4-settings: enable parallel building
  gcc-snapshot: mark as broken
  heaptrack: 2017-02-14 -> 2017-10-30
  nixos-container: Modify existing test to cover show-ip command
  nixos-container: Make show-ip work together with ipv4 + netmask
  linux-copperhead: 4.13.12.a -> 4.13.13.a
  matterbridge: 1.1.0 -> 1.4.1
  nixos/nghttpx: add module for the nghttpx proxy server (#31680)
  mattermost: 4.3.0 -> 4.4.0
  breakpad: delete
  simp_le: 0.2.0 -> 0.6.1
  certbot: 0.11.1 -> 0.19.0
  afl: 2.51b -> 2.52b
  ...
This commit is contained in:
Orivej Desh
2017-11-17 05:35:09 +00:00
349 changed files with 9856 additions and 68183 deletions

View File

@@ -0,0 +1,28 @@
{ buildPythonPackage
, lib
, fetchPypi
, six
}:
buildPythonPackage rec {
pname = "absl-py";
version = "0.1.3";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "017wc85i7l3vpjzw3shgb7k7n0jfid88g09dlf1kgdy4ll0sjfax";
};
propagatedBuildInputs = [ six ];
# checks use bazel; should be revisited
doCheck = false;
meta = {
description = "Abseil Python Common Libraries";
homepage = "https://github.com/abseil/abseil-py";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ danharaj ];
};
}

View File

@@ -1,35 +1,19 @@
{ stdenv, fetchPypi, python, buildPythonPackage, mpi, openssh, isPy3k, isPyPy }:
{ stdenv, fetchPypi, python, buildPythonPackage, mpi }:
buildPythonPackage rec {
pname = "mpi4py";
version = "2.0.0";
version = "3.0.0";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "10fb01595rg17ycz08a23v24akm25d13srsy2rnixam7a5ca0hv5";
sha256 = "1mzgd26dfv4vwbci8gq77ss9f0x26i9aqzq9b9vs9ndxhlnv0mxl";
};
passthru = {
inherit mpi;
};
# Rename libm.so -> libm.so.6 in test
# See: https://bitbucket.org/mpi4py/mpi4py/issues/28/test_dltestdl-test-failure
patches = [
./tests.patch
];
# The tests in the `test_spawn` module fail in the chroot build environment.
# However, they do pass in a pure, or non-pure nix-shell. Hence, we
# deactivate these particular tests.
# Unfortunately, the command-line arguments to `./setup.py test` are not
# correctly passed to the test-runner. Hence, these arguments are patched
# directly into `setup.py`.
prePatch = ''
sed 's/err = main(cmd.args or \[\])/err = main(cmd.args or ["-v", "-e", "test_spawn"])/' -i setup.py
'';
configurePhase = "";
installPhase = ''
@@ -49,14 +33,6 @@ buildPythonPackage rec {
setupPyBuildFlags = ["--mpicc=${mpi}/bin/mpicc"];
buildInputs = [ mpi ];
# Requires openssh for tests. Tests of dependent packages will also fail,
# if openssh is not present. E.g. h5py with mpi support.
propagatedBuildInputs = [ openssh ];
disabled = isPy3k || isPyPy;
# Timing out communicating between processes when sandboxing enabled.
doCheck = false;
meta = {
description =

View File

@@ -0,0 +1,22 @@
{ buildPythonPackage
, lib
, fetchPypi
}:
buildPythonPackage rec {
pname = "mpyq";
version = "0.2.5";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "01q0xh2fy3zzsrfr45d2ypj4whs7s060cy1rnprg6sg55fbgbaih";
};
meta = {
description = "A Python library for extracting MPQ (MoPaQ) files.";
homepage = "https://github.com/eagleflo/mpyq";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ danharaj ];
};
}

View File

@@ -15,15 +15,26 @@ buildPythonPackage rec {
checkInputs = [ pytest git glibcLocales mock ];
propagatedBuildInputs = [ pip click six first setuptools_scm ];
disabledTests = stdenv.lib.concatMapStringsSep " and " (s: "not " + s) [
# Depend on network tests:
"test_editable_package_vcs"
"test_generate_hashes_all_platforms"
"test_generate_hashes_without_interfering_with_each_other"
"test_realistic_complex_sub_dependencies"
# Expect specific version of "six":
"test_editable_package"
"test_input_file_without_extension"
];
checkPhase = ''
export HOME=$(mktemp -d) VIRTUAL_ENV=1
tests_without_network_access="
not test_realistic_complex_sub_dependencies \
and not test_editable_package_vcs \
and not test_generate_hashes_all_platforms \
and not test_generate_hashes_without_interfering_with_each_other \
not test_realistic_complex_sub_dependencies
and not test_editable_package_vcs
and not test_generate_hashes_all_platforms
and not test_generate_hashes_without_interfering_with_each_other
"
py.test -k "$tests_without_network_access"
py.test -k "${disabledTests}"
'';
meta = with stdenv.lib; {

View File

@@ -0,0 +1,22 @@
{ buildPythonPackage
, lib
, fetchPypi
}:
buildPythonPackage rec {
pname = "portpicker";
version = "1.2.0";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "0c1lm3i4yngi1qclb0hny19vwjd2si5k2qni30wcrnxqqasqak1y";
};
meta = {
description = "A library to choose unique available network ports.";
homepage = "https://github.com/google/python_portpicker";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ danharaj ];
};
}

View File

@@ -1,14 +1,13 @@
{ stdenv, lib, writeText, buildPythonPackage, fetchPypi, isPy3k, libpcap, dpkt }:
{ stdenv, lib, writeText, buildPythonPackage, fetchPypi, libpcap, dpkt }:
buildPythonPackage rec {
pname = "pypcap";
version = "1.1.6";
version = "1.2.0";
name = "${pname}-${version}";
disabled = isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "1cx7qm0w2a91g5z8k3kmlwz0b8dkr0h8dlb64rwgyhp2laa33syi";
sha256 = "0n01xjgg8n5mf1cs9yg9ljsx1kvir8cm6wwrd2069fawjxdbk0b9";
};
patches = [
@@ -31,7 +30,8 @@ buildPythonPackage rec {
'')
];
buildInputs = [ libpcap dpkt ];
buildInputs = [ libpcap ];
nativeBuildInputs = [ dpkt ];
meta = {
homepage = https://github.com/pynetwork/pypcap;

View File

@@ -1,5 +1,7 @@
{ lib, fetchurl, pythonPackages, pkgconfig, qtbase, qtsvg, qtwebkit, qtwebengine, dbus_libs
, lndir, makeWrapper, qmake }:
{ lib, fetchurl, pythonPackages, pkgconfig, makeWrapper, qmake
, lndir, qtbase, qtsvg, qtwebkit, qtwebengine, dbus_libs
, withWebSockets ? false, qtwebsockets
}:
let
version = "5.9";
@@ -25,7 +27,7 @@ in buildPythonPackage {
buildInputs = [
lndir qtbase qtsvg qtwebkit qtwebengine dbus_libs
];
] ++ lib.optional withWebSockets qtwebsockets;
propagatedBuildInputs = [ sip ];

View File

@@ -0,0 +1,64 @@
{ buildPythonPackage
, lib
, fetchFromGitHub
, absl-py
, enum34
, future
, futures
, mock
, mpyq
, numpy
, portpicker
, protobuf
, pygame
, s2clientprotocol
, six
, websocket_client
, sc2-headless
}:
buildPythonPackage rec {
version = "1.2";
name = "PySC2-${version}";
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; [ danharaj ];
};
}

View File

@@ -0,0 +1,64 @@
diff --git a/setup.py b/setup.py
index 020768f..13c2b67 100755
--- a/setup.py
+++ b/setup.py
@@ -17,6 +17,8 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
+import sys
+
from setuptools import setup
description = """PySC2 - StarCraft II Learning Environment
@@ -36,6 +38,27 @@ some initial research results using the environment.
Read the README at https://github.com/deepmind/pysc2 for more information.
"""
+requires = [
+ 'absl-py>=0.1.0',
+ 'future',
+ 'mock',
+ 'mpyq',
+ 'numpy>=1.10',
+ 'portpicker>=1.2.0',
+ 'protobuf>=2.6',
+ 'pygame',
+ 's2clientprotocol>=3.19.0.58400.0',
+ 'six',
+ 'websocket-client',
+]
+
+if sys.version_info[0] == 2:
+ requires.append('futures')
+
+if (sys.version_info[0] == 2
+ or (sys.version_info[0] == 3 and sys.version_info[1] < 4)):
+ requires.append('enum34')
+
setup(
name='PySC2',
version='1.2',
@@ -56,21 +79,7 @@ setup(
'pysc2.run_configs',
'pysc2.tests',
],
- install_requires=[
- 'absl-py>=0.1.0',
- 'enum34',
- 'future',
- 'futures',
- 'mock',
- 'mpyq',
- 'numpy>=1.10',
- 'portpicker>=1.2.0',
- 'protobuf>=2.6',
- 'pygame',
- 's2clientprotocol>=3.19.0.58400.0',
- 'six',
- 'websocket-client',
- ],
+ install_requires=requires,
entry_points={
'console_scripts': [
'pysc2_agent = pysc2.bin.agent:entry_point',

View File

@@ -0,0 +1,18 @@
diff --git a/pysc2/run_configs/platforms.py b/pysc2/run_configs/platforms.py
index 5cd84f9..1923cb7 100644
--- a/pysc2/run_configs/platforms.py
+++ b/pysc2/run_configs/platforms.py
@@ -119,12 +119,9 @@ class Linux(LocalBase):
"""Config to run on Linux."""
def __init__(self):
- base_dir = os.environ.get("SC2PATH", "~/StarCraftII")
+ base_dir = os.environ.get("SC2PATH", "@sc2path@")
base_dir = os.path.expanduser(base_dir)
env = copy.deepcopy(os.environ)
- env["LD_LIBRARY_PATH"] = ":".join(filter(None, [
- os.environ.get("LD_LIBRARY_PATH"),
- os.path.join(base_dir, "Libs/")]))
super(Linux, self).__init__(base_dir, "SC2_x64", env=env)
@classmethod

View File

@@ -0,0 +1,19 @@
{ stdenv, buildPythonPackage, fetchPypi, qtpy, six, pyside }:
buildPythonPackage rec {
pname = "QtAwesome";
version = "0.4.4";
src = fetchPypi {
inherit pname version;
sha256 = "12l71wh9fcd79d6c7qfzp029iph6gv4daxpg2ddpzr9lrvcw3yah";
};
propagatedBuildInputs = [ qtpy six pyside ];
meta = with stdenv.lib; {
description = "Iconic fonts in PyQt and PySide applications";
homepage = https://github.com/spyder-ide/qtawesome;
license = licenses.mit;
};
}

View File

@@ -0,0 +1,25 @@
{ stdenv, buildPythonPackage, fetchPypi, pyside, pytest }:
buildPythonPackage rec {
pname = "QtPy";
version = "1.3.1";
src = fetchPypi {
inherit pname version;
sha256 = "04skhjb2dbbhvpq0x71nnz2h68805fkxfpkdjhwvd7lzsljjbbq8";
};
# no concrete propagatedBuildInputs as multiple backends are supposed
checkInputs = [ pyside pytest ];
doCheck = false; # require X
checkPhase = ''
py.test qtpy/tests
'';
meta = with stdenv.lib; {
description = "Abstraction layer for PyQt5/PyQt4/PySide2/PySide";
homepage = https://github.com/spyder-ide/qtpy;
license = licenses.mit;
};
}

View File

@@ -0,0 +1,18 @@
{ stdenv, buildPythonPackage, fetchPypi }:
buildPythonPackage rec {
pname = "rope";
version = "0.10.7";
src = fetchPypi {
inherit pname version;
sha256 = "1lc01pjn0yr6yqcpbf6kk170zg8zhnyzj8kqlsch1mag0g9dz7m0";
};
meta = with stdenv.lib; {
description = "Python refactoring library";
homepage = https://github.com/python-rope/rope;
maintainers = with maintainers; [ goibhniu ];
license = licenses.gpl2;
};
}

View File

@@ -0,0 +1,27 @@
{ buildPythonPackage
, lib
, fetchPypi
, protobuf
}:
buildPythonPackage rec {
pname = "s2clientprotocol";
version = "3.19.1.58600.0";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "02jqwdfj5zpag4c5nf0707qmwk7sqm98yfgrd19rq6pi58zgl74f";
};
patches = [ ./pure-version.patch ];
buildInputs = [ protobuf ];
meta = {
description = "StarCraft II - client protocol.";
homepage = "https://github.com/Blizzard/sc2client-proto";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ danharaj ];
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/setup.py b/setup.py
index 89131a8..19527df 100755
--- a/setup.py
+++ b/setup.py
@@ -13,8 +13,6 @@ from distutils.spawn import find_executable
from setuptools import setup
from setuptools.command.build_py import build_py
-import gameversion_autogen as ver
-
SETUP_DIR = os.path.dirname(os.path.abspath(__file__))
PROTO_DIR = os.path.join(SETUP_DIR, 's2clientprotocol')