Skip to content

Commit

Permalink
Add support for debian bookworm (#66)
Browse files Browse the repository at this point in the history
* Add support for debian bookworm

Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>

* Lint

Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>

---------

Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
  • Loading branch information
mjcarroll authored Nov 2, 2023
1 parent 6f41f11 commit e39eae3
Show file tree
Hide file tree
Showing 33 changed files with 61 additions and 34 deletions.
2 changes: 1 addition & 1 deletion workspace/X11/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/assimp/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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/")

Expand Down
2 changes: 1 addition & 1 deletion workspace/buildifier/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion workspace/curl/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion workspace/eigen3/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion workspace/fcl/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/ffmpeg/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion workspace/fmt/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/freeimage/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion workspace/freetype2/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion workspace/gdal/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/gl/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down
2 changes: 1 addition & 1 deletion workspace/glib/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion workspace/glslang/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/glut/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion workspace/gts/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion workspace/jsoncpp/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/nlopt/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/ode/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
24 changes: 24 additions & 0 deletions workspace/os.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,23 @@ 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."""
is_macos = (macos_release != None) and not is_wheel
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:
Expand All @@ -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):
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion workspace/osg/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions workspace/pycodestyle/package.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -28,7 +31,7 @@ generate_file(
visibility = ["//visibility:private"],
)

py_binary(
gz_py_binary(
name = "pycodestyle",
srcs = [
"__init__.py",
Expand Down
4 changes: 2 additions & 2 deletions workspace/rules_qt/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
2 changes: 1 addition & 1 deletion workspace/sdl2/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion workspace/spdlog/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/sqlite3/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/tinyxml2/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/uuid/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion workspace/vulkan/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/xcb/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/yaml/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion workspace/zip/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion workspace/zmq/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e39eae3

Please sign in to comment.