Import GTK in preparation for rules_python
We currently import GTK libraries as part of the "python_gtk" repo.
That pulls in GTK, but also Python and a bunch of pip packages.
This patch makes it so that GTK is pulled in via a dedicated repo.
That allows us to have dedicated repos for pip packages via
rules_python.
Future patches will make use of the new GTK import.
I had to modify `download_packages.py` in order to ensure that `libc6`
really got excluded from the final tarball. On James' personal
machines, he observed stack smashing crashes when `libc` is in the
tarball. The `force_includes` usage pulled in `libc6` even though we
don't want it to.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Ia3ecf51e4bd4c7aa0e72646e4c2af738f6086c01
diff --git a/debian/BUILD b/debian/BUILD
index de5144d..f14db44 100644
--- a/debian/BUILD
+++ b/debian/BUILD
@@ -51,6 +51,10 @@
python_gtk_debs = "files",
)
load(
+ ":gtk_runtime.bzl",
+ gtk_runtime_debs = "files",
+)
+load(
":opencv_arm64.bzl",
opencv_arm64_debs = "files",
)
@@ -156,6 +160,33 @@
)
download_packages(
+ name = "download_gtk_runtime",
+ excludes = [
+ "libstdc++6",
+ "lsb-base",
+ "libglib2.0-dev-bin",
+ "fonts-freefont",
+ "gsettings-backend",
+ "libpng-dev",
+ "libz-dev",
+ "libstdc++-dev",
+ "libc6-dev",
+ ],
+ # Since "libglib2.0-0" pulls in glibc, we need to forcibly remove it again.
+ force_excludes = [
+ "libc6",
+ "libgcc-s1",
+ ],
+ force_includes = [
+ "libglib2.0-0",
+ ],
+ packages = [
+ "gir1.2-gtk-3.0",
+ "libgtk-3-dev",
+ ],
+)
+
+download_packages(
name = "download_python_deps",
excludes = [
"libblas.so.3",
@@ -390,6 +421,12 @@
target_compatible_with = ["@platforms//os:linux"],
)
+generate_deb_tarball(
+ name = "gtk_runtime",
+ files = gtk_runtime_debs,
+ target_compatible_with = ["@platforms//os:linux"],
+)
+
download_packages(
name = "download_opencv",
packages = [