Make python things work in the sandbox

Everything seems to be plotting now, and graph_edit draws again.

Change-Id: I2aceb13577c0d7529e3169f89e2d0c71612f3a47
diff --git a/WORKSPACE b/WORKSPACE
index 5bd89d2..90a57b3 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -36,6 +36,10 @@
     "//debian:arm_frc_gnueabi_deps.bzl",
     arm_frc_gnueabi_deps_debs = "files",
 )
+load(
+    "//debian:python_gtk.bzl",
+    python_gtk_debs = "files",
+)
 load("//debian:packages.bzl", "generate_repositories_for_debs")
 
 generate_repositories_for_debs(python_debs)
@@ -56,6 +60,8 @@
 
 generate_repositories_for_debs(arm_frc_gnueabi_deps_debs)
 
+generate_repositories_for_debs(python_gtk_debs)
+
 new_http_archive(
     name = "python_repo",
     build_file = "debian/python.BUILD",
@@ -223,8 +229,8 @@
 new_http_archive(
     name = "matplotlib",
     build_file = "debian/matplotlib.BUILD",
-    sha256 = "4aa1efb22f74859ab5c478ff743f2fd34291fc30635f4b7cf2d67550ed226117",
-    url = "http://frc971.org/Build-Dependencies/matplotlib.tar.gz",
+    sha256 = "dc8e04123a93180bf89727bf6b5a5a0f6d210b6c1c5eaec148f7f8183abbce24",
+    url = "http://frc971.org/Build-Dependencies/matplotlib-2.tar.gz",
 )
 
 new_http_archive(
@@ -241,6 +247,13 @@
     url = "http://frc971.org/Build-Dependencies/arm_frc_gnueabi_deps.tar.gz",
 )
 
+new_http_archive(
+    name = "python_gtk",
+    build_file = "debian/python_gtk.BUILD",
+    sha256 = "850f5c1521b94c5c049c44d9107cd8ae9110696fbf054d2cb48bae9620fd4d23",
+    url = "http://frc971.org/Build-Dependencies/python_gtk.tar.gz",
+)
+
 # Downloaded from
 # https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2?revision=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2018-q2-update
 new_http_archive(
@@ -253,7 +266,7 @@
 
 new_http_archive(
     name = "cgal_repo",
+    build_file = "debian/cgal.BUILD",
     sha256 = "d564dda558570344b4caa66c5bae2cdae9ef68e07829d64f5651b25f2c6a0e9e",
     url = "http://frc971.org/Build-Dependencies/cgal-dev-4.5-2.tar.gz",
-    build_file = 'debian/cgal.BUILD',
 )
diff --git a/debian/BUILD b/debian/BUILD
index a052657..7ab6705 100644
--- a/debian/BUILD
+++ b/debian/BUILD
@@ -36,6 +36,10 @@
     ":arm_frc_gnueabi_deps.bzl",
     arm_frc_gnueabi_deps_debs = "files",
 )
+load(
+    ":python_gtk.bzl",
+    python_gtk_debs = "files",
+)
 load("//debian:packages.bzl", "download_packages", "generate_deb_tarball")
 
 filegroup(
@@ -46,6 +50,30 @@
     visibility = ["@matplotlib//:__pkg__"],
 )
 
+filegroup(
+    name = "python_shapely_patches",
+    srcs = [
+        "python_shapely_init.patch",
+    ],
+    visibility = ["@python_gtk//:__pkg__"],
+)
+
+filegroup(
+    name = "python_gi_patches",
+    srcs = [
+        "python_gi_init.patch",
+    ],
+    visibility = ["@python_gtk//:__pkg__"],
+)
+
+filegroup(
+    name = "python_geos_patches",
+    srcs = [
+        "python_geos.patch",
+    ],
+    visibility = ["@python_gtk//:__pkg__"],
+)
+
 py_binary(
     name = "download_packages",
     srcs = [
@@ -143,6 +171,7 @@
     ],
     packages = [
         "python-matplotlib",
+        "python-tk",
         "python3-matplotlib",
     ],
 )
@@ -164,6 +193,25 @@
     ],
 )
 
+download_packages(
+    name = "download_python_gtk_deps",
+    excludes = [
+        "fonts-freefont",
+        "gsettings-backend",
+        "libpng-dev",
+        "libz-dev",
+        "python3-dev",
+        "python3",
+    ],
+    packages = [
+        "libgtk-3-dev",
+        "python3-cairo",
+        "python3-gi",
+        "python3-gi-cairo",
+        "python3-shapely",
+    ],
+)
+
 generate_deb_tarball(
     name = "python",
     files = python_debs,
@@ -208,3 +256,8 @@
     name = "arm_frc_gnueabi_deps",
     files = arm_frc_gnueabi_deps_debs,
 )
+
+generate_deb_tarball(
+    name = "python_gtk",
+    files = python_gtk_debs,
+)
diff --git a/debian/matplotlib.BUILD b/debian/matplotlib.BUILD
index 208761a..5f89ba9 100644
--- a/debian/matplotlib.BUILD
+++ b/debian/matplotlib.BUILD
@@ -25,16 +25,18 @@
 
 _data_files = glob([
     "usr/share/matplotlib/mpl-data/**",
+    "usr/share/tcltk/**",
 ])
 
 _src_copied = ["/".join(f.split("/")[4:]) for f in _src_files]
 
 _builtin_so_files = glob([
     "usr/lib/python2.7/dist-packages/**/*.x86_64-linux-gnu.so",
+    "usr/lib/python2.7/lib-dynload/*.so",
 ])
 
 _system_so_files = glob([
-    "usr/lib/x86_64-linux-gnu/**/*.so*",
+    "usr/lib/**/*.so*",
     "lib/x86_64-linux-gnu/**/*.so*",
 ])
 
@@ -45,6 +47,7 @@
 _builtin_rpaths = [":".join([
     "\\$$ORIGIN/%s" % rel,
     "\\$$ORIGIN/%s/rpathed/usr/lib/x86_64-linux-gnu" % rel,
+    "\\$$ORIGIN/%s/rpathed/usr/lib" % rel,
     "\\$$ORIGIN/%s/rpathed/lib/x86_64-linux-gnu" % rel,
 ]) for rel in ["/".join([".." for _ in so.split("/")[1:]]) for so in _builtin_so_copied]]
 
