blob: 2aeabf2c03c12b0e7a18269bc3317c8a6478f331 [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(
Philipp Schraderf1bbf342022-02-05 14:30:15 -080050 ":opencv_arm64.bzl",
51 opencv_arm64_debs = "files",
52)
53load(
Brian Silvermand4260c72020-01-14 00:08:02 -080054 ":opencv_armhf.bzl",
55 opencv_armhf_debs = "files",
56)
Brian Silvermand97a47c2020-01-16 00:47:53 -080057load(
58 ":opencv_amd64.bzl",
59 opencv_amd64_debs = "files",
60)
Tyler Chatow60671d32020-02-26 19:49:30 -080061load(
62 ":gstreamer_amd64.bzl",
63 gstreamer_amd64_debs = "files",
64)
65load(
66 ":gstreamer_armhf.bzl",
67 gstreamer_armhf_debs = "files",
68)
Austin Schuh023e7f52020-08-18 21:24:37 -070069load(
Brian Silvermanf59fe3f2020-09-22 21:04:09 -070070 ":lzma_amd64.bzl",
71 lzma_amd64_debs = "files",
72)
73load(
74 ":lzma_arm64.bzl",
75 lzma_arm64_debs = "files",
76)
77load(":packages.bzl", "download_packages", "generate_deb_tarball")
Philipp Schrader0e19c602018-03-07 21:07:22 -080078
Philipp Schradercc016b32021-12-30 08:59:58 -080079package(default_visibility = ["//visibility:public"])
80
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(
Philipp Schraderd0e33a42022-01-22 21:55:15 -0800123 name = "download_apache2_packages",
124 excludes = [
125 "libaprutil1-dbd-mysql",
126 "libaprutil1-dbd-odbc",
127 "libaprutil1-dbd-pgsql",
128 "libaprutil1-dbd-freetds",
129 "libstdc++6",
130 "lsb-base",
131 "debconf",
132 "libc6-dev",
133 ],
134 force_includes = [
135 "libaprutil1",
136 ],
137 packages = [
138 "apache2",
139 ],
140)
141
142download_packages(
Philipp Schrader0e19c602018-03-07 21:07:22 -0800143 name = "download_python_deps",
144 excludes = [
145 "libblas.so.3",
146 "liblapack.so.3",
147 ],
148 packages = [
Philipp Schrader0e19c602018-03-07 21:07:22 -0800149 "python3-dev",
150 "python3-numpy",
Brian Silverman6470f442018-08-05 12:08:16 -0700151 "python3-scipy",
Philipp Schrader0e19c602018-03-07 21:07:22 -0800152 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800153 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800154)
155
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800156download_packages(
157 name = "download_clang_deps",
158 excludes = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800159 "lib32stdc++6",
160 "libstdc++6",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800161 ],
162 force_includes = [
163 "libc6",
164 "libc6-dev",
165 ],
166 packages = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800167 "clang-6.0",
168 "clang-format-6.0",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800169 "gcc",
170 "gfortran",
171 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800172 target_compatible_with = ["@platforms//os:linux"],
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800173)
174
Brian Silverman7bda6212018-08-05 11:42:11 -0700175download_packages(
176 name = "download_patch_deps",
177 packages = [
178 "patch",
179 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800180 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7bda6212018-08-05 11:42:11 -0700181)
182
Brian Silverman7297c0c2018-08-05 13:43:00 -0700183download_packages(
184 name = "download_pandoc_deps",
185 packages = [
186 "pandoc",
187 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800188 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -0700189)
190
Brian Silverman4f6ba442018-08-05 14:34:58 -0700191download_packages(
192 name = "download_libusb_deps",
193 packages = [
194 "libusb-0.1-4",
195 "libusb-1.0-0",
196 "libusb-1.0-0-dev",
197 "libusb-dev",
198 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800199 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4f6ba442018-08-05 14:34:58 -0700200)
201
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700202download_packages(
203 name = "download_mingw_compiler_deps",
204 packages = [
205 "g++-mingw-w64-x86-64",
206 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800207 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700208)
209
Brian Silverman6470f442018-08-05 12:08:16 -0700210download_packages(
211 name = "download_patchelf_deps",
212 packages = [
213 "patchelf",
214 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800215 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700216)
217
218download_packages(
219 name = "download_matplotlib_deps",
220 excludes = [
Brian Silverman6470f442018-08-05 12:08:16 -0700221 "python3-dev",
222 "python3-numpy",
223 "python3-scipy",
224 "x11-common",
225 "fonts-freefont",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800226 "python3",
Brian Silverman6470f442018-08-05 12:08:16 -0700227 "libcups2",
228 ],
229 packages = [
Brian Silverman6470f442018-08-05 12:08:16 -0700230 "python3-matplotlib",
James Kuszmaul910f92b2020-01-01 15:30:38 -0800231 "python3-tk",
Brian Silverman6470f442018-08-05 12:08:16 -0700232 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800233 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700234)
235
Brian Silverman50b9ac02018-08-12 13:24:10 -0700236# This list was obtained by manually looking at the output from:
237# find bazel-out/../../../external/arm_frc_linux_gnueabi_repo/ -executable -type f -exec ldd {} + | sed 's/=>.*//g' | sort -u
238download_packages(
239 name = "download_arm_frc_gnueabi_deps",
240 packages = [
241 "libexpat1",
242 "libgmp10",
243 "libisl10",
244 "liblzma5",
245 "libmpc3",
246 "libmpfr4",
247 "libncurses5",
248 "libtinfo5",
249 "zlib1g",
250 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800251 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700252)
253
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700254download_packages(
255 name = "download_python_gtk_deps",
256 excludes = [
257 "fonts-freefont",
258 "gsettings-backend",
259 "libpng-dev",
260 "libz-dev",
261 "python3-dev",
262 "python3",
James Kuszmaulf89cfab2020-01-17 19:48:25 -0800263 "libblas.so.3",
264 "liblapack.so.3",
265 "libstdc++-dev",
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700266 ],
267 packages = [
268 "libgtk-3-dev",
269 "python3-cairo",
270 "python3-gi",
271 "python3-gi-cairo",
272 "python3-shapely",
273 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800274 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700275)
276
Philipp Schrader0e19c602018-03-07 21:07:22 -0800277generate_deb_tarball(
278 name = "python",
279 files = python_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800280 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800281)
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800282
283generate_deb_tarball(
Philipp Schraderd0e33a42022-01-22 21:55:15 -0800284 name = "apache2",
285 files = apache2_debs,
286 target_compatible_with = ["@platforms//os:linux"],
287)
288
289generate_deb_tarball(
Brian Silverman7bda6212018-08-05 11:42:11 -0700290 name = "patch",
291 files = patch_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800292 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7bda6212018-08-05 11:42:11 -0700293)
Brian Silverman7297c0c2018-08-05 13:43:00 -0700294
295generate_deb_tarball(
Austin Schuh71f6fa72019-08-31 18:23:02 -0700296 name = "rsync",
297 files = rsync_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800298 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh71f6fa72019-08-31 18:23:02 -0700299)
300
301generate_deb_tarball(
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800302 name = "ssh_v3",
Austin Schuh71f6fa72019-08-31 18:23:02 -0700303 files = ssh_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800304 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh71f6fa72019-08-31 18:23:02 -0700305)
306
307generate_deb_tarball(
Brian Silverman7297c0c2018-08-05 13:43:00 -0700308 name = "pandoc",
309 files = pandoc_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800310 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -0700311)
Brian Silverman4f6ba442018-08-05 14:34:58 -0700312
313generate_deb_tarball(
314 name = "libusb",
315 files = libusb_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800316 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4f6ba442018-08-05 14:34:58 -0700317)
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700318
319generate_deb_tarball(
320 name = "mingw_compiler",
321 files = mingw_compiler_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800322 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700323)
Brian Silverman6470f442018-08-05 12:08:16 -0700324
325generate_deb_tarball(
326 name = "patchelf",
327 files = patchelf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800328 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700329)
330
331generate_deb_tarball(
332 name = "matplotlib",
333 files = matplotlib_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800334 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700335)
Brian Silverman50b9ac02018-08-12 13:24:10 -0700336
337generate_deb_tarball(
338 name = "arm_frc_gnueabi_deps",
339 files = arm_frc_gnueabi_deps_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800340 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700341)
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700342
343generate_deb_tarball(
344 name = "python_gtk",
345 files = python_gtk_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800346 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700347)
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800348
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800349download_packages(
350 name = "download_opencv",
351 packages = [
352 "libopencv-calib3d-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800353 "libopencv-calib3d4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800354 "libopencv-contrib-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800355 "libopencv-contrib4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800356 "libopencv-core-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800357 "libopencv-core4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800358 "libopencv-dev",
359 "libopencv-features2d-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800360 "libopencv-features2d4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800361 "libopencv-flann-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800362 "libopencv-flann4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800363 "libopencv-highgui-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800364 "libopencv-highgui4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800365 "libopencv-imgcodecs-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800366 "libopencv-imgcodecs4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800367 "libopencv-imgproc-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800368 "libopencv-imgproc4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800369 "libopencv-ml-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800370 "libopencv-ml4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800371 "libopencv-objdetect-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800372 "libopencv-objdetect4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800373 "libopencv-photo-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800374 "libopencv-photo4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800375 "libopencv-shape-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800376 "libopencv-shape4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800377 "libopencv-stitching-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800378 "libopencv-stitching4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800379 "libopencv-superres-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800380 "libopencv-superres4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800381 "libopencv-video-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800382 "libopencv-video4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800383 "libopencv-videoio-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800384 "libopencv-videoio4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800385 "libopencv-videostab-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800386 "libopencv-videostab4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800387 "libopencv-viz-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800388 "libopencv-viz4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800389 ],
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 -0800393generate_deb_tarball(
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800394 name = "opencv_arm64",
395 files = opencv_arm64_debs,
396 target_compatible_with = ["@platforms//os:linux"],
397)
398
399generate_deb_tarball(
Brian Silverman4c7235a2021-11-17 19:04:37 -0800400 name = "opencv_armhf_v4",
Brian Silvermand4260c72020-01-14 00:08:02 -0800401 files = opencv_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800402 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand4260c72020-01-14 00:08:02 -0800403)
404
Brian Silvermand97a47c2020-01-16 00:47:53 -0800405generate_deb_tarball(
406 name = "opencv_amd64",
407 files = opencv_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800408 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand97a47c2020-01-16 00:47:53 -0800409)
410
Tyler Chatow60671d32020-02-26 19:49:30 -0800411generate_deb_tarball(
412 name = "gstreamer_amd64",
413 files = gstreamer_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800414 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800415)
416
417generate_deb_tarball(
418 name = "gstreamer_armhf",
419 files = gstreamer_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800420 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800421)
422
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700423download_packages(
424 name = "download_lzma",
425 packages = [
426 "liblzma-dev",
427 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800428 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700429)
430
431generate_deb_tarball(
432 name = "lzma_amd64",
433 files = lzma_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800434 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700435)
436
437generate_deb_tarball(
438 name = "lzma_arm64",
439 files = lzma_arm64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800440 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700441)
442
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800443exports_files([
444 "ssh_wrapper.sh",
445])