blob: 76bcf28e1336847a71c3e7e31e728217b7dae6d4 [file] [log] [blame]
Philipp Schrader0e19c602018-03-07 21:07:22 -08001load(
2 "//debian:python.bzl",
3 python_debs = "files",
4)
Philipp Schraderaedfc5c2018-03-10 19:32:30 -08005load(
Philipp Schraderd0e33a42022-01-22 21:55:15 -08006 ":apache2.bzl",
7 apache2_debs = "files",
8)
9load(
Brian Silverman7bda6212018-08-05 11:42:11 -070010 ":patch.bzl",
11 patch_debs = "files",
12)
Brian Silverman7297c0c2018-08-05 13:43:00 -070013load(
Austin Schuh71f6fa72019-08-31 18:23:02 -070014 ":rsync.bzl",
15 rsync_debs = "files",
16)
17load(
18 ":ssh.bzl",
19 ssh_debs = "files",
20)
21load(
Brian Silverman7297c0c2018-08-05 13:43:00 -070022 ":pandoc.bzl",
23 pandoc_debs = "files",
24)
Brian Silverman4f6ba442018-08-05 14:34:58 -070025load(
26 ":libusb.bzl",
27 libusb_debs = "files",
28)
Brian Silvermanb80dc9f2018-08-05 14:59:24 -070029load(
30 ":mingw_compiler.bzl",
31 mingw_compiler_debs = "files",
32)
Brian Silverman6470f442018-08-05 12:08:16 -070033load(
34 ":patchelf.bzl",
35 patchelf_debs = "files",
36)
37load(
38 ":matplotlib.bzl",
39 matplotlib_debs = "files",
40)
Brian Silverman50b9ac02018-08-12 13:24:10 -070041load(
42 ":arm_frc_gnueabi_deps.bzl",
43 arm_frc_gnueabi_deps_debs = "files",
44)
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -070045load(
46 ":python_gtk.bzl",
47 python_gtk_debs = "files",
48)
Brian Silvermand4260c72020-01-14 00:08:02 -080049load(
50 ":opencv_armhf.bzl",
51 opencv_armhf_debs = "files",
52)
Brian Silvermand97a47c2020-01-16 00:47:53 -080053load(
54 ":opencv_amd64.bzl",
55 opencv_amd64_debs = "files",
56)
Tyler Chatow60671d32020-02-26 19:49:30 -080057load(
58 ":gstreamer_amd64.bzl",
59 gstreamer_amd64_debs = "files",
60)
61load(
62 ":gstreamer_armhf.bzl",
63 gstreamer_armhf_debs = "files",
64)
Austin Schuh023e7f52020-08-18 21:24:37 -070065load(
Brian Silvermanf59fe3f2020-09-22 21:04:09 -070066 ":lzma_amd64.bzl",
67 lzma_amd64_debs = "files",
68)
69load(
70 ":lzma_arm64.bzl",
71 lzma_arm64_debs = "files",
72)
73load(":packages.bzl", "download_packages", "generate_deb_tarball")
Philipp Schrader0e19c602018-03-07 21:07:22 -080074
Philipp Schradercc016b32021-12-30 08:59:58 -080075package(default_visibility = ["//visibility:public"])
76
Brian Silverman6470f442018-08-05 12:08:16 -070077filegroup(
78 name = "matplotlib_patches",
79 srcs = [
80 "matplotlib_init.patch",
81 ],
James Kuszmaul910f92b2020-01-01 15:30:38 -080082 visibility = ["@matplotlib_repo//:__pkg__"],
Brian Silverman6470f442018-08-05 12:08:16 -070083)
84
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -070085filegroup(
86 name = "python_shapely_patches",
87 srcs = [
88 "python_shapely_init.patch",
89 ],
90 visibility = ["@python_gtk//:__pkg__"],
91)
92
93filegroup(
94 name = "python_gi_patches",
95 srcs = [
96 "python_gi_init.patch",
97 ],
98 visibility = ["@python_gtk//:__pkg__"],
99)
100
101filegroup(
102 name = "python_geos_patches",
103 srcs = [
104 "python_geos.patch",
105 ],
106 visibility = ["@python_gtk//:__pkg__"],
107)
108
Philipp Schrader0e19c602018-03-07 21:07:22 -0800109py_binary(
110 name = "download_packages",
111 srcs = [
112 "download_packages.py",
113 ],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800114 main = "download_packages.py",
Philipp Schraderdada1072020-11-24 11:34:46 -0800115 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800116)
117
118download_packages(
Philipp Schraderd0e33a42022-01-22 21:55:15 -0800119 name = "download_apache2_packages",
120 excludes = [
121 "libaprutil1-dbd-mysql",
122 "libaprutil1-dbd-odbc",
123 "libaprutil1-dbd-pgsql",
124 "libaprutil1-dbd-freetds",
125 "libstdc++6",
126 "lsb-base",
127 "debconf",
128 "libc6-dev",
129 ],
130 force_includes = [
131 "libaprutil1",
132 ],
133 packages = [
134 "apache2",
135 ],
136)
137
138download_packages(
Philipp Schrader0e19c602018-03-07 21:07:22 -0800139 name = "download_python_deps",
140 excludes = [
141 "libblas.so.3",
142 "liblapack.so.3",
143 ],
144 packages = [
Philipp Schrader0e19c602018-03-07 21:07:22 -0800145 "python3-dev",
146 "python3-numpy",
Brian Silverman6470f442018-08-05 12:08:16 -0700147 "python3-scipy",
Philipp Schrader0e19c602018-03-07 21:07:22 -0800148 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800149 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800150)
151
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800152download_packages(
153 name = "download_clang_deps",
154 excludes = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800155 "lib32stdc++6",
156 "libstdc++6",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800157 ],
158 force_includes = [
159 "libc6",
160 "libc6-dev",
161 ],
162 packages = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800163 "clang-6.0",
164 "clang-format-6.0",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800165 "gcc",
166 "gfortran",
167 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800168 target_compatible_with = ["@platforms//os:linux"],
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800169)
170
Brian Silverman7bda6212018-08-05 11:42:11 -0700171download_packages(
172 name = "download_patch_deps",
173 packages = [
174 "patch",
175 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800176 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7bda6212018-08-05 11:42:11 -0700177)
178
Brian Silverman7297c0c2018-08-05 13:43:00 -0700179download_packages(
180 name = "download_pandoc_deps",
181 packages = [
182 "pandoc",
183 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800184 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -0700185)
186
Brian Silverman4f6ba442018-08-05 14:34:58 -0700187download_packages(
188 name = "download_libusb_deps",
189 packages = [
190 "libusb-0.1-4",
191 "libusb-1.0-0",
192 "libusb-1.0-0-dev",
193 "libusb-dev",
194 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800195 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4f6ba442018-08-05 14:34:58 -0700196)
197
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700198download_packages(
199 name = "download_mingw_compiler_deps",
200 packages = [
201 "g++-mingw-w64-x86-64",
202 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800203 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700204)
205
Brian Silverman6470f442018-08-05 12:08:16 -0700206download_packages(
207 name = "download_patchelf_deps",
208 packages = [
209 "patchelf",
210 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800211 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700212)
213
214download_packages(
215 name = "download_matplotlib_deps",
216 excludes = [
Brian Silverman6470f442018-08-05 12:08:16 -0700217 "python3-dev",
218 "python3-numpy",
219 "python3-scipy",
220 "x11-common",
221 "fonts-freefont",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800222 "python3",
Brian Silverman6470f442018-08-05 12:08:16 -0700223 "libcups2",
224 ],
225 packages = [
Brian Silverman6470f442018-08-05 12:08:16 -0700226 "python3-matplotlib",
James Kuszmaul910f92b2020-01-01 15:30:38 -0800227 "python3-tk",
Brian Silverman6470f442018-08-05 12:08:16 -0700228 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800229 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700230)
231
Brian Silverman50b9ac02018-08-12 13:24:10 -0700232# This list was obtained by manually looking at the output from:
233# find bazel-out/../../../external/arm_frc_linux_gnueabi_repo/ -executable -type f -exec ldd {} + | sed 's/=>.*//g' | sort -u
234download_packages(
235 name = "download_arm_frc_gnueabi_deps",
236 packages = [
237 "libexpat1",
238 "libgmp10",
239 "libisl10",
240 "liblzma5",
241 "libmpc3",
242 "libmpfr4",
243 "libncurses5",
244 "libtinfo5",
245 "zlib1g",
246 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800247 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700248)
249
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700250download_packages(
251 name = "download_python_gtk_deps",
252 excludes = [
253 "fonts-freefont",
254 "gsettings-backend",
255 "libpng-dev",
256 "libz-dev",
257 "python3-dev",
258 "python3",
James Kuszmaulf89cfab2020-01-17 19:48:25 -0800259 "libblas.so.3",
260 "liblapack.so.3",
261 "libstdc++-dev",
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700262 ],
263 packages = [
264 "libgtk-3-dev",
265 "python3-cairo",
266 "python3-gi",
267 "python3-gi-cairo",
268 "python3-shapely",
269 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800270 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -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(
Philipp Schraderd0e33a42022-01-22 21:55:15 -0800280 name = "apache2",
281 files = apache2_debs,
282 target_compatible_with = ["@platforms//os:linux"],
283)
284
285generate_deb_tarball(
Brian Silverman7bda6212018-08-05 11:42:11 -0700286 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 -0800345download_packages(
346 name = "download_opencv",
347 packages = [
348 "libopencv-calib3d-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800349 "libopencv-calib3d4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800350 "libopencv-contrib-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800351 "libopencv-contrib4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800352 "libopencv-core-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800353 "libopencv-core4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800354 "libopencv-dev",
355 "libopencv-features2d-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800356 "libopencv-features2d4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800357 "libopencv-flann-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800358 "libopencv-flann4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800359 "libopencv-highgui-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800360 "libopencv-highgui4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800361 "libopencv-imgcodecs-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800362 "libopencv-imgcodecs4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800363 "libopencv-imgproc-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800364 "libopencv-imgproc4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800365 "libopencv-ml-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800366 "libopencv-ml4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800367 "libopencv-objdetect-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800368 "libopencv-objdetect4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800369 "libopencv-photo-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800370 "libopencv-photo4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800371 "libopencv-shape-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800372 "libopencv-shape4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800373 "libopencv-stitching-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800374 "libopencv-stitching4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800375 "libopencv-superres-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800376 "libopencv-superres4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800377 "libopencv-video-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800378 "libopencv-video4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800379 "libopencv-videoio-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800380 "libopencv-videoio4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800381 "libopencv-videostab-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800382 "libopencv-videostab4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800383 "libopencv-viz-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800384 "libopencv-viz4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800385 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800386 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800387)
388
Brian Silvermand4260c72020-01-14 00:08:02 -0800389generate_deb_tarball(
Brian Silverman4c7235a2021-11-17 19:04:37 -0800390 name = "opencv_armhf_v4",
Brian Silvermand4260c72020-01-14 00:08:02 -0800391 files = opencv_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800392 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand4260c72020-01-14 00:08:02 -0800393)
394
Brian Silvermand97a47c2020-01-16 00:47:53 -0800395generate_deb_tarball(
396 name = "opencv_amd64",
397 files = opencv_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800398 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand97a47c2020-01-16 00:47:53 -0800399)
400
Tyler Chatow60671d32020-02-26 19:49:30 -0800401generate_deb_tarball(
402 name = "gstreamer_amd64",
403 files = gstreamer_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800404 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800405)
406
407generate_deb_tarball(
408 name = "gstreamer_armhf",
409 files = gstreamer_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800410 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800411)
412
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700413download_packages(
414 name = "download_lzma",
415 packages = [
416 "liblzma-dev",
417 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800418 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700419)
420
421generate_deb_tarball(
422 name = "lzma_amd64",
423 files = lzma_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800424 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700425)
426
427generate_deb_tarball(
428 name = "lzma_arm64",
429 files = lzma_arm64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800430 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700431)
432
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800433exports_files([
434 "ssh_wrapper.sh",
435])