@@ -96,9 +99,15 @@
 )
 
 genrule(
-    name = "create_empty_rc",
+    name = "create_rc",
     outs = ["usr/share/matplotlib/mpl-data/matplotlibrc"],
-    cmd = "touch $@",
+    cmd = "\n".join([
+        "cat > $@ << END",
+        # This is necessary to make matplotlib actually plot things to the
+        # screen by default.
+        "backend      : TkAgg",
+        "END",
+    ]),
 )
 
 py_library(
diff --git a/debian/matplotlib.bzl b/debian/matplotlib.bzl
index d54ba56..8e441d6 100644
--- a/debian/matplotlib.bzl
+++ b/debian/matplotlib.bzl
@@ -1,4 +1,5 @@
 files = {
+    "blt_2.5.3+dfsg-1_amd64.deb": "0a66841fa4f764fa504f3921b7566a85234859e552ce2a2d599a10a10f2ea7c4",
     "coreutils_8.23-4_amd64.deb": "6d3764c746887015c88c684aecc14dd1317eefeb76ba2acdf59d9ad5e4d97236",
     "fontconfig-config_2.11.0-6.3+deb8u1_all.deb": "f7963c0338fd031101f3f684a4e37306eefcd05094220947dd9cb7388a2fe85f",
     "fontconfig_2.11.0-6.3+deb8u1_amd64.deb": "5383eabf18c4c3dc3d581d1efea0e6ccbfd2c08a6a98cd3e6c491b1a99759375",
@@ -33,14 +34,14 @@
     "libthai0_0.1.21-1_amd64.deb": "992e35bf8c1685ba1cb439a99a78db72c7960075cb25cf3175d67f782cbb75c3",
     "libtiff5_4.0.3-12.3+deb8u6_amd64.deb": "73f4e28cd270d59698feb45564fb73329eef645c645218420d600d7e13115b84",
     "libtk8.6_8.6.2-1_amd64.deb": "c8bf4cffca2af331cd323c88e68ac1e90f48b08de24813f6b24308b18977d396",
-    "libx11-6_1.6.2-3+deb8u1_amd64.deb": "380aa38372e949f74b57e962146626aae847850ed4f1fcb83784086f239d50c3",
-    "libx11-data_1.6.2-3+deb8u1_all.deb": "4879a3054d6508e86f737bf668737c3fc64980c3512b2912f18bceea823e1899",
+    "libx11-6_1.6.2-3+deb8u2_amd64.deb": "aac2335619b5a9ebabfd2be2d63d9f6791faf15993dc54abafde1fdf74297174",
+    "libx11-data_1.6.2-3+deb8u2_all.deb": "8b5c2679ca7ddee702ef58f2d31e7176bc7d08d648089a3b0ac48d51ec8f10e1",
     "libxau6_1.0.8-1_amd64.deb": "b03b2d0d400c2002a2d38300bd6630306abb0ff325c3d4a4447ecceb58335228",
     "libxcb-render0_1.10-3+b1_amd64.deb": "1277261ed3b901d70b01901836b2f6d89235dd6777636f3f26b5d2979f1c7e22",
     "libxcb-shm0_1.10-3+b1_amd64.deb": "724749f2ea6a471ba353f6a93585bf98577c2103648297fac40c46b9a08671b0",
     "libxcb1_1.10-3+b1_amd64.deb": "07bf131f4f0f8a9f1a023ab88cce3a1d12cc7222d3c7f08f00b60a3699af5188",
     "libxcomposite1_0.4.4-1_amd64.deb": "ff739711c5aa6df107fdfb6e13491e8317b2c45477d91a6b17da5660cd8ca8f4",
-    "libxcursor1_1.1.14-1+deb8u1_amd64.deb": "31c05ccd419d5c255643e3d21c871204e154a06af25300c2bd2b721989d038f0",
+    "libxcursor1_1.1.14-1+deb8u2_amd64.deb": "011d069b9bf6604c19c1d07dc7214b24a8fea6dfbb6748fb1fd90532c855c00b",
     "libxdamage1_1.1.4-2+b1_amd64.deb": "c2b13deaa87dbad7d541e29755464f125409b9d4d038d6982bb9f8f35939b817",
     "libxdmcp6_1.1.1-1+b1_amd64.deb": "6758bc820616254634fdd2354a2691e40d2973d6bf3a9c12417f02770f75081c",
     "libxext6_1.3.3-1_amd64.deb": "5105f77289a7e08faaf3bb4c16c6945cafca65b9bdb4792fef820045ab43e568",
@@ -48,7 +49,7 @@
     "libxft2_2.3.2-1_amd64.deb": "38d6013c0b6305caf38932e6274108d81b2b2df0dd67f04987aa3f69c1e6677e",
     "libxi6_1.7.4-1+deb8u1_amd64.deb": "a99de627a07f54bc40e5dc77e3ca7e9d9b5619e068f1bb303f86edd138d6d037",
     "libxinerama1_1.1.3-1+b1_amd64.deb": "3668c1178ac649879338192759e79879e0f5797764b448dcac6aed4b24ef495b",
-    "libxml2_2.9.1+dfsg1-5+deb8u6_amd64.deb": "23c9e795d10443baf09fce7bcc007790f9c19597313fab3ff9691f7100fd0419",
+    "libxml2_2.9.1+dfsg1-5+deb8u7_amd64.deb": "34dcf3dc64e65935fa9e31ba9aa5d1795ed054f17203f01255a1875e55435f70",
     "libxrandr2_1.4.2-1+deb8u1_amd64.deb": "e59996ac0e993331799aa7bc768f7edd7b0baec0fafdbeebeef658834ba96b63",
     "libxrender1_0.9.8-1+b1_amd64.deb": "8980934c84c0ebbca4158023d91ced3ddbfa028a2be25959ff4566b37eceb8f4",
     "libxss1_1.2.2-1_amd64.deb": "0f2fc4eff464b63a4fafed9ab2e499e1804dcee85c5d9a89e53c3ed6a2a06b88",
@@ -60,6 +61,7 @@
     "python-pkg-resources_5.5.1-1_all.deb": "a6d6963f9a1943aee463356e462f7f5283938da6e810940514c1b6c8b8496595",
     "python-pyparsing_2.0.3+dfsg1-1_all.deb": "b8051ce4e3108f52c9ee6137ce5c2175ac64a81782a3249dbfe1f75e409e5978",
     "python-six_1.8.0-1_all.deb": "15e635be0154af9232cb30b10df8c598a274a9b55bbe5c0355aff51cc1e63e88",
+    "python-tk_2.7.8-2+b1_amd64.deb": "cc0e861c75984698874d62dbb23fbf67259364cfe7430bf872196758bdf68632",
     "python-tz_2012c+dfsg-0.1_all.deb": "cb240ad52f4f5e225b7366fab31257664a7b2a50d1bf339c3cd9fdcf0b9e34f6",
     "python3-dateutil_2.2-2_all.deb": "f64d71bddfe4d8ee3ec602495605f79b36c217e61192a35fe2f168f63cea2006",
     "python3-matplotlib_1.4.2-3.1_amd64.deb": "38314c38dcef9332b5b76b32f4207bb0e84188f21ca8e4df5cc2e7895e08b0c8",
@@ -70,6 +72,7 @@
     "python3-tz_2012c+dfsg-0.1_all.deb": "add2d6e1afd92c106d61d09854316ccab73931442b54298df0269899ee9a834c",
     "python_2.7.9-1_amd64.deb": "93dc9d03df366d658832fb238a6c1e6c57e5e57dd648145c2f57a8f3e2b419ed",
     "shared-mime-info_1.3-1_amd64.deb": "50c122e36f96e5cc808c6b7528ebd27f8086783e2c5b7c39ac7f6da6f62b09c1",
+    "tk8.6-blt2.5_2.5.3+dfsg-1_amd64.deb": "805970b3b4fca2f413852651ad249697d2ad4edd7402201e910d231094db6184",
     "ttf-bitstream-vera_1.10-8_all.deb": "328def7f581bf94b3b06d21e641f3e5df9a9b2e84e93b4206bc952fe8e80f38a",
     "tzdata_2018e-0+deb8u1_all.deb": "124fe7da8988d0779be3c1883e7de00742ed46464f5f94616d5222cd16f9537a",
     "ucf_3.0030_all.deb": "1b93d9fc5930b9d8382705b71605e07fe11f4796db239b7ac2644bf4fbd7f6a2",
diff --git a/debian/matplotlib_init.patch b/debian/matplotlib_init.patch
index 11a3ad8..0106b64 100644
--- a/debian/matplotlib_init.patch
+++ b/debian/matplotlib_init.patch
@@ -8,16 +8,16 @@
  import six
  import sys
  import distutils.version
-@@ -110,6 +111,21 @@
+@@ -110,6 +111,26 @@
  __version__ = str('1.4.2')
  __version__numpy__ = str('1.6')  # minimum required numpy version
  
-+matplotlib_base = os.path.dirname(os.path.dirname(__file__))
++_matplotlib_base = os.path.dirname(os.path.dirname(__file__))
 +
 +# Hack to point matplotlib at its data.
 +os.environ['MATPLOTLIBDATA'] = \
 +        os.path.join( \
-+            matplotlib_base,
++            _matplotlib_base,
 +            "usr", "share", "matplotlib", "mpl-data")
 +# Avoid reading /etc/matplotlib in all cases. Matplotlib is pretty happy to
 +# escape the sandbox by using absolute paths.
@@ -27,6 +27,11 @@
 +# manually here to work around the bug.
 +os.environ['MPLCONFIGDIR'] = '/tmp/matplotlib-nobody'
 +
++# Tell Tcl where to find the sandboxed version. Otherwise, it will try using
++# one from the host system, even if that's an incompatible version.
++os.environ['TCL_LIBRARY'] = os.path.join(_matplotlib_base, 'usr', 'share',
++                                         'tcltk', 'tcl8.6')
++
  try:
      import dateutil
  except ImportError:
diff --git a/debian/python_geos.patch b/debian/python_geos.patch
new file mode 100644
index 0000000..9fd697a
--- /dev/null
+++ b/debian/python_geos.patch
@@ -0,0 +1,14 @@
+--- a/geos.py	2018-10-17 23:02:05.000000000 -0700
++++ b/geos.py	2018-10-17 23:16:33.017257372 -0700
+@@ -40,6 +40,11 @@ def load_dll(libname, fallbacks=None):
+             return CDLL(lib)
+         except OSError:
+             pass
++        base = os.path.dirname(os.path.dirname(__file__))
++        try:
++            return CDLL(os.path.join(base, 'rpathed', 'usr', 'lib', lib))
++        except OSError:
++            pass
+     if fallbacks is not None:
+         for name in fallbacks:
+             try:
diff --git a/debian/python_gi_init.patch b/debian/python_gi_init.patch
new file mode 100644
index 0000000..97ca2dc
--- /dev/null
+++ b/debian/python_gi_init.patch
@@ -0,0 +1,14 @@
+--- a/__init__.py	1969-12-31 16:00:00.000000000 -0800
++++ b/__init__.py	2018-10-17 21:45:04.908201161 -0700
+@@ -29,6 +29,11 @@ import os
+ import importlib
+ import types
+ 
++_base = os.path.dirname(os.path.dirname(__file__))
++os.environ['GI_TYPELIB_PATH'] = os.path.join(_base, 'usr', 'lib',
++                                             'x86_64-linux-gnu',
++                                             'girepository-1.0')
++
+ _static_binding_error = ('When using gi.repository you must not import static '
+                          'modules like "gobject". Please change all occurrences '
+                          'of "import gobject" to "from gi.repository import GObject". '
diff --git a/debian/python_gtk.BUILD b/debian/python_gtk.BUILD
new file mode 100644
index 0000000..367c137
--- /dev/null
+++ b/debian/python_gtk.BUILD
@@ -0,0 +1,163 @@
+genrule(
+    name = "patch_gi_init",
+    srcs = [
+        "usr/lib/python3/dist-packages/gi/__init__.py",
+        "@//debian:python_gi_patches",
+    ],
+    outs = ["gi/__init__.py"],
+    cmd = " && ".join([
+        "cp $(location usr/lib/python3/dist-packages/gi/__init__.py) $@",
+        "readonly PATCH=\"$$(readlink -f $(location @patch))\"",
+        "readonly FILE=\"$$(readlink -f $(location @//debian:python_gi_patches))\"",
+        "(cd $(@D) && \"$${PATCH}\" -p1 < \"$${FILE}\") > /dev/null",
+    ]),
+    tools = [
+        "@patch",
+    ],
+)
+
+genrule(
+    name = "patch_shapely_init",
+    srcs = [
+        "usr/lib/python3/dist-packages/shapely/__init__.py",
+        "@//debian:python_shapely_patches",
+    ],
+    outs = ["shapely/__init__.py"],
+    cmd = " && ".join([
+        "cp $(location usr/lib/python3/dist-packages/shapely/__init__.py) $@",
+        "readonly PATCH=\"$$(readlink -f $(location @patch))\"",
+        "readonly FILE=\"$$(readlink -f $(location @//debian:python_shapely_patches))\"",
+        "(cd $(@D) && \"$${PATCH}\" -p1 < \"$${FILE}\") > /dev/null",
+    ]),
+    tools = [
+        "@patch",
+    ],
+)
+
+genrule(
+    name = "patch_geos",
+    srcs = [
+        "usr/lib/python3/dist-packages/shapely/geos.py",
+        "@//debian:python_geos_patches",
+    ],
+    outs = ["shapely/geos.py"],
+    cmd = " && ".join([
+        "cp $(location usr/lib/python3/dist-packages/shapely/geos.py) $@",
+        "readonly PATCH=\"$$(readlink -f $(location @patch))\"",
+        "readonly FILE=\"$$(readlink -f $(location @//debian:python_geos_patches))\"",
+        "(cd $(@D) && \"$${PATCH}\" -p1 < \"$${FILE}\") > /dev/null",
+    ]),
+    tools = [
+        "@patch",
+    ],
+)
+
+_src_files = glob(
+    include = ["usr/lib/python3/dist-packages/**/*.py"],
+    exclude = [
+        "usr/lib/python3/dist-packages/gi/__init__.py",
+        "usr/lib/python3/dist-packages/shapely/__init__.py",
+        "usr/lib/python3/dist-packages/shapely/geos.py",
+    ],
+)
+
+_data_files = glob([
+    "usr/lib/x86_64-linux-gnu/girepository-1.0/**/*",
+])
+
+_src_copied = ["/".join(f.split("/")[4:]) for f in _src_files]
+
+_builtin_so_files = glob([
+    "usr/lib/python3/dist-packages/**/*.cpython-34m-x86_64-linux-gnu.so",
+])
+
+_system_so_files = glob(
+    include = [
+        "lib/x86_64-linux-gnu/**/*.so*",
+        "usr/lib/**/*.so*",
+    ],
+    exclude = [
+        "usr/lib/**/*.cpython-34m-x86_64-linux-gnu.so",
+    ],
+)
+
+_builtin_so_copied = ["/".join(f.split("/")[4:]) for f in _builtin_so_files]
+
+_system_so_copied = ["rpathed/" + f for f in _system_so_files]
+
+_builtin_rpaths = [":".join([
+    "\\$$ORIGIN/%s" % rel,
+    "\\$$ORIGIN/%s/rpathed/usr/lib/x86_64-linux-gnu" % rel,
+    "\\$$ORIGIN/%s/rpathed/usr/lib" % rel,
+    "\\$$ORIGIN/%s/rpathed/lib/x86_64-linux-gnu" % rel,
+]) for rel in ["/".join([".." for _ in so.split("/")[1:]]) for so in _builtin_so_copied]]
+
+_system_rpaths = [":".join([
+    "\\$$ORIGIN/%s/rpathed/usr/lib/x86_64-linux-gnu" % rel,
+    "\\$$ORIGIN/%s/rpathed/usr/lib" % rel,
+    "\\$$ORIGIN/%s/rpathed/lib/x86_64-linux-gnu" % rel,
+]) for rel in ["/".join([".." for _ in so.split("/")[1:]]) for so in _system_so_copied]]
+
+genrule(
+    name = "run_patchelf_builtin",
+    srcs = _builtin_so_files,
+    outs = _builtin_so_copied,
+    cmd = "\n".join(
+        [
+            "cp $(location %s) $(location %s)" % (src, dest)
+            for src, dest in zip(_builtin_so_files, _builtin_so_copied)
+        ] +
+        ["$(location @patchelf) --set-rpath %s $(location %s)" % (rpath, so) for rpath, so in zip(_builtin_rpaths, _builtin_so_copied)],
+    ),
+    tools = [
+        "@patchelf",
+    ],
+)
+
+genrule(
+    name = "run_patchelf_system",
+    srcs = _system_so_files,
+    outs = _system_so_copied,
+    cmd = "\n".join(
+        [
+            "cp $(location %s) $(location %s)" % (src, dest)
+            for src, dest in zip(_system_so_files, _system_so_copied)
+        ] +
+        ["$(location @patchelf) --set-rpath %s $(location %s)" % (rpath, so) for rpath, so in zip(_system_rpaths, _system_so_copied)],
+    ),
+    tools = [
+        "@patchelf",
+    ],
+)
+
+genrule(
+    name = "copy_libgeos_c",
+    srcs = ["rpathed/usr/lib/libgeos_c.so.1"],
+    outs = ["rpathed/usr/lib/libgeos_c.so"],
+    cmd = "cp $< $@",
+)
+
+genrule(
+    name = "copy_files",
+    srcs = _src_files,
+    outs = _src_copied,
+    cmd = " && ".join(["cp $(location %s) $(location %s)" % (src, dest) for src, dest in zip(
+        _src_files,
+        _src_copied,
+    )]),
+)
+
+py_library(
+    name = "python_gtk",
+    srcs = _src_copied + [
+        "gi/__init__.py",
+        "shapely/__init__.py",
+        "shapely/geos.py",
+    ],
+    data = _data_files + _builtin_so_copied + _system_so_copied + [
+        "rpathed/usr/lib/libgeos_c.so",
+    ],
+    imports = ["usr/lib/python3/dist-packages"],
+    restricted_to = ["@//tools:k8"],
+    visibility = ["//visibility:public"],
+)
diff --git a/debian/python_gtk.bzl b/debian/python_gtk.bzl
new file mode 100644
index 0000000..18aa84b
--- /dev/null
+++ b/debian/python_gtk.bzl
@@ -0,0 +1,203 @@
+files = {
+    "adduser_3.113+nmu3_all.deb": "ae69ab0da5c36e48ba38e27c5e0886d6a67988adead5e5324b9b90736d37c11e",
+    "adwaita-icon-theme_3.14.0-2_all.deb": "3be4a0849080371cb26091128fe90c7541eb4b7e4f97c03a23b26f6748e8352a",
+    "coreutils_8.23-4_amd64.deb": "6d3764c746887015c88c684aecc14dd1317eefeb76ba2acdf59d9ad5e4d97236",
+    "dbus_1.8.22-0+deb8u1_amd64.deb": "d3fef69b6697ad9ac5400524f704736d986d701fa0f4b6d92b43521ad38f5d9e",
+    "dconf-gsettings-backend_0.22.0-1_amd64.deb": "38212d8e4ef3106d3f3f147c2fab9b601d2173fa76f12a85a0d9d2e3487752e9",
+    "dconf-service_0.22.0-1_amd64.deb": "14c4eeee6b2f43fe21a3189a2aa6cc5d5b25aea99bd1000db620f48dcc05566f",
+    "debianutils_4.4+b1_amd64.deb": "3d18d183b79d259e0ca77d65904c55810d70443743967c77f1a0aebf2dd94fb1",
+    "fontconfig-config_2.11.0-6.3+deb8u1_all.deb": "f7963c0338fd031101f3f684a4e37306eefcd05094220947dd9cb7388a2fe85f",
+    "fontconfig_2.11.0-6.3+deb8u1_amd64.deb": "5383eabf18c4c3dc3d581d1efea0e6ccbfd2c08a6a98cd3e6c491b1a99759375",
+    "fonts-dejavu-core_2.34-1_all.deb": "002c9fa9445cfec4964637f22c73265d8a868f0810104452a6c906af52e43dab",
+    "fonts-liberation_1.07.4-1_all.deb": "5490dd0b745bae9aa0c9a31ab75597229042d8fb45910ebbc21fe04f0cb1b87b",
+    "gir1.2-atk-1.0_2.14.0-1_amd64.deb": "cd172ac38313cc615cc0ebea71f6491a1db6e4ee676a717ae4d70731b331d4a5",
+    "gir1.2-atspi-2.0_2.14.0-1_amd64.deb": "b4601bc884526c8ce4319bc3eb2269f2ae7f68d8a0c6f6fad131fe728c84c95a",
+    "gir1.2-freedesktop_1.42.0-2.2_amd64.deb": "810d66b5d11aa6cb951f19c569ff664e86a15db70ad0f5d0ebecd5f0bdcb75bf",
+    "gir1.2-gdkpixbuf-2.0_2.31.1-2+deb8u7_amd64.deb": "324887a6ea94d8b040fb3633e95fafd2de73b454780573c29b479c1e10ad664c",
+    "gir1.2-glib-2.0_1.42.0-2.2_amd64.deb": "cf7e97331bbc7bb4807e1a622f24681afc4ddd9e2d7e9f693c91a48c6ccc6d3c",
+    "gir1.2-gtk-3.0_3.14.5-1+deb8u1_amd64.deb": "9a9a06a32ce79d2b083031fa8548e004acee55ae0e092afc8a0a1b99ef8cbd9f",
+    "gir1.2-pango-1.0_1.36.8-3_amd64.deb": "33366c4abd9cc201de7724d7711928b9e153f1df88831d59fd2fd34ecf81a36f",
+    "glib-networking-common_2.42.0-2_all.deb": "f58923eeaea87db676343e7cb12e624b07df5f2fdfc0873051e4d1c1f309b4a4",
+    "glib-networking-services_2.42.0-2_amd64.deb": "5bae064daca2f6ac6e74ad0f2dbef867592a3652854884d136ee1d2dcdb511a3",
+    "glib-networking_2.42.0-2_amd64.deb": "aa6684a52e562f65c4974ecdd3c21a9ac92310dd575ef86e05d02107dd708c7f",
+    "gsettings-desktop-schemas_3.14.1-1_all.deb": "723ba6cc41e3e655a129c4b877016d792de083a46534e24754b9baf6ae7f6964",
+    "hicolor-icon-theme_0.13-1_all.deb": "f95a3a55833356285026543d663a6c2e91c1b6adc463bae38e79350021eba32a",
+    "libatk-bridge2.0-0_2.14.0-2_amd64.deb": "5a3eb5b006531726a78df46486414b5afa1bb17dd6f0adbd638d098b05224292",
+    "libatk-bridge2.0-dev_2.14.0-2_amd64.deb": "7f8ee97f9ec4c67f393ff16ee0d94f7414139c1b192e3e100adefad16570d792",
+    "libatk1.0-0_2.14.0-1_amd64.deb": "3c09c360031a4d251b294557ac3dd4365150c1bffd522b4a78ba9d93f6d3ab26",
+    "libatk1.0-data_2.14.0-1_all.deb": "fd3d0906bdb08b9d8db9458f29b3c24640ca56669d30d82b9db7c9d1abaf2535",
+    "libatk1.0-dev_2.14.0-1_amd64.deb": "23c5ce230d87d240d34e635120bfc3a970f36e749c39cbe11a6cbeefd41b47b8",
+    "libatspi2.0-0_2.14.0-1_amd64.deb": "9970b3b9c30d2dd0173c31e8fd12f4ad0cdacb9d5144420dc2d2b7bf1e36a86b",
+    "libatspi2.0-dev_2.14.0-1_amd64.deb": "7a3c8a946b64d6e6b10455b40ab0e5aaa42f280ae25f042b9c39f0d015425e2d",
+    "libaudit-common_2.4-1_all.deb": "be7f873c8f149b53b8cc3c337b067050d18208cb0de3f8cf6114a29bd20a17e3",
+    "libaudit1_2.4-1+b1_amd64.deb": "c51ba54837876bc5bb95688be5321303e7fbcbb384d3038797a22933bb87ef6d",
+    "libavahi-client3_0.6.31-5_amd64.deb": "cd0bf1b525606f38de14b50f88b841177b967273015968a13aa3d848d69729aa",
+    "libavahi-common-data_0.6.31-5_amd64.deb": "8366634609f3c4985c7ee01a1d68a9733d3dc6b54831437d8bad9d11f667c639",
+    "libavahi-common3_0.6.31-5_amd64.deb": "83bc43e646989a3f39684cf331b8fc15b009f54b88eeeb9c0851c20f4cc25310",
+    "libcairo-gobject2_1.14.0-2.1+deb8u2_amd64.deb": "4525b089a91d65841a0967981e69640c34f8d41a59c07501d78675a4a3fb6225",
+    "libcairo-script-interpreter2_1.14.0-2.1+deb8u2_amd64.deb": "449a7fd62a7ceb950407751756592c1f1ba5fbf94b8f9859cedf2a3f353a25ea",
+    "libcairo2-dev_1.14.0-2.1+deb8u2_amd64.deb": "ecbdb19124e7185a8f76cd2a4d94c232bb906ae807d32b8b6cae080d6b0f76bf",
+    "libcairo2_1.14.0-2.1+deb8u2_amd64.deb": "5bb8028434e2ecbc75734bb7bd8ebc1f2f4d824834820c09729fd713b67ca0fe",
+    "libcap-ng0_0.7.4-2_amd64.deb": "9aab7cfa0ab5136d161fb5fd2a2e230657bee1e9f6e8e3348b2a94e8271dae81",
+    "libcolord2_1.2.1-1+b2_amd64.deb": "7721d763a8adbb9710f9ba8d55a3b4ae1f92934e2803ff739edb106c11d154a0",
+    "libcomerr2_1.42.12-2+b1_amd64.deb": "a6dadf0f224dcbb2826b074fa393ffae0903fed67cd3338007abf40dad02b233",
+    "libcroco3_0.6.8-3+b1_amd64.deb": "330941dbd4b3ff90cc4625c980e41e2d7447c284d0b4734393b80f7597a37c72",
+    "libcups2_1.7.5-11+deb8u4_amd64.deb": "3b8a0320c839c2f7afaff039f9687a24fbaf0a892e0e16c644ef5256f6960366",
+    "libdatrie1_0.2.8-1_amd64.deb": "8f1c9f4acaaa7cbe8b742c16d3b7c261c42193ceefef927cdefeccfc2b92348d",
+    "libdbus-1-3_1.8.22-0+deb8u1_amd64.deb": "5902cf8264fe4630832bf88704fadf9f48c57cc64a3aee8db03aa123d89492ca",
+    "libdbus-1-dev_1.8.22-0+deb8u1_amd64.deb": "1a9fa1055f6854378ea71aed4dc692b9c8a7c6099ed196af67535269dc010af6",
+    "libdbus-glib-1-2_0.102-1_amd64.deb": "ad01b2c41185a9f52d61eaf838553b3bc3c2059ee1b4eb33e2c14774770b8d76",
+    "libdbus-glib-1-dev_0.102-1_amd64.deb": "4c80699b5d863cffac0342acd171ac422ca22f4b4e4b3e050d5e0fd177817d39",
+    "libdconf1_0.22.0-1_amd64.deb": "0dc9757a8c7da4ad22dfef8607b144f75c9285f60127c67ab9b231da6d170a3b",
+    "libelfg0_0.8.13-5_amd64.deb": "cc36aeebc762776df6b911fd224afcfb1b0e34d7f4773a2ebf3fc2f1b7fc8533",
+    "libfontconfig1-dev_2.11.0-6.3+deb8u1_amd64.deb": "480f95e5023ca3f1f57d9436395985c6a61d7cc7e13c6fa9e908147382c6450e",
+    "libfontconfig1_2.11.0-6.3+deb8u1_amd64.deb": "0bb54d61c13aa5b5253cb5e08aaca0dfc4c626a05ee30f51d0e3002cda166fec",
+    "libfreetype6-dev_2.5.2-3+deb8u2_amd64.deb": "b98c911209fc521e6be867cfca74af9653a5e990fc0542dd1c2497fa67aa77aa",
+    "libfreetype6_2.5.2-3+deb8u2_amd64.deb": "58e384796f31cd582e6da200fad74d09f5aad968eb7a45c5c2fa202675660b46",
+    "libgcrypt20_1.6.3-2+deb8u5_amd64.deb": "c452ebd74685eeebb2e5b00b76839b145c540209de3354f345b31443ed7b7a0c",
+    "libgdk-pixbuf2.0-0_2.31.1-2+deb8u7_amd64.deb": "eba768ee4828f41df9eaae59fc90b72ad215497b0bb6b7618202e93a35a8aab8",
+    "libgdk-pixbuf2.0-common_2.31.1-2+deb8u7_all.deb": "04cf3a42d105483677363328d074c2a72bed3e782606e489d3b8b90723bedc47",
+    "libgdk-pixbuf2.0-dev_2.31.1-2+deb8u7_amd64.deb": "4865703158abf88e57146bb9f2594ba137f04186804cca0817eccd5450351722",
+    "libgeos-3.4.2_3.4.2-6_amd64.deb": "0a2ac651a4d2032a8bf337cf465ef15464daea956fe967cdfec205b6241288a3",
+    "libgeos-c1_3.4.2-6_amd64.deb": "8a14eb69db0c2d4f0f6dd0915c7ccd7bd4df001fa855236c8b0ca57352f23095",
+    "libgirepository-1.0-1_1.42.0-2.2_amd64.deb": "b66a761b672e5aa89eca33c5d36b0efec569fa468b063243e2b61daa78d68ad6",
+    "libglib2.0-0_2.42.1-1+b1_amd64.deb": "a4b30c84c0c050f23a986fbc576daa04b246ab816ec0fcb0b471d19aa2689a97",
+    "libglib2.0-bin_2.42.1-1+b1_amd64.deb": "8ca70ec77924ba07bc6ab3e4f7833dea7abdb1a70bf0be655989e0245593e92e",
+    "libglib2.0-data_2.42.1-1_all.deb": "15c1e8de648a00a1599e16a7680359f973c9fd58a96d881016678baa8c42a8dd",
+    "libglib2.0-dev_2.42.1-1+b1_amd64.deb": "ad483c4da4da80c317084f86b74adc2934b4674e8e40c9e076a6c1f7c3a2f8fa",
+    "libgmp10_6.0.0+dfsg-6_amd64.deb": "155a31b0f716aa3dcd7ee68e9bd57e0b76a6b31f4e41fb2d953e986315437082",
+    "libgnutls-deb0-28_3.3.8-6+deb8u7_amd64.deb": "a5685d0dc8bcf06a9e858bb8c8d9e9edf4376729dcabb9557e13fdac365e8a3c",
+    "libgpg-error0_1.17-3_amd64.deb": "7b156391cb5aef83df692bf4f966313d5fbd96481945dc65b384471067d16124",
+    "libgraphite2-3_1.3.10-1~deb8u1_amd64.deb": "49e1434c15e17654714b7f158d75d8a8a2f0bef7c7d1f7eb9e6f1c55ec69c598",
+    "libgssapi-krb5-2_1.12.1+dfsg-19+deb8u4_amd64.deb": "47a50d69b9972fdb8f625e23583b51416bd18659e24276047302a22063135f01",
+    "libgtk-3-0_3.14.5-1+deb8u1_amd64.deb": "062c11c06d774d18c008b9efe0f479517f2bcebf9e990ae8508a04596fcdf054",
+    "libgtk-3-bin_3.14.5-1+deb8u1_amd64.deb": "f81e59d387487c4852c9816b3243b19e63bc29c2d683351cac08b86afbdebfe4",
+    "libgtk-3-common_3.14.5-1+deb8u1_all.deb": "4de6cc260354cecc903dc57c4ab948c020faa04cf5aac452e87412cfa1296863",
+    "libgtk-3-dev_3.14.5-1+deb8u1_amd64.deb": "54167ed47c7057221444ae23616c4494b156ba7a126f92e52381c256fa1a29bb",
+    "libharfbuzz-dev_0.9.35-2_amd64.deb": "175de037a0a89c088988c5ebf6b9939893c3aabbfda2e6cb2ddb14457285e3db",
+    "libharfbuzz-gobject0_0.9.35-2_amd64.deb": "16a37cd0b880d32aec61f10bfa04ef5b43a34028f2e1f86363cf0377d03907fa",
+    "libharfbuzz-icu0_0.9.35-2_amd64.deb": "21a311fc3b6a8b5ade3e1fd7ee265170146766206f52e209514c494d4ca96d14",
+    "libharfbuzz0b_0.9.35-2_amd64.deb": "24cb370d0dab9769ab1cce6a8362e5a785152b253319789ac6d2420f1ce42185",
+    "libhogweed2_2.7.1-5+deb8u2_amd64.deb": "9b95be6e2db3bbb912fcb7fa4bb306e2f6abb029d26c7ea63e942380a3535763",
+    "libice-dev_1.0.9-1+b1_amd64.deb": "fb72338b69d4e07d7594b12a37db24014525543fe66e0e973d402a60a30a5efa",
+    "libice6_1.0.9-1+b1_amd64.deb": "6b6aefe57b52ac77dc0891c96f6f00472fdd1e9d14128aa5a60e337c5602158d",
+    "libicu52_52.1-8+deb8u7_amd64.deb": "708d4499e2f6344a77d903c2c03a958f5edac32f9adf5ff3da7b572bf307e980",
+    "libjasper1_1.900.1-debian1-2.4+deb8u3_amd64.deb": "a0887eb2f617ac0031ba195fd00119c85f3c20eb9d9670b2dc2d93e75faf1de9",
+    "libjbig0_2.1-3.1_amd64.deb": "d0b55e2da6648d6b91ced51e8c8ccfbe024283ffbbc1484f704ff7b0c97f8c51",
+    "libjpeg62-turbo_1.3.1-12_amd64.deb": "ac397a0c8d16891dbc0348a9ee30506b8b4cafe138a25b3af9e3cd0b417fab3d",
+    "libjson-glib-1.0-0_1.0.2-1_amd64.deb": "795df8460d3ae8f6b05133d43ca60949d5f48ea266a7461df6c7670eb75d813c",
+    "libjson-glib-1.0-common_1.0.2-1_all.deb": "5ca554f121dbc7200f5c545fdf6a9aacb6eda6a2e521b5307915c9b24016ca12",
+    "libk5crypto3_1.12.1+dfsg-19+deb8u4_amd64.deb": "2c4cba5d1528310c1863c29e7d8a1f44c2ed8c98811953cafff1f0197b809abb",
+    "libkeyutils1_1.5.9-5+b1_amd64.deb": "ab6369dab6e1dc690e10dfd621bc424392d9ffa5261e2079f3306557a27d4fb3",
+    "libkrb5-3_1.12.1+dfsg-19+deb8u4_amd64.deb": "bfd66673f3874fb18a02a4073867bfec3e31c5d22af5ceb9b2d12a7fe41b2789",
+    "libkrb5support0_1.12.1+dfsg-19+deb8u4_amd64.deb": "b8fa115d2cf2135aaa700e9504ccfa70d37fc13075b1d03e0fe3e998cc60fdbf",
+    "liblcms2-2_2.6-3+deb8u2_amd64.deb": "c388856db0c3c52756f317cb2b48764afbca2781e91df96e6a286f6c7add98c6",
+    "liblzo2-2_2.08-1.2_amd64.deb": "30316e5c74b66016efb62efe1b83574692dfa84dc6b8d060e623b26320574250",
+    "libnettle4_2.7.1-5+deb8u2_amd64.deb": "6917d0fd576ec89004eef355a5700eeb51fc35678e660797621af2a8f483fcf0",
+    "libp11-kit0_0.20.7-1_amd64.deb": "50be06cb69c72cbedf6942c8b8929400ceb6e7a198c52b16698aace41e411d40",
+    "libpam-modules-bin_1.1.8-3.1+deb8u2+b1_amd64.deb": "6bf89d49b697566d04a799cd43adb5520403e75149dbd71a13d63964f2c7b121",
+    "libpam-modules_1.1.8-3.1+deb8u2+b1_amd64.deb": "c9aee820343411579bd139a86e4561152eb3461edd13770984c996a06e32c2c1",
+    "libpam0g_1.1.8-3.1+deb8u2+b1_amd64.deb": "a58b055542ff90214da028af9c61fa521591a1c76640b5b4884216b73117c9b1",
+    "libpango-1.0-0_1.36.8-3_amd64.deb": "54c29cbec70cc2dc45affb3cece358e6a8c57c0c4c4a1690f3adac472c8ee24c",
+    "libpango1.0-dev_1.36.8-3_amd64.deb": "b85efd67f96eabc1f0eb8499c7edd163e4499193018165518b7a28b7f25f79cd",
+    "libpangocairo-1.0-0_1.36.8-3_amd64.deb": "c088f8e9ce755eed168ff1e5be789252cadd4199070f2df703acb41742d90186",
+    "libpangoft2-1.0-0_1.36.8-3_amd64.deb": "30f34db7a73ac7e1b8f2945ac1b5d34e649beb2fa71b2232c0ccde0ca19e697d",
+    "libpangoxft-1.0-0_1.36.8-3_amd64.deb": "84eaefeaa33e6dca732e534a371a7a508614cac22369320bbfa6fd040352a8d4",
+    "libpcre3-dev_8.35-3.3+deb8u4_amd64.deb": "855664aec18478730873f28879c463c23817180f5d69b47df2c5e2bce297d8bf",
+    "libpcrecpp0_8.35-3.3+deb8u4_amd64.deb": "90bb808b764e359ded52cc44dd1ced85436af7f42b49895d3ea76dfc7828e4ae",
+    "libpixman-1-0_0.32.6-3_amd64.deb": "dfce4b6483c5704da051bc7da6aee76c025bf8a093212be122e956d7a8ea4c64",
+    "libpixman-1-dev_0.32.6-3_amd64.deb": "9fb6e86fcfe3d8de8b05b24242fb9fc0e3af7171feb241c45aac2333a0bde5c6",
+    "libpng12-0_1.2.50-2+deb8u3_amd64.deb": "fa86f58f9595392dc078abe3b446327089c47b5ed8632c19128a156a1ea68b96",
+    "libpng12-dev_1.2.50-2+deb8u3_amd64.deb": "f21802bcb4960acd520dc218fcaaa78ea83102ff4d382df340eafec0aa62b203",
+    "libproxy1_0.4.11-4+b2_amd64.deb": "b7b4916f37886b331027199fa6070193cd0102f1256bd0d84b1491596b68e298",
+    "libpthread-stubs0-dev_0.3-4_amd64.deb": "4e2f6d1c1fed2c94841ce2ad33e38b997ae73415e8ed5a0e1210b757ab84e849",
+    "librest-0.7-0_0.7.92-3_amd64.deb": "dae22142f1fd24ea38ea0fc1950937c1886db652d21d46a2a54d546ce73ca86d",
+    "librsvg2-2_2.40.5-1+deb8u2_amd64.deb": "fead83722cc48a6cd679e3b847b88d6cfaca0847bc7d80c4ef6f10568c24fe08",
+    "librsvg2-common_2.40.5-1+deb8u2_amd64.deb": "3446906dcef313936df7fa06c609d5ee03f3512a12bb19465ab1c5b6c8b11c68",
+    "libsemanage-common_2.3-1_all.deb": "6cee4cf858797141ecb5775f33a82cb7ffb5d2c047a0fb9f4ed08005b9c33671",
+    "libsemanage1_2.3-1+b1_amd64.deb": "1d8e7b5c75e6b60769241da5f33c6befffb1a8dc5826474b3191f8f1d1690634",
+    "libsepol1_2.3-2_amd64.deb": "809665fb316152e1c862873abe1f4358302ab8bdab9b034bbe178f0e68257f56",
+    "libsm-dev_1.2.2-1+b1_amd64.deb": "6dfc839e786e3870b7fdf9cd69545ef2fb4cc89f88ab38b84fd7439b989b0eee",
+    "libsm6_1.2.2-1+b1_amd64.deb": "4e2239321aaeffef7dc4a4b4196bb3b3d3b11a4b3b613818e18cc96ab9ee1508",
+    "libsoup-gnome2.4-1_2.48.0-1+deb8u2_amd64.deb": "a5c06b60ca67d780425e4051f25962c021ccc81ec74949461a13933d6709da10",
+    "libsoup2.4-1_2.48.0-1+deb8u2_amd64.deb": "9796bb2aea1c4c6187b54d733f334641336c5ed75e46dc4f08da2d4316e90fdd",
+    "libstdc++6_4.9.2-10+deb8u1_amd64.deb": "a8f4ef6773b90bb39a8a8a0a5e3e20ca8501de6896204f665eb114d5b79f164f",
+    "libsystemd0_215-17+deb8u7_amd64.deb": "ff84ae8db25dc8f4218c6a2161439a6f5f73f44d7115b8c930612657b865fb69",
+    "libtasn1-6_4.2-3+deb8u3_amd64.deb": "36e01f21f439ede1e6957110798375808303d2c6549236811844bf014add93d0",
+    "libthai-data_0.1.21-1_all.deb": "805c372a6f0da8e487933638cf74d969626175d2f77682691bd5c74b3bc02168",
+    "libthai0_0.1.21-1_amd64.deb": "992e35bf8c1685ba1cb439a99a78db72c7960075cb25cf3175d67f782cbb75c3",
+    "libtiff5_4.0.3-12.3+deb8u6_amd64.deb": "73f4e28cd270d59698feb45564fb73329eef645c645218420d600d7e13115b84",
+    "libudev1_215-17+deb8u7_amd64.deb": "35cbd0325c5300e86d0bb5c5bf3a538635b78b56e503dc2f22826b2d53343fcd",
+    "libustr-1.0-1_1.0.4-3+b2_amd64.deb": "e04f13c3b977bdcd80a2d3f9c45bf2ed336fb5398fbb9f86873f722d8bd1784a",
+    "libuuid1_2.25.2-6_amd64.deb": "ab7821a322a6c137eb7b36297eba11a5d2a3d3c27e480a238ff4538898570fb9",
+    "libwayland-client0_1.6.0-2_amd64.deb": "dfb1cf0048f35ec1da9752ee9966aaf8014d1ee160377d0e4631d526e328ab31",
+    "libwayland-cursor0_1.6.0-2_amd64.deb": "e003049613ad688ad33a472c902b086b30f13161dee305e085d5a47876d3ecd5",
+    "libwayland-dev_1.6.0-2_amd64.deb": "f7a6fe5ada07b1463c2df3f59d14b3e7371afaaf55731a893a6001d739bea31b",
+    "libwayland-server0_1.6.0-2_amd64.deb": "8954be62de87a6a0a63ca1438b8e6386cd2f2708af2125c1c57ec72421f53893",
+    "libx11-6_1.6.2-3+deb8u2_amd64.deb": "aac2335619b5a9ebabfd2be2d63d9f6791faf15993dc54abafde1fdf74297174",
+    "libx11-data_1.6.2-3+deb8u2_all.deb": "8b5c2679ca7ddee702ef58f2d31e7176bc7d08d648089a3b0ac48d51ec8f10e1",
+    "libx11-dev_1.6.2-3+deb8u2_amd64.deb": "8a3189ee53d6bf36558eaf262eb9bece3918df16906cf391eec28a96cbdee200",
+    "libxau-dev_1.0.8-1_amd64.deb": "256706493b32161b061c9fa452df1774d5004879cb73262ae2b52aa93b5dd91a",
+    "libxau6_1.0.8-1_amd64.deb": "b03b2d0d400c2002a2d38300bd6630306abb0ff325c3d4a4447ecceb58335228",
+    "libxcb-render0-dev_1.10-3+b1_amd64.deb": "ab98d4d5288bfedc75151ea69a2db20e24c9cfb7a88e3501e6bf4abc8f1eac57",
+    "libxcb-render0_1.10-3+b1_amd64.deb": "1277261ed3b901d70b01901836b2f6d89235dd6777636f3f26b5d2979f1c7e22",
+    "libxcb-shm0-dev_1.10-3+b1_amd64.deb": "2e2c84d6f2967a73d2c41ee63b754b74ffe382f52695fe9abe15f29bfbcdab0a",
+    "libxcb-shm0_1.10-3+b1_amd64.deb": "724749f2ea6a471ba353f6a93585bf98577c2103648297fac40c46b9a08671b0",
+    "libxcb1-dev_1.10-3+b1_amd64.deb": "b7897143190b96156330fbf4b0922911e79605a637169bdd795a3935ac89a8b2",
+    "libxcb1_1.10-3+b1_amd64.deb": "07bf131f4f0f8a9f1a023ab88cce3a1d12cc7222d3c7f08f00b60a3699af5188",
+    "libxcomposite-dev_0.4.4-1_amd64.deb": "13e10b5fe5684d51c34400f4bd3af4924c1e8df3b2c2ec97651c69af2cca7995",
+    "libxcomposite1_0.4.4-1_amd64.deb": "ff739711c5aa6df107fdfb6e13491e8317b2c45477d91a6b17da5660cd8ca8f4",
+    "libxcursor-dev_1.1.14-1+deb8u2_amd64.deb": "7bcddee3eeecdb4e36fbac248ccee9a7f003fda00a4f2f500525413fbcc7b592",
+    "libxcursor1_1.1.14-1+deb8u2_amd64.deb": "011d069b9bf6604c19c1d07dc7214b24a8fea6dfbb6748fb1fd90532c855c00b",
+    "libxdamage-dev_1.1.4-2+b1_amd64.deb": "8c2e84a5abf0659c25e63a8378c409fa933a84c3e5b03b8d26bfdc2fa422d108",
+    "libxdamage1_1.1.4-2+b1_amd64.deb": "c2b13deaa87dbad7d541e29755464f125409b9d4d038d6982bb9f8f35939b817",
+    "libxdmcp-dev_1.1.1-1+b1_amd64.deb": "953ad14c0ce8e57cd0aecf7b600494a15fec75ef348d316f31346c87058b6b5c",
+    "libxdmcp6_1.1.1-1+b1_amd64.deb": "6758bc820616254634fdd2354a2691e40d2973d6bf3a9c12417f02770f75081c",
+    "libxext-dev_1.3.3-1_amd64.deb": "35d62e8b6c72ea9ae67488f06360224a918f6d87ceb27575f49a9e712bf8b70a",
+    "libxext6_1.3.3-1_amd64.deb": "5105f77289a7e08faaf3bb4c16c6945cafca65b9bdb4792fef820045ab43e568",
+    "libxfixes-dev_5.0.1-2+deb8u1_amd64.deb": "4dc7467a9dbc531d95884217437e2e8e856c8f211fe3fcebb2297998f72901b3",
+    "libxfixes3_5.0.1-2+deb8u1_amd64.deb": "bc30bf139964c7505776374c7ba8a7f9bd7c6bd101823f3d6a1f3b0bf11e41ee",
+    "libxft-dev_2.3.2-1_amd64.deb": "c811f5f4e941224852f44b5b284c383f8b1d4c6bfd1ce15b19331eeb9b54aace",
+    "libxft2_2.3.2-1_amd64.deb": "38d6013c0b6305caf38932e6274108d81b2b2df0dd67f04987aa3f69c1e6677e",
+    "libxi-dev_1.7.4-1+deb8u1_amd64.deb": "77dd8c34c69d86dec841028c0fca646544cea079ee95643db3fdc15cbdf9d8bf",
+    "libxi6_1.7.4-1+deb8u1_amd64.deb": "a99de627a07f54bc40e5dc77e3ca7e9d9b5619e068f1bb303f86edd138d6d037",
+    "libxinerama-dev_1.1.3-1+b1_amd64.deb": "0e2504bbe3501aae376691e2519336533309c8a97715f8a2b060cdcd6abce15f",
+    "libxinerama1_1.1.3-1+b1_amd64.deb": "3668c1178ac649879338192759e79879e0f5797764b448dcac6aed4b24ef495b",
+    "libxkbcommon-dev_0.4.3-2_amd64.deb": "65e9044239f62b82d92582cb9d210ebe42e9c335c78b6c78977db996b7eacf77",
+    "libxkbcommon0_0.4.3-2_amd64.deb": "380200621efda1fb05daea2f858baad10c776a2ae0fd1fbce1844111f8cdff08",
+    "libxml2_2.9.1+dfsg1-5+deb8u7_amd64.deb": "34dcf3dc64e65935fa9e31ba9aa5d1795ed054f17203f01255a1875e55435f70",
+    "libxrandr-dev_1.4.2-1+deb8u1_amd64.deb": "d64ac2abe410fe6e25c6de2b90fd2a65dbfdf027c117a574714a0a60c019738f",
+    "libxrandr2_1.4.2-1+deb8u1_amd64.deb": "e59996ac0e993331799aa7bc768f7edd7b0baec0fafdbeebeef658834ba96b63",
+    "libxrender-dev_0.9.8-1+b1_amd64.deb": "d17bd9a32eaecdd75d465d38bfc6318aa00e92fa5289ed36a8853f94feb18cbe",
+    "libxrender1_0.9.8-1+b1_amd64.deb": "8980934c84c0ebbca4158023d91ced3ddbfa028a2be25959ff4566b37eceb8f4",
+    "libxtst-dev_1.2.2-1+deb8u1_amd64.deb": "185f048b97dc6c5eb2ce6cc433bdd617ce81ea886162907bb0905e03b04b7e9f",
+    "libxtst6_1.2.2-1+deb8u1_amd64.deb": "caf381b445c684c1d8b46e14750bba16999ab71067ec823060c70778d19d3300",
+    "lsb-base_4.1+Debian13+nmu1_all.deb": "1a200ffcc9d21838768f3acdc512e6ad6a8502bb70ecd3f597b660a56acaf739",
+    "passwd_4.2-3+deb8u4_amd64.deb": "fcbfdc2d0b102babbb7dc5d477a03a09f0b563a42a2b80508e7a18523138fead",
+    "pkg-config_0.28-1_amd64.deb": "0c2454f379d35c3acdeed1bb2b15e5fb8629fb347908a4fbe8815ec29e07f326",
+    "python3-cairo_1.10.0+dfsg-4+b1_amd64.deb": "89dd5d7a430e75fe31d95b92c84f97295164f419df166dfc9951d7bb89f76327",
+    "python3-gi-cairo_3.14.0-1_amd64.deb": "e67dee22e98f1c555fcff23cf2efbd2ef4a90b35200fe0edcc49e853401daf0f",
+    "python3-gi_3.14.0-1_amd64.deb": "67c6c67daf622fe0e0f38627873df6a8589d8716ce3ff41b4fde2e5f15235479",
+    "python3-shapely_1.4.3-1_amd64.deb": "c6bcd18fdd512b8d0a1516909e49a04a876cec60156c742ceab98405ec754389",
+    "python_2.7.9-1_amd64.deb": "93dc9d03df366d658832fb238a6c1e6c57e5e57dd648145c2f57a8f3e2b419ed",
+    "sensible-utils_0.0.9+deb8u1_all.deb": "0de3d1447f16851862e57951a6779c5adc9a97d0438092b2761c0d989c64ae9c",
+    "shared-mime-info_1.3-1_amd64.deb": "50c122e36f96e5cc808c6b7528ebd27f8086783e2c5b7c39ac7f6da6f62b09c1",
+    "ttf-bitstream-vera_1.10-8_all.deb": "328def7f581bf94b3b06d21e641f3e5df9a9b2e84e93b4206bc952fe8e80f38a",
+    "ucf_3.0030_all.deb": "1b93d9fc5930b9d8382705b71605e07fe11f4796db239b7ac2644bf4fbd7f6a2",
+    "x11-common_7.7+7_all.deb": "5ea7301f38ffdfd987655e55b7ce74aa556718f20fca79077e0cf69372022c95",
+    "x11proto-composite-dev_0.4.2-2_all.deb": "524fcfc77f61bcfda270ae6e2508e2eebdbf39e7d611d8ee13cd7ab38e2c0a44",
+    "x11proto-core-dev_7.0.26-1_all.deb": "9d60c962746bf2d1b1eb69e872a57eb21e13b341329ca592fd8eca527bab1df6",
+    "x11proto-damage-dev_1.2.1-2_all.deb": "a4fa4c2f2a24d0a1d49c66315c17d1600d1583ac20f7627bcec3aedc47865f2f",
+    "x11proto-fixes-dev_5.0-2_all.deb": "e08e0aa9b58ffccc7685c6715df77a9c00781575a6229b4497b06b32bd61336c",
+    "x11proto-input-dev_2.3.1-1_all.deb": "a61a10b34cb0ffac6a2603971be1afd4908ed2830b6a1c554e74ac3321bb1e35",
+    "x11proto-kb-dev_1.0.6-2_all.deb": "b7ff8eceb9f05eb470700807c73fdae88f5f9f8b8fbef869029882264dbebd81",
+    "x11proto-randr-dev_1.4.0-2_all.deb": "3d49d2e205da5d2ca4cdca8d5782e47da5c11ad762c046ffb6173beb5f0d837e",
+    "x11proto-record-dev_1.14.2-1_all.deb": "288f8b9f4b050ae21f6ab7c70503c66a3177be6611ae08045d128cba9dfa5ea9",
+    "x11proto-render-dev_0.11.1-2_all.deb": "606d63fab57421afe305e4866edb1948e4f9090409d6f63199838ac269d8cfba",
+    "x11proto-xext-dev_7.3.0-1_all.deb": "bb505470525281ad330093a9d9d23f4a36b00d0b8502dcbc05e44781375abdf0",
+    "x11proto-xinerama-dev_1.2.1-2_all.deb": "b043b371e81e8e276eefca53dc114947bf984a3a004ef007452c3f74560ce140",
+    "xkb-data_2.12-1_all.deb": "57c41945a76d9620af0df4dcb0aa7e62e1be9fa69b433fd0a577e116abcb28d3",
+    "xorg-sgml-doctools_1.11-1_all.deb": "359dc76bf7b19fbbdb0b9e3ca3077e415b5b9ca8ff85162ccc889f9974493600",
+    "xtrans-dev_1.3.4-1_all.deb": "c4e0b9534370762410efdaaa7375c97c95b77c60ec1502448dd549625d192786",
+    "zlib1g-dev_1.2.8.dfsg-2+b1_amd64.deb": "71678d2ff2774a726f413cd46a923f960cdcfb56f063d20c1544a2d8b6d12d7f",
+}
diff --git a/debian/python_shapely_init.patch b/debian/python_shapely_init.patch
new file mode 100644
index 0000000..0304760
--- /dev/null
+++ b/debian/python_shapely_init.patch
@@ -0,0 +1,8 @@
+--- a/__init__.py	2018-10-17 21:55:40.000000000 -0700
++++ b/__init__.py	2018-10-17 22:54:48.798723540 -0700
+@@ -1 +1,5 @@
+ __version__ = "1.4.3"
++
++import os
++_base = os.path.dirname(os.path.dirname(__file__))
++os.environ['LIBRARY_PATH'] = os.path.join(_base, 'rpathed', 'usr', 'lib')
diff --git a/motors/python/BUILD b/motors/python/BUILD
index 903b397..d5d74ae 100644
--- a/motors/python/BUILD
+++ b/motors/python/BUILD
@@ -3,6 +3,9 @@
     srcs = [
         "big_phase_current.py",
     ],
+    data = [
+        "@python_repo//:scipy",
+    ],
     legacy_create_init = False,
     restricted_to = ["//tools:k8"],
     deps = [
@@ -10,6 +13,7 @@
         "//external:python-gflags",
         "//external:python-glog",
         "//frc971/control_loops/python:controls",
+        "@matplotlib",
     ],
 )
 
diff --git a/motors/python/big_phase_current.py b/motors/python/big_phase_current.py
index 7b967da..718d4d9 100755
--- a/motors/python/big_phase_current.py
+++ b/motors/python/big_phase_current.py
@@ -1,4 +1,6 @@
-#!/usr/bin/python3
+#!/usr/bin/python
+
+from __future__ import print_function
 
 import numpy
 from matplotlib import pylab
@@ -106,10 +108,10 @@
 # by to get motor current.
 one_amp_scalar = (phases(f_single, 0.0).T * phases(g_single, 0.0))[0, 0]
 
-print 'Max BEMF', max(f(theta_range))
-print 'Max current', max(g(theta_range))
-print 'Max drive voltage (one_amp_driving_voltage)', max(one_amp_driving_voltage)
-print 'one_amp_scalar', one_amp_scalar
+print('Max BEMF', max(f(theta_range)))
+print('Max current', max(g(theta_range)))
+print('Max drive voltage (one_amp_driving_voltage)', max(one_amp_driving_voltage))
+print('one_amp_scalar', one_amp_scalar)
 
 pylab.figure()
 pylab.subplot(1, 1, 1)
@@ -420,15 +422,15 @@
         controls.c2d(-self.A_model, self.B_model, 1.0 / hz)
     self.B_discrete_inverse_model = numpy.matrix(numpy.eye(3)) / (self.B_discrete_model[0, 0] - self.B_discrete_model[1, 0])
 
-    print 'constexpr double kL = %g;' % self.L_model
-    print 'constexpr double kM = %g;' % self.M_model
-    print 'constexpr double kR = %g;' % self.R_model
-    print 'constexpr float kAdiscrete_diagonal = %gf;' % self.A_discrete_model[0, 0]
-    print 'constexpr float kAdiscrete_offdiagonal = %gf;' % self.A_discrete_model[1, 0]
-    print 'constexpr float kBdiscrete_inv_diagonal = %gf;' % self.B_discrete_inverse_model[0, 0]
-    print 'constexpr float kBdiscrete_inv_offdiagonal = %gf;' % self.B_discrete_inverse_model[1, 0]
-    print 'constexpr double kOneAmpScalar = %g;' % one_amp_scalar
-    print 'constexpr double kMaxOneAmpDrivingVoltage = %g;' % max_one_amp_driving_voltage
+    print('constexpr double kL = %g;' % self.L_model)
+    print('constexpr double kM = %g;' % self.M_model)
+    print('constexpr double kR = %g;' % self.R_model)
+    print('constexpr float kAdiscrete_diagonal = %gf;' % self.A_discrete_model[0, 0])
+    print('constexpr float kAdiscrete_offdiagonal = %gf;' % self.A_discrete_model[1, 0])
+    print('constexpr float kBdiscrete_inv_diagonal = %gf;' % self.B_discrete_inverse_model[0, 0])
+    print('constexpr float kBdiscrete_inv_offdiagonal = %gf;' % self.B_discrete_inverse_model[1, 0])
+    print('constexpr double kOneAmpScalar = %g;' % one_amp_scalar)
+    print('constexpr double kMaxOneAmpDrivingVoltage = %g;' % max_one_amp_driving_voltage)
     print('A_discrete', self.A_discrete)
     print('B_discrete', self.B_discrete)
     print('B_discrete_sub', numpy.linalg.inv(self.B_discrete[0:2, 0:2]))
@@ -520,8 +522,8 @@
     # So, we now know how much the change in current is due to changes in BEMF.
     # Subtract that, and then run the stock statespace equation.
     Vn_ff = self.B_discrete_inverse * (Inext - self.A_discrete * (Icurrent - p) - p_next_imag.real)
-    print 'Vn_ff', Vn_ff
-    print 'Inext', Inext
+    print('Vn_ff', Vn_ff)
+    print('Inext', Inext)
     Vn = Vn_ff + self.K * (Icurrent - measured_current)
 
     E = phases(f_single, self.X[3, 0]) / Kv * self.X[4, 0]
@@ -568,7 +570,7 @@
 
         self.current_time = t
 
-    print 'Took %f to simulate' % (time.time() - start_wall_time)
+    print('Took %f to simulate' % (time.time() - start_wall_time))
 
     self.data_logger.plot()
 
diff --git a/y2018/control_loops/python/BUILD b/y2018/control_loops/python/BUILD
index 3982722..925e7b6 100644
--- a/y2018/control_loops/python/BUILD
+++ b/y2018/control_loops/python/BUILD
@@ -96,13 +96,13 @@
 )
 
 cc_library(
-  name = 'dlqr',
-  hdrs = [
-    'dlqr.h',
-  ],
+    name = "dlqr",
+    hdrs = [
+        "dlqr.h",
+    ],
     deps = [
-        '@slycot_repo//:slicot',
-  ],
+        "@slycot_repo//:slicot",
+    ],
 )
 
 cc_binary(
@@ -110,15 +110,15 @@
     srcs = [
         "arm_mpc.cc",
     ],
+    restricted_to = ["//tools:k8"],
     deps = [
         ":arm_bounds",
-        ':dlqr',
+        ":dlqr",
         "//third_party/ct",
         "//third_party/gflags",
         "//third_party/matplotlib-cpp",
         "@cgal_repo//:cgal",
     ],
-    restricted_to = ["//tools:k8"],
 )
 
 cc_binary(
@@ -169,9 +169,11 @@
     ],
     default_python_version = "PY3",
     legacy_create_init = False,
