blob: d94efd951ef7c6105e52b9ee0c2816b93ea785bc [file] [log] [blame]
files = {
"blt_2.5.3+dfsg-4_amd64.deb": "624e1c02bc1e72fa77523f514a606b7b7da3399def37995d016955b8d950584b",
"coreutils_8.30-3_amd64.deb": "ae6e5cd6e9aaf74d66edded3931a7a6c916625b8b890379189c75574f6856bf4",
"fontconfig-config_2.13.1-2_all.deb": "9f5d34ba20eb156ef62d8126866a376be985c6a83fdcfb33f12cd83acac480c2",
"fonts-dejavu-core_2.37-1_all.deb": "58d21a255606191e6512cca51f32c4480e7a798945cc980623377696acfa3cfc",
"fonts-liberation_1.07.4-9_all.deb": "c936aebbfd0af7851399ae5ab08bb01744f5e3381f7678fb87cc77114f95ef53",
"fonts-lyx_2.3.2-1_all.deb": "9b66e257d16c593fc78ebb14f5b72c4a8e00f09984bc2242359a0b16b4efbd87",
"libbsd0_0.9.1-2_amd64.deb": "0827321e85d36200759e3ec621fc05154c752534c330ffc5472ad75bbb8eb913",
"libfontconfig1_2.13.1-2_amd64.deb": "6766d0bcfc615fb15542efb5235d38237ccaec4c219beb84dbd22d1662ccea8f",
"libfreetype6_2.9.1-3+deb10u2_amd64.deb": "93f009440fd1ffcc4b3afdbc413eccc1d8101145a262ca0d0c305fc7029f2417",
"libjs-jquery-ui_1.12.1+dfsg-5_all.deb": "42918c7650c60346ac2c5c7596af220bfc858ff2c7d5f63eb02be8902aaa5755",
"libjs-jquery_3.3.1~dfsg-3_all.deb": "1276015fa73712e78262995343c5f5313a5c2efe7eff91741c2b9de1fe721fdf",
"libpng16-16_1.6.36-6_amd64.deb": "82a252478465521cde9d5af473df01ed79f16e912effc5971892a574e9113500",
"libtcl8.6_8.6.9+dfsg-2_amd64.deb": "7b5d095b83e13b9b571cfecde55834b770735e29ff23a52d45e9f4692d4c64a1",
"libtk8.6_8.6.9-2_amd64.deb": "a250aba06a5fc9c90622b6e1c3560ff351f945ed7234f61267ec3688370d1770",
"libx11-6_1.6.7-1+deb10u1_amd64.deb": "f9d62eaa734828d4282fe4c17613c1a688af4cccbe2819eb691b3aaf615e882f",
"libx11-data_1.6.7-1+deb10u1_all.deb": "02f795889390fa0e1f29c6ecdd4a30cd0aae39c0c6b1379410055404b0897c66",
"libxau6_1.0.8-1+b2_amd64.deb": "a7857b726c3e0d16cda2fbb9020d42e024a3160d54ef858f58578612276683e8",
"libxcb1_1.13.1-2_amd64.deb": "87d9ed9340dc3cb6d7ce024d2e046a659d91356863083715d2c428a32e908833",
"libxdmcp6_1.1.2-3_amd64.deb": "ecb8536f5fb34543b55bb9dc5f5b14c9dbb4150a7bddb3f2287b7cab6e9d25ef",
"libxext6_1.3.3-1+b2_amd64.deb": "724901105792e983bd0e7c2b46960cd925dd6a2b33b5ee999b4e80aaf624b082",
"libxft2_2.3.2-2_amd64.deb": "cd71384b4d511cba69bcee29af326943c7ca12450765f44c40d246608c779aad",
"libxrender1_0.9.10-1_amd64.deb": "3ea17d07b5aa89012130e2acd92f0fc0ea67314e2f5eab6e33930ef688f48294",
"libxss1_1.2.3-1_amd64.deb": "85cce16368f08a878fa892fbc54520fc654d00769cde6d300b8b802734a993c0",
"node-jquery_2.2.4+dfsg-4_all.deb": "92dcf4950fb9a8ee2f50557af2ca50ca426f5fb89fc6812009ff2775e02e330e",
"python-backports.functools-lru-cache_1.5-3_all.deb": "e9c96b612156453ce58a47ae906e0e52f3b2a78a505f12fd860419822e205d0a",
"python-cycler_0.10.0-1_all.deb": "ed00546b732c9361205ca392ef178995ca50e647e2940261c61229968be3de76",
"python-dateutil_2.7.3-3_all.deb": "eb051f2d84622c46551428b5b4f7045ca3c188a31afc3934511f83f59080bde4",
"python-kiwisolver_1.0.1-2+b1_amd64.deb": "fe5e6de843c3840e0786973167d2103e11d39c4ee2dac532baf1efdf1a9f4c3c",
"python-matplotlib-data_3.0.2-2_all.deb": "da12bc151e86ec180fc86fc27edf7213e7b0f532e1d10e77a410ac9dcc92ef0c",
"python-matplotlib2-data_2.2.3-6_all.deb": "9680fb9e627dfc81c82d1019adc1b53306185bd6996c456c6fc990027980967b",
"python-matplotlib_2.2.3-6_amd64.deb": "b48c890f2e19369bb8eb20d5fe19f1fec12101110350128ffb8cb684533382f1",
"python-pyparsing_2.2.0+dfsg1-2_all.deb": "4f92606287eaebaf61a63c3e483d96f3a07d88132cf2b7774300e07089ca969a",
"python-six_1.12.0-1_all.deb": "e2fab198138d00ca05a2c79aa5490acf87cf22e2496f45721c3b8837d32e3f3b",
"python-subprocess32_3.5.3-1_amd64.deb": "d29658e8a52621f44b77bc31623c045ae7f8f159ba57539c62fe02b7f6e7581e",
"python-tk_2.7.16-2_amd64.deb": "97ec414f9328e29e70720e0ac4fbc4483299c3b98c01746491bd5740506b131b",
"python-tz_2019.1-1_all.deb": "354996dc154d9cbc15f1d7e85b930bd66f6082795cf57b7cbc8e65c54a20575e",
"python3-cycler_0.10.0-1_all.deb": "b49d81a972054f2df915002cd8ba9225fb6bd07a633487dda5813c137f6cfb76",
"python3-dateutil_2.7.3-3_all.deb": "f35233cee90828b9b167a8d6db121be6b78607ff280cc2c0503d37fcaa8c4751",
"python3-kiwisolver_1.0.1-2+b1_amd64.deb": "ea86280396a3665fc4355da9f2b0f43198fdda31cd4b8e66ed478b305fef3f29",
"python3-matplotlib_3.0.2-2_amd64.deb": "d4cd5d0227ac8013141fc9340b7a37a740e584b9517fd73d9a288f7135257f2b",
"python3-pyparsing_2.2.0+dfsg1-2_all.deb": "cfc257030609c96acfd5589d751c33cfd50e0870f22b3485fc75240c7c7ad19e",
"python3-six_1.12.0-1_all.deb": "ec43cea7798b07e39ad53bb4088f6db17ef1fb01abaebab0641da0ba0e6819e4",
"python3-tk_3.7.3-1_amd64.deb": "e869ac21e43dcea7b09fa23848e285122d4b4255a0d738d7eb2bebd6d92fbe2a",
"sensible-utils_0.0.12_all.deb": "2043859f8bf39a20d075bf52206549f90dcabd66665bb9d6837273494fc6a598",
"tk8.6-blt2.5_2.5.3+dfsg-4_amd64.deb": "752ed35d41bc98a1b79c61b196cfd479a695b6c8d6e6756a18221c4ece501f95",
"ttf-bitstream-vera_1.10-8_all.deb": "328def7f581bf94b3b06d21e641f3e5df9a9b2e84e93b4206bc952fe8e80f38a",
"tzdata_2021a-0+deb10u1_all.deb": "00da63f221b9afa6bc766742807e398cf183565faba339649bafa3f93375fbcb",
"ucf_3.0038+nmu1_all.deb": "d02a82455faab988a52121f37d97c528a4f967ed75e9398e1d8db571398c12f9",
}
def build_matplotlib(version, tkinter_py_version = None, copy_shared_files = True):
"""Creates a py_library rule for matplotlib for the given python version.
See debian/matplotlib.BUILD for the usage.
All the rules generated by this will be suffixed by version. Only one
instance of this macro should set copy_shared_files, which generate the
files that are shared between python versions.
tkinter_py_version is used because for the Python3 instance, some files
are in folders named python3 and some are in folders named python3.5...
version numbers should both be strings.
"""
if tkinter_py_version == None:
tkinter_py_version = version
native.genrule(
name = "patch_init" + version,
srcs = [
"usr/lib/python" + version + "/dist-packages/matplotlib/__init__.py",
"@//debian:matplotlib_patches",
],
outs = [version + "/matplotlib/__init__.py"],
cmd = " && ".join([
"cp $(location usr/lib/python" + version + "/dist-packages/matplotlib/__init__.py) $@",
"readonly PATCH=\"$$(readlink -f $(location @patch))\"",
"readonly FILE=\"$$(readlink -f $(location @//debian:matplotlib_patches))\"",
"(cd $(@D) && \"$${PATCH}\" -p1 < \"$${FILE}\") > /dev/null",
]),
tools = [
"@patch",
],
)
_src_files = native.glob(
include = ["usr/lib/python" + version + "/dist-packages/**/*.py"],
exclude = [
"usr/lib/python" + version + "/dist-packages/matplotlib/__init__.py",
],
)
_data_files = native.glob([
"usr/share/matplotlib/mpl-data/**",
"usr/share/tcltk/**",
])
_src_copied = ["/".join([version] + f.split("/")[4:]) for f in _src_files]
_builtin_so_files = native.glob([
"usr/lib/python" + version + "/dist-packages/**/*x86_64-linux-gnu.so",
"usr/lib/python" + tkinter_py_version + "/lib-dynload/*.so",
])
_system_so_files = native.glob([
"usr/lib/**/*.so*",
"lib/x86_64-linux-gnu/**/*.so*",
])
_builtin_so_copied = ["/".join([version] + f.split("/")[4:]) for f in _builtin_so_files]
rpath_prefix = "rpathed" + version + "/"
_system_so_copied = [rpath_prefix + f for f in _system_so_files]
_builtin_rpaths = [":".join([
"\\$$ORIGIN/%s" % rel,
"\\$$ORIGIN/%s/%s/usr/lib/x86_64-linux-gnu" % (rel, rpath_prefix),
"\\$$ORIGIN/%s/%s/usr/lib" % (rel, rpath_prefix),
"\\$$ORIGIN/%s/%s/lib/x86_64-linux-gnu" % (rel, rpath_prefix),
]) for rel in ["/".join([".." for _ in so.split("/")[1:]]) for so in _builtin_so_copied]]
_system_rpaths = [":".join([
"\\$$ORIGIN/%s/%s/usr/lib/x86_64-linux-gnu" % (rel, rpath_prefix),
"\\$$ORIGIN/%s/%s/lib/x86_64-linux-gnu" % (rel, rpath_prefix),
]) for rel in ["/".join([".." for _ in so.split("/")[1:]]) for so in _system_so_copied]]
native.genrule(
name = "run_patchelf_builtin" + version,
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",
],
)
native.genrule(
name = "run_patchelf_system" + version,
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",
],
)
native.genrule(
name = "copy_files" + version,
srcs = _src_files,
outs = _src_copied,
cmd = " && ".join(["cp $(location %s) $(location %s)" % (src, dest) for src, dest in zip(
_src_files,
_src_copied,
)]),
)
if copy_shared_files:
native.genrule(
name = "create_rc" + version,
outs = ["usr/share/matplotlib/mpl-data/matplotlibrc"],
cmd = "\n".join([
"cat > $@ << END",
# This is necessary to make matplotlib actually plot things to the
# screen by default.
"backend : TkAgg",
"END",
]),
)
native.py_library(
name = "matplotlib" + version,
srcs = _src_copied + [
version + "/matplotlib/__init__.py",
],
data = _data_files + _builtin_so_copied + _system_so_copied + [
":usr/share/matplotlib/mpl-data/matplotlibrc",
] + native.glob(["etc/**"]),
imports = ["usr/lib/python" + version + "/dist-packages", version, "."],
target_compatible_with = ["@platforms//cpu:x86_64"],
visibility = ["//visibility:public"],
)