blob: 348163e757be3eb6f79740ed461152a9feb98877 [file] [log] [blame]
Philipp Schrader0e19c602018-03-07 21:07:22 -08001package(default_visibility = ["//visibility:public"])
Austin Schuh55139fe2015-10-14 23:55:24 -07002
Philipp Schrader0e19c602018-03-07 21:07:22 -08003load(
4 "//debian:python.bzl",
5 python_debs = "files",
6)
Philipp Schraderaedfc5c2018-03-10 19:32:30 -08007load(
8 "//debian:clang.bzl",
9 clang_debs = "files",
10)
Brian Silverman7bda6212018-08-05 11:42:11 -070011load(
12 ":patch.bzl",
13 patch_debs = "files",
14)
Brian Silverman7297c0c2018-08-05 13:43:00 -070015load(
Austin Schuh71f6fa72019-08-31 18:23:02 -070016 ":rsync.bzl",
17 rsync_debs = "files",
18)
19load(
20 ":ssh.bzl",
21 ssh_debs = "files",
22)
23load(
Brian Silverman7297c0c2018-08-05 13:43:00 -070024 ":pandoc.bzl",
25 pandoc_debs = "files",
26)
Brian Silverman4f6ba442018-08-05 14:34:58 -070027load(
28 ":libusb.bzl",
29 libusb_debs = "files",
30)
Brian Silvermanb80dc9f2018-08-05 14:59:24 -070031load(
32 ":mingw_compiler.bzl",
33 mingw_compiler_debs = "files",
34)
Brian Silverman6470f442018-08-05 12:08:16 -070035load(
36 ":patchelf.bzl",
37 patchelf_debs = "files",
38)
39load(
40 ":matplotlib.bzl",
41 matplotlib_debs = "files",
42)
Brian Silverman50b9ac02018-08-12 13:24:10 -070043load(
44 ":arm_frc_gnueabi_deps.bzl",
45 arm_frc_gnueabi_deps_debs = "files",
46)
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -070047load(
48 ":python_gtk.bzl",
49 python_gtk_debs = "files",
50)
Brian Silvermand4260c72020-01-14 00:08:02 -080051load(
52 ":opencv_armhf.bzl",
53 opencv_armhf_debs = "files",
54)
Brian Silvermand97a47c2020-01-16 00:47:53 -080055load(
56 ":opencv_amd64.bzl",
57 opencv_amd64_debs = "files",
58)
Tyler Chatow60671d32020-02-26 19:49:30 -080059load(
60 ":gstreamer_amd64.bzl",
61 gstreamer_amd64_debs = "files",
62)
63load(
64 ":gstreamer_armhf.bzl",
65 gstreamer_armhf_debs = "files",
66)
Austin Schuh023e7f52020-08-18 21:24:37 -070067load(
Brian Silvermanf59fe3f2020-09-22 21:04:09 -070068 ":m4.bzl",
Austin Schuh023e7f52020-08-18 21:24:37 -070069 m4_debs = "files",
70)
Brian Silvermanf59fe3f2020-09-22 21:04:09 -070071load(
72 ":lzma_amd64.bzl",
73 lzma_amd64_debs = "files",
74)
75load(
76 ":lzma_arm64.bzl",
77 lzma_arm64_debs = "files",
78)
79load(":packages.bzl", "download_packages", "generate_deb_tarball")
Philipp Schrader0e19c602018-03-07 21:07:22 -080080
Brian Silverman6470f442018-08-05 12:08:16 -070081filegroup(
82 name = "matplotlib_patches",
83 srcs = [
84 "matplotlib_init.patch",
85 ],
James Kuszmaul910f92b2020-01-01 15:30:38 -080086 visibility = ["@matplotlib_repo//:__pkg__"],
Brian Silverman6470f442018-08-05 12:08:16 -070087)
88
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -070089filegroup(
90 name = "python_shapely_patches",
91 srcs = [
92 "python_shapely_init.patch",
93 ],
94 visibility = ["@python_gtk//:__pkg__"],
95)
96
97filegroup(
98 name = "python_gi_patches",
99 srcs = [
100 "python_gi_init.patch",
101 ],
102 visibility = ["@python_gtk//:__pkg__"],
103)
104
105filegroup(
106 name = "python_geos_patches",
107 srcs = [
108 "python_geos.patch",
109 ],
110 visibility = ["@python_gtk//:__pkg__"],
111)
112
Philipp Schrader0e19c602018-03-07 21:07:22 -0800113py_binary(
114 name = "download_packages",
115 srcs = [
116 "download_packages.py",
117 ],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800118 main = "download_packages.py",
Philipp Schraderdada1072020-11-24 11:34:46 -0800119 python_version = "PY3",
Philipp Schrader0e19c602018-03-07 21:07:22 -0800120 srcs_version = "PY2AND3",
Philipp Schraderdada1072020-11-24 11:34:46 -0800121 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800122)
123
124download_packages(
125 name = "download_python_deps",
126 excludes = [
127 "libblas.so.3",
128 "liblapack.so.3",
129 ],
130 packages = [
131 "python-dev",
132 "python-numpy",
Brian Silverman6470f442018-08-05 12:08:16 -0700133 "python-scipy",
Philipp Schrader0e19c602018-03-07 21:07:22 -0800134 "python3-dev",
135 "python3-numpy",
Brian Silverman6470f442018-08-05 12:08:16 -0700136 "python3-scipy",
Philipp Schrader0e19c602018-03-07 21:07:22 -0800137 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800138 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800139)
140
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800141download_packages(
142 name = "download_clang_deps",
143 excludes = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800144 "lib32stdc++6",
145 "libstdc++6",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800146 ],
147 force_includes = [
148 "libc6",
149 "libc6-dev",
150 ],
151 packages = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800152 "clang-6.0",
153 "clang-format-6.0",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800154 "gcc",
155 "gfortran",
156 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800157 target_compatible_with = ["@platforms//os:linux"],
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800158)
159
Brian Silverman7bda6212018-08-05 11:42:11 -0700160download_packages(
161 name = "download_patch_deps",
162 packages = [
163 "patch",
164 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800165 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7bda6212018-08-05 11:42:11 -0700166)
167
Brian Silverman7297c0c2018-08-05 13:43:00 -0700168download_packages(
169 name = "download_pandoc_deps",
170 packages = [
171 "pandoc",
172 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800173 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -0700174)
175
Brian Silverman4f6ba442018-08-05 14:34:58 -0700176download_packages(
177 name = "download_libusb_deps",
178 packages = [
179 "libusb-0.1-4",
180 "libusb-1.0-0",
181 "libusb-1.0-0-dev",
182 "libusb-dev",
183 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800184 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4f6ba442018-08-05 14:34:58 -0700185)
186
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700187download_packages(
188 name = "download_mingw_compiler_deps",
189 packages = [
190 "g++-mingw-w64-x86-64",
191 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800192 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700193)
194
Brian Silverman6470f442018-08-05 12:08:16 -0700195download_packages(
196 name = "download_patchelf_deps",
197 packages = [
198 "patchelf",
199 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800200 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700201)
202
203download_packages(
204 name = "download_matplotlib_deps",
205 excludes = [
206 "python-dev",
207 "python-numpy",
208 "python-scipy",
209 "python3-dev",
210 "python3-numpy",
211 "python3-scipy",
212 "x11-common",
213 "fonts-freefont",
214 "python",
215 "libcups2",
216 ],
217 packages = [
218 "python-matplotlib",
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700219 "python-tk",
Brian Silverman6470f442018-08-05 12:08:16 -0700220 "python3-matplotlib",
James Kuszmaul910f92b2020-01-01 15:30:38 -0800221 "python3-tk",
Brian Silverman6470f442018-08-05 12:08:16 -0700222 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800223 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700224)
225
Brian Silverman50b9ac02018-08-12 13:24:10 -0700226# This list was obtained by manually looking at the output from:
227# find bazel-out/../../../external/arm_frc_linux_gnueabi_repo/ -executable -type f -exec ldd {} + | sed 's/=>.*//g' | sort -u
228download_packages(
229 name = "download_arm_frc_gnueabi_deps",
230 packages = [
231 "libexpat1",
232 "libgmp10",
233 "libisl10",
234 "liblzma5",
235 "libmpc3",
236 "libmpfr4",
237 "libncurses5",
238 "libtinfo5",
239 "zlib1g",
240 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800241 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700242)
243
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700244download_packages(
245 name = "download_python_gtk_deps",
246 excludes = [
247 "fonts-freefont",
248 "gsettings-backend",
249 "libpng-dev",
250 "libz-dev",
251 "python3-dev",
252 "python3",
James Kuszmaulf89cfab2020-01-17 19:48:25 -0800253 "libblas.so.3",
254 "liblapack.so.3",
255 "libstdc++-dev",
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700256 ],
257 packages = [
258 "libgtk-3-dev",
259 "python3-cairo",
260 "python3-gi",
261 "python3-gi-cairo",
262 "python3-shapely",
263 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800264 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700265)
266
Austin Schuh023e7f52020-08-18 21:24:37 -0700267download_packages(
268 name = "download_m4",
269 packages = [
270 "m4",
271 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800272 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh023e7f52020-08-18 21:24:37 -0700273)
274
Philipp Schrader0e19c602018-03-07 21:07:22 -0800275generate_deb_tarball(
276 name = "python",
277 files = python_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800278 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800279)
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800280
281generate_deb_tarball(
James Kuszmaul3ae42262019-11-08 12:33:41 -0800282 name = "clang_6p0",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800283 files = clang_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800284 target_compatible_with = ["@platforms//os:linux"],
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800285)
Brian Silverman7bda6212018-08-05 11:42:11 -0700286
287generate_deb_tarball(
288 name = "patch",
289 files = patch_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800290 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7bda6212018-08-05 11:42:11 -0700291)
Brian Silverman7297c0c2018-08-05 13:43:00 -0700292
293generate_deb_tarball(
Austin Schuh71f6fa72019-08-31 18:23:02 -0700294 name = "rsync",
295 files = rsync_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800296 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh71f6fa72019-08-31 18:23:02 -0700297)
298
299generate_deb_tarball(
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800300 name = "ssh_v3",
Austin Schuh71f6fa72019-08-31 18:23:02 -0700301 files = ssh_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800302 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh71f6fa72019-08-31 18:23:02 -0700303)
304
305generate_deb_tarball(
Brian Silverman7297c0c2018-08-05 13:43:00 -0700306 name = "pandoc",
307 files = pandoc_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800308 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -0700309)
Brian Silverman4f6ba442018-08-05 14:34:58 -0700310
311generate_deb_tarball(
312 name = "libusb",
313 files = libusb_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800314 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4f6ba442018-08-05 14:34:58 -0700315)
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700316
317generate_deb_tarball(
318 name = "mingw_compiler",
319 files = mingw_compiler_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800320 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700321)
Brian Silverman6470f442018-08-05 12:08:16 -0700322
323generate_deb_tarball(
324 name = "patchelf",
325 files = patchelf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800326 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700327)
328
329generate_deb_tarball(
330 name = "matplotlib",
331 files = matplotlib_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800332 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700333)
Brian Silverman50b9ac02018-08-12 13:24:10 -0700334
335generate_deb_tarball(
336 name = "arm_frc_gnueabi_deps",
337 files = arm_frc_gnueabi_deps_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800338 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700339)
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700340
341generate_deb_tarball(
342 name = "python_gtk",
343 files = python_gtk_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800344 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700345)
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800346
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800347# Starting point for opencv package list below.
348download_packages(
349 name = "download_opencv",
350 packages = [
351 "libopencv-calib3d-dev",
352 "libopencv-calib3d3.2",
353 "libopencv-contrib-dev",
354 "libopencv-contrib3.2",
355 "libopencv-core-dev",
356 "libopencv-core3.2",
357 "libopencv-dev",
358 "libopencv-features2d-dev",
359 "libopencv-features2d3.2",
360 "libopencv-flann-dev",
361 "libopencv-flann3.2",
362 "libopencv-highgui-dev",
363 "libopencv-highgui3.2",
364 "libopencv-imgcodecs-dev",
365 "libopencv-imgcodecs3.2",
366 "libopencv-imgproc-dev",
367 "libopencv-imgproc3.2",
368 "libopencv-ml-dev",
369 "libopencv-ml3.2",
370 "libopencv-objdetect-dev",
371 "libopencv-objdetect3.2",
372 "libopencv-photo-dev",
373 "libopencv-photo3.2",
374 "libopencv-shape-dev",
375 "libopencv-shape3.2",
376 "libopencv-stitching-dev",
377 "libopencv-stitching3.2",
378 "libopencv-superres-dev",
379 "libopencv-superres3.2",
380 "libopencv-ts-dev",
381 "libopencv-video-dev",
382 "libopencv-video3.2",
383 "libopencv-videoio-dev",
384 "libopencv-videoio3.2",
385 "libopencv-videostab-dev",
386 "libopencv-videostab3.2",
387 "libopencv-viz-dev",
388 "libopencv-viz3.2",
389 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800390 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800391)
392
Brian Silvermand4260c72020-01-14 00:08:02 -0800393# This list was generated with download_packages.py on armhf and then
394# hand-tweaked to get everything it needs.
395generate_deb_tarball(
396 name = "opencv_armhf_v3",
397 files = opencv_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800398 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand4260c72020-01-14 00:08:02 -0800399)
400
Brian Silvermand97a47c2020-01-16 00:47:53 -0800401# This was hand-written based on opencv_armhf.bzl.
402generate_deb_tarball(
403 name = "opencv_amd64",
404 files = opencv_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800405 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand97a47c2020-01-16 00:47:53 -0800406)
407
Tyler Chatow60671d32020-02-26 19:49:30 -0800408generate_deb_tarball(
409 name = "gstreamer_amd64",
410 files = gstreamer_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800411 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800412)
413
414generate_deb_tarball(
415 name = "gstreamer_armhf",
416 files = gstreamer_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800417 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800418)
419
Austin Schuh023e7f52020-08-18 21:24:37 -0700420generate_deb_tarball(
421 name = "m4",
422 files = m4_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800423 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh023e7f52020-08-18 21:24:37 -0700424)
425
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700426download_packages(
427 name = "download_lzma",
428 packages = [
429 "liblzma-dev",
430 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800431 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700432)
433
434generate_deb_tarball(
435 name = "lzma_amd64",
436 files = lzma_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800437 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700438)
439
440generate_deb_tarball(
441 name = "lzma_arm64",
442 files = lzma_arm64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800443 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700444)
445
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800446exports_files([
447 "ssh_wrapper.sh",
448])