blob: 0ea98360b87adaca450a6fc2e199b080278f3216 [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 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800120)
121
122download_packages(
123 name = "download_python_deps",
124 excludes = [
125 "libblas.so.3",
126 "liblapack.so.3",
127 ],
128 packages = [
129 "python-dev",
130 "python-numpy",
Brian Silverman6470f442018-08-05 12:08:16 -0700131 "python-scipy",
Philipp Schrader0e19c602018-03-07 21:07:22 -0800132 "python3-dev",
133 "python3-numpy",
Brian Silverman6470f442018-08-05 12:08:16 -0700134 "python3-scipy",
Philipp Schrader0e19c602018-03-07 21:07:22 -0800135 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800136 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800137)
138
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800139download_packages(
140 name = "download_clang_deps",
141 excludes = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800142 "lib32stdc++6",
143 "libstdc++6",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800144 ],
145 force_includes = [
146 "libc6",
147 "libc6-dev",
148 ],
149 packages = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800150 "clang-6.0",
151 "clang-format-6.0",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800152 "gcc",
153 "gfortran",
154 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800155 target_compatible_with = ["@platforms//os:linux"],
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800156)
157
Brian Silverman7bda6212018-08-05 11:42:11 -0700158download_packages(
159 name = "download_patch_deps",
160 packages = [
161 "patch",
162 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800163 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7bda6212018-08-05 11:42:11 -0700164)
165
Brian Silverman7297c0c2018-08-05 13:43:00 -0700166download_packages(
167 name = "download_pandoc_deps",
168 packages = [
169 "pandoc",
170 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800171 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -0700172)
173
Brian Silverman4f6ba442018-08-05 14:34:58 -0700174download_packages(
175 name = "download_libusb_deps",
176 packages = [
177 "libusb-0.1-4",
178 "libusb-1.0-0",
179 "libusb-1.0-0-dev",
180 "libusb-dev",
181 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800182 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4f6ba442018-08-05 14:34:58 -0700183)
184
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700185download_packages(
186 name = "download_mingw_compiler_deps",
187 packages = [
188 "g++-mingw-w64-x86-64",
189 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800190 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700191)
192
Brian Silverman6470f442018-08-05 12:08:16 -0700193download_packages(
194 name = "download_patchelf_deps",
195 packages = [
196 "patchelf",
197 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800198 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700199)
200
201download_packages(
202 name = "download_matplotlib_deps",
203 excludes = [
204 "python-dev",
205 "python-numpy",
206 "python-scipy",
207 "python3-dev",
208 "python3-numpy",
209 "python3-scipy",
210 "x11-common",
211 "fonts-freefont",
212 "python",
213 "libcups2",
214 ],
215 packages = [
216 "python-matplotlib",
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700217 "python-tk",
Brian Silverman6470f442018-08-05 12:08:16 -0700218 "python3-matplotlib",
James Kuszmaul910f92b2020-01-01 15:30:38 -0800219 "python3-tk",
Brian Silverman6470f442018-08-05 12:08:16 -0700220 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800221 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700222)
223
Brian Silverman50b9ac02018-08-12 13:24:10 -0700224# This list was obtained by manually looking at the output from:
225# find bazel-out/../../../external/arm_frc_linux_gnueabi_repo/ -executable -type f -exec ldd {} + | sed 's/=>.*//g' | sort -u
226download_packages(
227 name = "download_arm_frc_gnueabi_deps",
228 packages = [
229 "libexpat1",
230 "libgmp10",
231 "libisl10",
232 "liblzma5",
233 "libmpc3",
234 "libmpfr4",
235 "libncurses5",
236 "libtinfo5",
237 "zlib1g",
238 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800239 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700240)
241
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700242download_packages(
243 name = "download_python_gtk_deps",
244 excludes = [
245 "fonts-freefont",
246 "gsettings-backend",
247 "libpng-dev",
248 "libz-dev",
249 "python3-dev",
250 "python3",
James Kuszmaulf89cfab2020-01-17 19:48:25 -0800251 "libblas.so.3",
252 "liblapack.so.3",
253 "libstdc++-dev",
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700254 ],
255 packages = [
256 "libgtk-3-dev",
257 "python3-cairo",
258 "python3-gi",
259 "python3-gi-cairo",
260 "python3-shapely",
261 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800262 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700263)
264
Austin Schuh023e7f52020-08-18 21:24:37 -0700265download_packages(
266 name = "download_m4",
267 packages = [
268 "m4",
269 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800270 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh023e7f52020-08-18 21:24:37 -0700271)
272
Philipp Schrader0e19c602018-03-07 21:07:22 -0800273generate_deb_tarball(
274 name = "python",
275 files = python_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800276 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800277)
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800278
279generate_deb_tarball(
James Kuszmaul3ae42262019-11-08 12:33:41 -0800280 name = "clang_6p0",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800281 files = clang_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800282 target_compatible_with = ["@platforms//os:linux"],
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800283)
Brian Silverman7bda6212018-08-05 11:42:11 -0700284
285generate_deb_tarball(
286 name = "patch",
287 files = patch_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800288 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7bda6212018-08-05 11:42:11 -0700289)
Brian Silverman7297c0c2018-08-05 13:43:00 -0700290
291generate_deb_tarball(
Austin Schuh71f6fa72019-08-31 18:23:02 -0700292 name = "rsync",
293 files = rsync_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800294 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh71f6fa72019-08-31 18:23:02 -0700295)
296
297generate_deb_tarball(
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800298 name = "ssh_v3",
Austin Schuh71f6fa72019-08-31 18:23:02 -0700299 files = ssh_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800300 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh71f6fa72019-08-31 18:23:02 -0700301)
302
303generate_deb_tarball(
Brian Silverman7297c0c2018-08-05 13:43:00 -0700304 name = "pandoc",
305 files = pandoc_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800306 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -0700307)
Brian Silverman4f6ba442018-08-05 14:34:58 -0700308
309generate_deb_tarball(
310 name = "libusb",
311 files = libusb_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800312 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4f6ba442018-08-05 14:34:58 -0700313)
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700314
315generate_deb_tarball(
316 name = "mingw_compiler",
317 files = mingw_compiler_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800318 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700319)
Brian Silverman6470f442018-08-05 12:08:16 -0700320
321generate_deb_tarball(
322 name = "patchelf",
323 files = patchelf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800324 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700325)
326
327generate_deb_tarball(
328 name = "matplotlib",
329 files = matplotlib_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800330 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700331)
Brian Silverman50b9ac02018-08-12 13:24:10 -0700332
333generate_deb_tarball(
334 name = "arm_frc_gnueabi_deps",
335 files = arm_frc_gnueabi_deps_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800336 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700337)
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700338
339generate_deb_tarball(
340 name = "python_gtk",
341 files = python_gtk_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800342 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700343)
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800344
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800345# Starting point for opencv package list below.
346download_packages(
347 name = "download_opencv",
348 packages = [
349 "libopencv-calib3d-dev",
350 "libopencv-calib3d3.2",
351 "libopencv-contrib-dev",
352 "libopencv-contrib3.2",
353 "libopencv-core-dev",
354 "libopencv-core3.2",
355 "libopencv-dev",
356 "libopencv-features2d-dev",
357 "libopencv-features2d3.2",
358 "libopencv-flann-dev",
359 "libopencv-flann3.2",
360 "libopencv-highgui-dev",
361 "libopencv-highgui3.2",
362 "libopencv-imgcodecs-dev",
363 "libopencv-imgcodecs3.2",
364 "libopencv-imgproc-dev",
365 "libopencv-imgproc3.2",
366 "libopencv-ml-dev",
367 "libopencv-ml3.2",
368 "libopencv-objdetect-dev",
369 "libopencv-objdetect3.2",
370 "libopencv-photo-dev",
371 "libopencv-photo3.2",
372 "libopencv-shape-dev",
373 "libopencv-shape3.2",
374 "libopencv-stitching-dev",
375 "libopencv-stitching3.2",
376 "libopencv-superres-dev",
377 "libopencv-superres3.2",
378 "libopencv-ts-dev",
379 "libopencv-video-dev",
380 "libopencv-video3.2",
381 "libopencv-videoio-dev",
382 "libopencv-videoio3.2",
383 "libopencv-videostab-dev",
384 "libopencv-videostab3.2",
385 "libopencv-viz-dev",
386 "libopencv-viz3.2",
387 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800388 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800389)
390
Brian Silvermand4260c72020-01-14 00:08:02 -0800391# This list was generated with download_packages.py on armhf and then
392# hand-tweaked to get everything it needs.
393generate_deb_tarball(
394 name = "opencv_armhf_v3",
395 files = opencv_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800396 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand4260c72020-01-14 00:08:02 -0800397)
398
Brian Silvermand97a47c2020-01-16 00:47:53 -0800399# This was hand-written based on opencv_armhf.bzl.
400generate_deb_tarball(
401 name = "opencv_amd64",
402 files = opencv_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800403 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand97a47c2020-01-16 00:47:53 -0800404)
405
Tyler Chatow60671d32020-02-26 19:49:30 -0800406generate_deb_tarball(
407 name = "gstreamer_amd64",
408 files = gstreamer_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800409 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800410)
411
412generate_deb_tarball(
413 name = "gstreamer_armhf",
414 files = gstreamer_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800415 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800416)
417
Austin Schuh023e7f52020-08-18 21:24:37 -0700418generate_deb_tarball(
419 name = "m4",
420 files = m4_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800421 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh023e7f52020-08-18 21:24:37 -0700422)
423
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700424download_packages(
425 name = "download_lzma",
426 packages = [
427 "liblzma-dev",
428 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800429 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700430)
431
432generate_deb_tarball(
433 name = "lzma_amd64",
434 files = lzma_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800435 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700436)
437
438generate_deb_tarball(
439 name = "lzma_arm64",
440 files = lzma_arm64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800441 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700442)
443
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800444exports_files([
445 "ssh_wrapper.sh",
446])