+    restricted_to = ["//tools:k8"],
     srcs_version = "PY3",
     deps = [
         ":python_init",
+        "@python_gtk",
     ],
 )
 
@@ -210,15 +212,15 @@
 )
 
 py_binary(
-  name = 'arm_mpc_py',
-  srcs = [
-    'arm_mpc.py',
-  ],
-  main = 'arm_mpc.py',
-  deps = [
-    '//external:python-gflags',
-    '//external:python-glog',
-    '//frc971/control_loops/python:controls',
-  ],
-  restricted_to = ['//tools:k8'],
+    name = "arm_mpc_py",
+    srcs = [
+        "arm_mpc.py",
+    ],
+    main = "arm_mpc.py",
+    restricted_to = ["//tools:k8"],
+    deps = [
+        "//external:python-gflags",
+        "//external:python-glog",
+        "//frc971/control_loops/python:controls",
+    ],
 )
diff --git a/y2018/control_loops/python/graph_edit.py b/y2018/control_loops/python/graph_edit.py
index dde67c5..e2b0412 100644
--- a/y2018/control_loops/python/graph_edit.py
+++ b/y2018/control_loops/python/graph_edit.py
@@ -1,3 +1,5 @@
+#!/usr/bin/python3
+
 from __future__ import print_function
 import os
 import basic_window