From e39eae3a66c39694450418dd9becacbf74c071fc Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 2 Nov 2023 12:17:47 -0700 Subject: [PATCH] Add support for debian bookworm (#66) * Add support for debian bookworm Signed-off-by: Michael Carroll * Lint Signed-off-by: Michael Carroll --------- Signed-off-by: Michael Carroll --- workspace/X11/repository.bzl | 2 +- workspace/assimp/repository.bzl | 2 +- workspace/buildifier/repository.bzl | 2 +- workspace/curl/repository.bzl | 2 +- workspace/eigen3/repository.bzl | 2 +- workspace/fcl/repository.bzl | 2 +- workspace/ffmpeg/repository.bzl | 2 +- workspace/fmt/repository.bzl | 2 +- workspace/freeimage/repository.bzl | 2 +- workspace/freetype2/repository.bzl | 2 +- workspace/gdal/repository.bzl | 2 +- workspace/gl/repository.bzl | 2 +- workspace/glib/repository.bzl | 2 +- workspace/glslang/repository.bzl | 2 +- workspace/glut/repository.bzl | 2 +- workspace/gts/repository.bzl | 2 +- workspace/jsoncpp/repository.bzl | 2 +- workspace/nlopt/repository.bzl | 2 +- workspace/ode/repository.bzl | 2 +- workspace/os.bzl | 24 +++++++++++++++++++++++ workspace/osg/repository.bzl | 2 +- workspace/pycodestyle/package.BUILD.bazel | 7 +++++-- workspace/rules_qt/repository.bzl | 4 ++-- workspace/sdl2/repository.bzl | 2 +- workspace/spdlog/repository.bzl | 2 +- workspace/sqlite3/repository.bzl | 2 +- workspace/tinyxml2/repository.bzl | 2 +- workspace/uuid/repository.bzl | 2 +- workspace/vulkan/repository.bzl | 2 +- workspace/xcb/repository.bzl | 2 +- workspace/yaml/repository.bzl | 2 +- workspace/zip/repository.bzl | 2 +- workspace/zmq/repository.bzl | 2 +- 33 files changed, 61 insertions(+), 34 deletions(-) diff --git a/workspace/X11/repository.bzl b/workspace/X11/repository.bzl index ebb76ee..ef5e3b4 100644 --- a/workspace/X11/repository.bzl +++ b/workspace/X11/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/X11", "include/X11") diff --git a/workspace/assimp/repository.bzl b/workspace/assimp/repository.bzl index 8a5895c..5851c46 100644 --- a/workspace/assimp/repository.bzl +++ b/workspace/assimp/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/assimp/", "include/assimp/") diff --git a/workspace/buildifier/repository.bzl b/workspace/buildifier/repository.bzl index 5e512e4..477f5c6 100644 --- a/workspace/buildifier/repository.bzl +++ b/workspace/buildifier/repository.bzl @@ -45,7 +45,7 @@ def _impl(repository_ctx): if os_result.is_macos: urls = darwin_urls sha256 = darwin_sha256 - elif os_result.is_ubuntu or os_result.is_manylinux: + elif os_result.is_ubuntu or os_result.is_manylinux or os_result.is_debian: urls = linux_urls sha256 = linux_sha256 else: diff --git a/workspace/curl/repository.bzl b/workspace/curl/repository.bzl index 62b3031..81a09c9 100644 --- a/workspace/curl/repository.bzl +++ b/workspace/curl/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink( "/usr/include/x86_64-linux-gnu/curl", diff --git a/workspace/eigen3/repository.bzl b/workspace/eigen3/repository.bzl index cf97bfa..f25d263 100644 --- a/workspace/eigen3/repository.bzl +++ b/workspace/eigen3/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: repository_ctx.symlink("/usr/include/eigen3/Eigen", "include/eigen3/Eigen") # noqa repository_ctx.symlink("/usr/include/eigen3/unsupported", "include/eigen3/unsupported") # noqa diff --git a/workspace/fcl/repository.bzl b/workspace/fcl/repository.bzl index e48ffd7..9f99e17 100644 --- a/workspace/fcl/repository.bzl +++ b/workspace/fcl/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib" repository_ctx.symlink("/usr/include/fcl", "include/fcl") diff --git a/workspace/ffmpeg/repository.bzl b/workspace/ffmpeg/repository.bzl index 7741e7f..3dab0b3 100644 --- a/workspace/ffmpeg/repository.bzl +++ b/workspace/ffmpeg/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/x86_64-linux-gnu/libavcodec", "include/libavcodec") # noqa repository_ctx.symlink("/usr/include/x86_64-linux-gnu/libavdevice", "include/libavdevice") # noqa diff --git a/workspace/fmt/repository.bzl b/workspace/fmt/repository.bzl index a0576a1..b51f363 100644 --- a/workspace/fmt/repository.bzl +++ b/workspace/fmt/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu/" repository_ctx.symlink("/usr/include/fmt", "include/fmt") diff --git a/workspace/freeimage/repository.bzl b/workspace/freeimage/repository.bzl index b941302..5646bfa 100644 --- a/workspace/freeimage/repository.bzl +++ b/workspace/freeimage/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/FreeImage.h", "include/FreeImage.h") # noqa diff --git a/workspace/freetype2/repository.bzl b/workspace/freetype2/repository.bzl index f21af17..5c57d8d 100644 --- a/workspace/freetype2/repository.bzl +++ b/workspace/freetype2/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/freetype2", "include/freetype2") # noqa diff --git a/workspace/gdal/repository.bzl b/workspace/gdal/repository.bzl index be4d0dc..e7d1a6f 100644 --- a/workspace/gdal/repository.bzl +++ b/workspace/gdal/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib" repository_ctx.symlink("/usr/include/gdal", "include/gdal") diff --git a/workspace/gl/repository.bzl b/workspace/gl/repository.bzl index 7fc386a..2742379 100644 --- a/workspace/gl/repository.bzl +++ b/workspace/gl/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/EGL/", "include/EGL/") repository_ctx.symlink("/usr/include/GL/", "include/GL/") diff --git a/workspace/glib/repository.bzl b/workspace/glib/repository.bzl index c06995a..a61b17d 100644 --- a/workspace/glib/repository.bzl +++ b/workspace/glib/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/glib-2.0/", "include/glib-2.0/") repository_ctx.symlink(libdir + "/glib-2.0/include/glibconfig.h", "include/glibconfig.h") diff --git a/workspace/glslang/repository.bzl b/workspace/glslang/repository.bzl index 034f8ba..7e0584c 100644 --- a/workspace/glslang/repository.bzl +++ b/workspace/glslang/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/glslang", "include/glslang") diff --git a/workspace/glut/repository.bzl b/workspace/glut/repository.bzl index f535fd9..8d414e7 100644 --- a/workspace/glut/repository.bzl +++ b/workspace/glut/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux/gnu" repository_ctx.symlink("/usr/include/GL/glut.h", "include/GL/glut.h") repository_ctx.symlink("/usr/include/GL/freeglut_std.h", "include/GL/freeglut_std.h") # noqa diff --git a/workspace/gts/repository.bzl b/workspace/gts/repository.bzl index 4fda171..cf81a91 100644 --- a/workspace/gts/repository.bzl +++ b/workspace/gts/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/gts.h", "include/gts.h") repository_ctx.symlink("/usr/include/gtsconfig.h", "include/gtsconfig.h") # noqa diff --git a/workspace/jsoncpp/repository.bzl b/workspace/jsoncpp/repository.bzl index b9eac0f..9fe4017 100644 --- a/workspace/jsoncpp/repository.bzl +++ b/workspace/jsoncpp/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/jsoncpp", "include/jsoncpp") diff --git a/workspace/nlopt/repository.bzl b/workspace/nlopt/repository.bzl index 6dae0f3..902bd16 100644 --- a/workspace/nlopt/repository.bzl +++ b/workspace/nlopt/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/nlopt.h", "include/nlopt.h") diff --git a/workspace/ode/repository.bzl b/workspace/ode/repository.bzl index b4f8db8..053c94a 100644 --- a/workspace/ode/repository.bzl +++ b/workspace/ode/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu/" repository_ctx.symlink("/usr/include/ode", "include/ode") diff --git a/workspace/os.bzl b/workspace/os.bzl index 512d50c..f4ff90c 100644 --- a/workspace/os.bzl +++ b/workspace/os.bzl @@ -54,6 +54,7 @@ def _make_result( error = None, macos_release = None, ubuntu_release = None, + debian_release = None, is_wheel = False, homebrew_prefix = None): """Return a fully-populated struct result for determine_os, below.""" @@ -61,12 +62,15 @@ def _make_result( is_macos_wheel = (macos_release != None) and is_wheel is_ubuntu = (ubuntu_release != None) and not is_wheel is_manylinux = (ubuntu_release != None) and is_wheel + is_debian = (debian_release != None) and not is_wheel if is_macos: target = "macos" elif is_macos_wheel: target = "macos_wheel" elif is_ubuntu: target = "ubuntu" + elif is_debian: + target = "debian" elif is_manylinux: target = "manylinux" else: @@ -77,10 +81,12 @@ def _make_result( is_macos = is_macos, is_macos_wheel = is_macos_wheel, is_ubuntu = is_ubuntu, + is_debian = is_debian, is_manylinux = is_manylinux, ubuntu_release = ubuntu_release, macos_release = macos_release, homebrew_prefix = homebrew_prefix, + debian_release = debian_release, ) def _determine_linux(repository_ctx): @@ -128,6 +134,24 @@ def _determine_linux(repository_ctx): "unsupported '%s' release '%s'" % (distro, ubuntu_release)), ) + elif distro == "Debian": + lsb = exec_using_which(repository_ctx, ["lsb_release", "-sc"]) + if lsb.error != None: + return _make_result(error = error_prologue + lsb.error) + debian_codename = lsb.stdout.strip() + + if debian_codename in ["rodete"]: + return _make_result( + debian_release = debian_codename, + is_wheel = is_manylinux, + ) + + # Nothing matched. + return _make_result( + error = (error_prologue + + "unsupported '%s' release '%s'" % + (distro, debian_codename)), + ) # Nothing matched. return _make_result( diff --git a/workspace/osg/repository.bzl b/workspace/osg/repository.bzl index 14cea0d..2f98fe4 100644 --- a/workspace/osg/repository.bzl +++ b/workspace/osg/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu/" repository_ctx.symlink("/usr/include/osg", "include/osg") repository_ctx.symlink("/usr/include/osgAnimation", "include/osgAnimation") # noqa diff --git a/workspace/pycodestyle/package.BUILD.bazel b/workspace/pycodestyle/package.BUILD.bazel index 7113b96..d41141d 100644 --- a/workspace/pycodestyle/package.BUILD.bazel +++ b/workspace/pycodestyle/package.BUILD.bazel @@ -1,7 +1,10 @@ # -*- python -*- -load("@gz//bazel/skylark:py.bzl", "py_binary") load("@gz//bazel/workspace:generate_file.bzl", "generate_file") +load( + "@gz//bazel/skylark:build_defs.bzl", + "gz_py_binary", +) licenses(["notice"]) # MIT @@ -28,7 +31,7 @@ generate_file( visibility = ["//visibility:private"], ) -py_binary( +gz_py_binary( name = "pycodestyle", srcs = [ "__init__.py", diff --git a/workspace/rules_qt/repository.bzl b/workspace/rules_qt/repository.bzl index 529f493..e4dddf6 100644 --- a/workspace/rules_qt/repository.bzl +++ b/workspace/rules_qt/repository.bzl @@ -8,7 +8,7 @@ def rules_qt_repository( github_archive( name = name, repository = "mjcarroll/bazel_rules_qt", # License: Apache-2.0 - commit = "709d4432748a1beae0d00a91d53b63b44d38092c", - sha256 = "c2a6cd95e1737ca6b592cf9ad5a9f03478298707e5e5784e4e661531b1e5640e", # noqa + commit = "056d0558f6d31a0183aba62ea471b95646058899", + sha256 = "35136d56cadbee7b7c1b4f6bac758b209355022da2e493f7ccde38a86a790168", # noqa mirrors = mirrors, ) diff --git a/workspace/sdl2/repository.bzl b/workspace/sdl2/repository.bzl index 442d7a0..87a122c 100644 --- a/workspace/sdl2/repository.bzl +++ b/workspace/sdl2/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu/" repository_ctx.symlink("/usr/include/SDL2", "include/SDL2") repository_ctx.symlink( diff --git a/workspace/spdlog/repository.bzl b/workspace/spdlog/repository.bzl index aa245c4..5a4b42e 100644 --- a/workspace/spdlog/repository.bzl +++ b/workspace/spdlog/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu/" repository_ctx.symlink("/usr/include/spdlog", "include/spdlog") diff --git a/workspace/sqlite3/repository.bzl b/workspace/sqlite3/repository.bzl index df0836f..2b5df4a 100644 --- a/workspace/sqlite3/repository.bzl +++ b/workspace/sqlite3/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/sqlite3.h", "include/sqlite3.h") diff --git a/workspace/tinyxml2/repository.bzl b/workspace/tinyxml2/repository.bzl index 422c20a..74d492c 100644 --- a/workspace/tinyxml2/repository.bzl +++ b/workspace/tinyxml2/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/tinyxml2.h", "include/tinyxml2.h") diff --git a/workspace/uuid/repository.bzl b/workspace/uuid/repository.bzl index 001fda6..3e55483 100644 --- a/workspace/uuid/repository.bzl +++ b/workspace/uuid/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu or os_result.is_manylinux: + if os_result.is_ubuntu or os_result.is_debian or os_result.is_manylinux: build_flavor = "ubuntu" hdrs = [ "uuid/uuid.h", diff --git a/workspace/vulkan/repository.bzl b/workspace/vulkan/repository.bzl index dbc75d6..519062b 100644 --- a/workspace/vulkan/repository.bzl +++ b/workspace/vulkan/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/vulkan", "include/vulkan") diff --git a/workspace/xcb/repository.bzl b/workspace/xcb/repository.bzl index e8ab372..1571a89 100644 --- a/workspace/xcb/repository.bzl +++ b/workspace/xcb/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/xcb", "include/xcb") diff --git a/workspace/yaml/repository.bzl b/workspace/yaml/repository.bzl index 440b824..e84dd81 100644 --- a/workspace/yaml/repository.bzl +++ b/workspace/yaml/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu/" repository_ctx.symlink("/usr/include/yaml.h", "include/yaml.h") diff --git a/workspace/zip/repository.bzl b/workspace/zip/repository.bzl index 366fd8d..123fc09 100644 --- a/workspace/zip/repository.bzl +++ b/workspace/zip/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu/" repository_ctx.symlink("/usr/include/zip.h", "include/zip.h") repository_ctx.symlink("/usr/include/zipconf.h", "include/zipconf.h") diff --git a/workspace/zmq/repository.bzl b/workspace/zmq/repository.bzl index 2568cdf..64ce271 100644 --- a/workspace/zmq/repository.bzl +++ b/workspace/zmq/repository.bzl @@ -6,7 +6,7 @@ def _impl(repository_ctx): if os_result.error != None: fail(os_result.error) - if os_result.is_ubuntu: + if os_result.is_ubuntu or os_result.is_debian: libdir = "/usr/lib/x86_64-linux-gnu" repository_ctx.symlink("/usr/include/zmq.h", "include/zmq.h") repository_ctx.symlink("/usr/include/zmq_utils.h", "include/zmq_utils.h") # noqa