Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdns: add mdns for local network routing #511

Merged
merged 14 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ versioned_http_archive(
version = "a4c1e3f7138c2e577376beb99f964cf71e1c8b1b",
)

versioned_http_archive(
name = "avahi",
build_file = "//bazel/third_party/avahi:avahi.BUILD",
sha256 = "060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda",
strip_prefix = "avahi-{version}",
url = "https://github.com/lathiat/avahi/releases/download/v{version}/avahi-{version}.tar.gz",
version = "0.8",
)

versioned_http_archive(
name = "bazel_gazelle",
sha256 = "efbbba6ac1a4fd342d5122cbdfdb82aeb2cf2862e35022c752eaddffada7c3f3",
Expand All @@ -154,6 +163,15 @@ versioned_http_archive(
version = "7.85.0",
)

versioned_http_archive(
name = "dbus",
build_file = "//bazel/third_party/dbus:dbus.BUILD",
sha256 = "a6bd5bac5cf19f0c3c594bdae2565a095696980a683a0ef37cb6212e093bde35",
strip_prefix = "dbus-{version}",
url = "https://dbus.freedesktop.org/releases/dbus/dbus-{version}.tar.xz",
version = "1.14.8",
)

versioned_http_archive(
name = "ed25519",
build_file = "//bazel/third_party/ed25519:ed25519.BUILD",
Expand All @@ -163,6 +181,16 @@ versioned_http_archive(
version = "7fa6712ef5d581a6981ec2b08ee623314cd1d1c4",
)

versioned_http_archive(
name = "expat",
build_file = "//bazel/third_party/expat:expat.BUILD",
strip_prefix = "expat-{version}",
sha256 = "ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe",
# TODO: fix the R_2_5_0 nonsense
url = "https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-{version}.tar.xz",
version = "2.5.0",
)

versioned_http_archive(
name = "gmp",
build_file = "//bazel/third_party/gmp:gmp.BUILD",
Expand Down
Empty file.
30 changes: 30 additions & 0 deletions bazel/third_party/avahi/avahi.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")

filegroup(
name = "all",
srcs = glob(["**"]),
)

cc_library(
name = "dns-sd",
hdrs = ["dns_sd.h"],
visibility = ["//visibility:public"],
)

configure_make(
name = "avahi",
args = select({
"@platforms//os:macos": ["--jobs=`sysctl -n hw.logicalcpu`"],
"//conditions:default": ["--jobs=`nproc`"],
}),
configure_options = ["--with-dbus-system-address='unix:path=/var/run/dbus/system_bus_socket' --with-xml=none --disable-libevent --disable-glib --disable-gobject --disable-gdbm --disable-qt3 --disable-qt4 --disable-qt5 --disable-gtk --disable-gtk3 --disable-mono --disable-monodoc --disable-python --disable-libdaemon --enable-compat-libdns_sd --disable-rpath"],
lib_source = ":all",
# out_include_dir = "avahi-compat-libdns_sd",
deps = ["@dbus"],
configure_in_place = True,
autogen = True,
autoconf = True,
autogen_command = "bootstrap.sh",
out_static_libs = ["libdns_sd.a", "libavahi-client.a", "libavahi-common.a"],
visibility = ["//visibility:public"],
)
Empty file.
21 changes: 21 additions & 0 deletions bazel/third_party/dbus/dbus.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")

filegroup(
name = "all",
srcs = glob(["**"]),
)

configure_make(
name = "dbus",
lib_name = "libdbus-1",
args = select({
"@platforms//os:macos": ["--jobs=`sysctl -n hw.logicalcpu`"],
"//conditions:default": ["--jobs=`nproc`"],
}),
copts = ["-O3"],
configure_options = ["--disable-selinux --without-x --disable-tests"],
lib_source = ":all",
configure_in_place = True,
deps = ["@expat"],
visibility = ["//visibility:public"],
)
Empty file.
20 changes: 20 additions & 0 deletions bazel/third_party/expat/expat.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")

filegroup(
name = "all",
srcs = glob(["**"]),
)

configure_make(
name = "expat",
args = select({
"@platforms//os:macos": ["--jobs=`sysctl -n hw.logicalcpu`"],
"//conditions:default": ["--jobs=`nproc`"],
}),
# configure_options = ["--with-xml=none --disable-libevent --disable-glib --disable-gobject --disable-gdbm --disable-qt3 --disable-qt4 --disable-qt5 --disable-gtk --disable-gtk3 --disable-mono --disable-monodoc --disable-python --enable-compat-libdns_sd"],
copts = ["-O3"],
lib_source = ":all",
# deps = ["@dbus"],
out_static_libs = ["libexpat.a"],
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions pkg/c3/motes.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@
# define c3__deep c3_s4('d','e','e','p')
# define c3__defn c3_s4('d','e','f','n')
# define c3__del c3_s3('d','e','l')
# define c3__dear c3_s4('d','e','a','r')
# define c3__delc c3_s4('d','e','l','c')
# define c3__delt c3_s4('d','e','l','t')
# define c3__dept c3_s4('d','e','p','t')
Expand Down
14 changes: 12 additions & 2 deletions pkg/vere/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ vere_library(
hdrs = [
"db/lmdb.h",
"vere.h",
],
] + select({
"@platforms//os:macos": [],
"@platforms//os:linux": [
"dns_sd.h",
],
}),
includes = ["."],
linkstatic = True,
visibility = ["//pkg:__subpackages__"],
Expand All @@ -133,7 +138,12 @@ vere_library(
"@lmdb",
"@openssl",
"@uv",
],
] + select({
"@platforms//os:macos": [],
"@platforms//os:linux": [
"@avahi",
],
})
)

#
Expand Down
Loading