blob: 3f132440e8cb65284a2a9ea802d8e39c9b8e8adb [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(
Philipp Schrader41011a12022-03-13 12:49:32 -070010 ":postgresql_amd64.bzl",
11 postgresql_amd64_debs = "files",
12)
13load(
Brian Silverman7bda6212018-08-05 11:42:11 -070014 ":patch.bzl",
15 patch_debs = "files",
16)
Brian Silverman7297c0c2018-08-05 13:43:00 -070017load(
Austin Schuh71f6fa72019-08-31 18:23:02 -070018 ":rsync.bzl",
19 rsync_debs = "files",
20)
21load(
22 ":ssh.bzl",
23 ssh_debs = "files",
24)
25load(
Brian Silverman7297c0c2018-08-05 13:43:00 -070026 ":pandoc.bzl",
27 pandoc_debs = "files",
28)
Brian Silverman4f6ba442018-08-05 14:34:58 -070029load(
30 ":libusb.bzl",
31 libusb_debs = "files",
32)
Brian Silvermanb80dc9f2018-08-05 14:59:24 -070033load(
34 ":mingw_compiler.bzl",
35 mingw_compiler_debs = "files",
36)
Brian Silverman6470f442018-08-05 12:08:16 -070037load(
38 ":patchelf.bzl",
39 patchelf_debs = "files",
40)
41load(
42 ":matplotlib.bzl",
43 matplotlib_debs = "files",
44)
Brian Silverman50b9ac02018-08-12 13:24:10 -070045load(
46 ":arm_frc_gnueabi_deps.bzl",
47 arm_frc_gnueabi_deps_debs = "files",
48)
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -070049load(
50 ":python_gtk.bzl",
51 python_gtk_debs = "files",
52)
Brian Silvermand4260c72020-01-14 00:08:02 -080053load(
Philipp Schraderf1bbf342022-02-05 14:30:15 -080054 ":opencv_arm64.bzl",
55 opencv_arm64_debs = "files",
56)
57load(
Brian Silvermand4260c72020-01-14 00:08:02 -080058 ":opencv_armhf.bzl",
59 opencv_armhf_debs = "files",
60)
Brian Silvermand97a47c2020-01-16 00:47:53 -080061load(
62 ":opencv_amd64.bzl",
63 opencv_amd64_debs = "files",
64)
Tyler Chatow60671d32020-02-26 19:49:30 -080065load(
66 ":gstreamer_amd64.bzl",
67 gstreamer_amd64_debs = "files",
68)
69load(
70 ":gstreamer_armhf.bzl",
71 gstreamer_armhf_debs = "files",
72)
Austin Schuh023e7f52020-08-18 21:24:37 -070073load(
Brian Silvermanf59fe3f2020-09-22 21:04:09 -070074 ":lzma_amd64.bzl",
75 lzma_amd64_debs = "files",
76)
77load(
78 ":lzma_arm64.bzl",
79 lzma_arm64_debs = "files",
80)
81load(":packages.bzl", "download_packages", "generate_deb_tarball")
Philipp Schrader0e19c602018-03-07 21:07:22 -080082
Philipp Schradercc016b32021-12-30 08:59:58 -080083package(default_visibility = ["//visibility:public"])
84
Brian Silverman6470f442018-08-05 12:08:16 -070085filegroup(
86 name = "matplotlib_patches",
87 srcs = [
88 "matplotlib_init.patch",
89 ],
James Kuszmaul910f92b2020-01-01 15:30:38 -080090 visibility = ["@matplotlib_repo//:__pkg__"],
Brian Silverman6470f442018-08-05 12:08:16 -070091)
92
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -070093filegroup(
94 name = "python_shapely_patches",
95 srcs = [
96 "python_shapely_init.patch",
97 ],
98 visibility = ["@python_gtk//:__pkg__"],
99)
100
101filegroup(
102 name = "python_gi_patches",
103 srcs = [
104 "python_gi_init.patch",
105 ],
106 visibility = ["@python_gtk//:__pkg__"],
107)
108
109filegroup(
110 name = "python_geos_patches",
111 srcs = [
112 "python_geos.patch",
113 ],
114 visibility = ["@python_gtk//:__pkg__"],
115)
116
Philipp Schrader0e19c602018-03-07 21:07:22 -0800117py_binary(
118 name = "download_packages",
119 srcs = [
120 "download_packages.py",
121 ],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800122 main = "download_packages.py",
Philipp Schraderdada1072020-11-24 11:34:46 -0800123 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800124)
125
126download_packages(
Philipp Schraderd0e33a42022-01-22 21:55:15 -0800127 name = "download_apache2_packages",
128 excludes = [
129 "libaprutil1-dbd-mysql",
130 "libaprutil1-dbd-odbc",
131 "libaprutil1-dbd-pgsql",
132 "libaprutil1-dbd-freetds",
133 "libstdc++6",
134 "lsb-base",
135 "debconf",
136 "libc6-dev",
137 ],
138 force_includes = [
139 "libaprutil1",
140 ],
141 packages = [
142 "apache2",
143 ],
144)
145
146download_packages(
Philipp Schrader0e19c602018-03-07 21:07:22 -0800147 name = "download_python_deps",
148 excludes = [
149 "libblas.so.3",
150 "liblapack.so.3",
151 ],
152 packages = [
Philipp Schrader0e19c602018-03-07 21:07:22 -0800153 "python3-dev",
154 "python3-numpy",
Brian Silverman6470f442018-08-05 12:08:16 -0700155 "python3-scipy",
Philipp Schrader0e19c602018-03-07 21:07:22 -0800156 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800157 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800158)
159
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800160download_packages(
161 name = "download_clang_deps",
162 excludes = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800163 "lib32stdc++6",
164 "libstdc++6",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800165 ],
166 force_includes = [
167 "libc6",
168 "libc6-dev",
169 ],
170 packages = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800171 "clang-6.0",
172 "clang-format-6.0",
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800173 "gcc",
174 "gfortran",
175 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800176 target_compatible_with = ["@platforms//os:linux"],
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800177)
178
Brian Silverman7bda6212018-08-05 11:42:11 -0700179download_packages(
Philipp Schrader41011a12022-03-13 12:49:32 -0700180 name = "download_postgresql_deps",
181 excludes = [
182 "adduser",
183 "debconf",
184 "debconf-2.0",
185 "libsystemd0",
186 "lsb-base",
187 "libstdc++6",
188 "libc-bin",
189 "libc-l10n",
190 "netbase",
191 "ucf",
192 "locales",
193 "locales-all",
194 ],
195 packages = [
196 "postgresql",
197 ],
198 target_compatible_with = ["@platforms//os:linux"],
199)
200
201download_packages(
Brian Silverman7bda6212018-08-05 11:42:11 -0700202 name = "download_patch_deps",
203 packages = [
204 "patch",
205 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800206 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7bda6212018-08-05 11:42:11 -0700207)
208
Brian Silverman7297c0c2018-08-05 13:43:00 -0700209download_packages(
210 name = "download_pandoc_deps",
211 packages = [
212 "pandoc",
213 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800214 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -0700215)
216
Brian Silverman4f6ba442018-08-05 14:34:58 -0700217download_packages(
218 name = "download_libusb_deps",
219 packages = [
220 "libusb-0.1-4",
221 "libusb-1.0-0",
222 "libusb-1.0-0-dev",
223 "libusb-dev",
224 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800225 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4f6ba442018-08-05 14:34:58 -0700226)
227
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700228download_packages(
229 name = "download_mingw_compiler_deps",
230 packages = [
231 "g++-mingw-w64-x86-64",
232 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800233 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700234)
235
Brian Silverman6470f442018-08-05 12:08:16 -0700236download_packages(
237 name = "download_patchelf_deps",
238 packages = [
239 "patchelf",
240 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800241 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700242)
243
244download_packages(
245 name = "download_matplotlib_deps",
246 excludes = [
Brian Silverman6470f442018-08-05 12:08:16 -0700247 "python3-dev",
248 "python3-numpy",
249 "python3-scipy",
250 "x11-common",
251 "fonts-freefont",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800252 "python3",
Brian Silverman6470f442018-08-05 12:08:16 -0700253 "libcups2",
254 ],
255 packages = [
Brian Silverman6470f442018-08-05 12:08:16 -0700256 "python3-matplotlib",
James Kuszmaul910f92b2020-01-01 15:30:38 -0800257 "python3-tk",
Brian Silverman6470f442018-08-05 12:08:16 -0700258 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800259 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700260)
261
Brian Silverman50b9ac02018-08-12 13:24:10 -0700262# This list was obtained by manually looking at the output from:
263# find bazel-out/../../../external/arm_frc_linux_gnueabi_repo/ -executable -type f -exec ldd {} + | sed 's/=>.*//g' | sort -u
264download_packages(
265 name = "download_arm_frc_gnueabi_deps",
266 packages = [
267 "libexpat1",
268 "libgmp10",
269 "libisl10",
270 "liblzma5",
271 "libmpc3",
272 "libmpfr4",
273 "libncurses5",
274 "libtinfo5",
275 "zlib1g",
276 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800277 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700278)
279
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700280download_packages(
281 name = "download_python_gtk_deps",
282 excludes = [
283 "fonts-freefont",
284 "gsettings-backend",
285 "libpng-dev",
286 "libz-dev",
287 "python3-dev",
288 "python3",
James Kuszmaulf89cfab2020-01-17 19:48:25 -0800289 "libblas.so.3",
290 "liblapack.so.3",
291 "libstdc++-dev",
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700292 ],
293 packages = [
294 "libgtk-3-dev",
295 "python3-cairo",
296 "python3-gi",
297 "python3-gi-cairo",
298 "python3-shapely",
299 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800300 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700301)
302
Philipp Schrader0e19c602018-03-07 21:07:22 -0800303generate_deb_tarball(
304 name = "python",
305 files = python_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800306 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader0e19c602018-03-07 21:07:22 -0800307)
Philipp Schraderaedfc5c2018-03-10 19:32:30 -0800308
309generate_deb_tarball(
Philipp Schraderd0e33a42022-01-22 21:55:15 -0800310 name = "apache2",
311 files = apache2_debs,
312 target_compatible_with = ["@platforms//os:linux"],
313)
314
315generate_deb_tarball(
Philipp Schrader41011a12022-03-13 12:49:32 -0700316 name = "postgresql_amd64",
317 files = postgresql_amd64_debs,
318 target_compatible_with = ["@platforms//os:linux"],
319)
320
321generate_deb_tarball(
Brian Silverman7bda6212018-08-05 11:42:11 -0700322 name = "patch",
323 files = patch_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800324 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7bda6212018-08-05 11:42:11 -0700325)
Brian Silverman7297c0c2018-08-05 13:43:00 -0700326
327generate_deb_tarball(
Austin Schuh71f6fa72019-08-31 18:23:02 -0700328 name = "rsync",
329 files = rsync_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800330 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh71f6fa72019-08-31 18:23:02 -0700331)
332
333generate_deb_tarball(
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800334 name = "ssh_v3",
Austin Schuh71f6fa72019-08-31 18:23:02 -0700335 files = ssh_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800336 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh71f6fa72019-08-31 18:23:02 -0700337)
338
339generate_deb_tarball(
Brian Silverman7297c0c2018-08-05 13:43:00 -0700340 name = "pandoc",
341 files = pandoc_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800342 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7297c0c2018-08-05 13:43:00 -0700343)
Brian Silverman4f6ba442018-08-05 14:34:58 -0700344
345generate_deb_tarball(
346 name = "libusb",
347 files = libusb_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800348 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman4f6ba442018-08-05 14:34:58 -0700349)
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700350
351generate_deb_tarball(
352 name = "mingw_compiler",
353 files = mingw_compiler_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800354 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb80dc9f2018-08-05 14:59:24 -0700355)
Brian Silverman6470f442018-08-05 12:08:16 -0700356
357generate_deb_tarball(
358 name = "patchelf",
359 files = patchelf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800360 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700361)
362
363generate_deb_tarball(
364 name = "matplotlib",
365 files = matplotlib_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800366 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700367)
Brian Silverman50b9ac02018-08-12 13:24:10 -0700368
369generate_deb_tarball(
370 name = "arm_frc_gnueabi_deps",
371 files = arm_frc_gnueabi_deps_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800372 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700373)
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700374
375generate_deb_tarball(
376 name = "python_gtk",
377 files = python_gtk_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800378 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -0700379)
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800380
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800381download_packages(
382 name = "download_opencv",
383 packages = [
384 "libopencv-calib3d-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800385 "libopencv-calib3d4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800386 "libopencv-contrib-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800387 "libopencv-contrib4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800388 "libopencv-core-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800389 "libopencv-core4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800390 "libopencv-dev",
391 "libopencv-features2d-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800392 "libopencv-features2d4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800393 "libopencv-flann-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800394 "libopencv-flann4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800395 "libopencv-highgui-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800396 "libopencv-highgui4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800397 "libopencv-imgcodecs-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800398 "libopencv-imgcodecs4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800399 "libopencv-imgproc-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800400 "libopencv-imgproc4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800401 "libopencv-ml-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800402 "libopencv-ml4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800403 "libopencv-objdetect-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800404 "libopencv-objdetect4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800405 "libopencv-photo-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800406 "libopencv-photo4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800407 "libopencv-shape-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800408 "libopencv-shape4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800409 "libopencv-stitching-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800410 "libopencv-stitching4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800411 "libopencv-superres-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800412 "libopencv-superres4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800413 "libopencv-video-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800414 "libopencv-video4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800415 "libopencv-videoio-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800416 "libopencv-videoio4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800417 "libopencv-videostab-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800418 "libopencv-videostab4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800419 "libopencv-viz-dev",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800420 "libopencv-viz4.5",
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800421 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800422 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh5e7bbd72020-11-04 21:43:21 -0800423)
424
Brian Silvermand4260c72020-01-14 00:08:02 -0800425generate_deb_tarball(
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800426 name = "opencv_arm64",
427 files = opencv_arm64_debs,
428 target_compatible_with = ["@platforms//os:linux"],
429)
430
431generate_deb_tarball(
Brian Silverman4c7235a2021-11-17 19:04:37 -0800432 name = "opencv_armhf_v4",
Brian Silvermand4260c72020-01-14 00:08:02 -0800433 files = opencv_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800434 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand4260c72020-01-14 00:08:02 -0800435)
436
Brian Silvermand97a47c2020-01-16 00:47:53 -0800437generate_deb_tarball(
438 name = "opencv_amd64",
439 files = opencv_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800440 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermand97a47c2020-01-16 00:47:53 -0800441)
442
Tyler Chatow60671d32020-02-26 19:49:30 -0800443generate_deb_tarball(
444 name = "gstreamer_amd64",
445 files = gstreamer_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800446 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800447)
448
449generate_deb_tarball(
450 name = "gstreamer_armhf",
451 files = gstreamer_armhf_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800452 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow60671d32020-02-26 19:49:30 -0800453)
454
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700455download_packages(
456 name = "download_lzma",
457 packages = [
458 "liblzma-dev",
459 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800460 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700461)
462
463generate_deb_tarball(
464 name = "lzma_amd64",
465 files = lzma_amd64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800466 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700467)
468
469generate_deb_tarball(
470 name = "lzma_arm64",
471 files = lzma_arm64_debs,
Philipp Schraderdada1072020-11-24 11:34:46 -0800472 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanf59fe3f2020-09-22 21:04:09 -0700473)
474
Brian Silvermanbd7860e2020-01-05 17:52:40 -0800475exports_files([
476 "ssh_wrapper.sh",
477])