-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
continue split proto and non-proto crates
Can succesfully do a WebRTC call on localhost.
- Loading branch information
Showing
25 changed files
with
4,053 additions
and
969 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
header = "// SPDX-License-Identifier: MIT OR Apache-2.0" | ||
sys_includes = ["sys/socket.h"] | ||
include_guard = "LIBRICE_PROTO_H" | ||
tab_width = 4 | ||
language = "C" | ||
cpp_compat = true | ||
usize_is_size_t = true | ||
|
||
[export] | ||
exclude = ["MAGIC_COOKIE", "BINDING", "RTP", "RTCP"] | ||
item_types = ["enums", "structs", "opaque", "functions"] | ||
|
||
[export.rename] | ||
#"sockaddr" = "struct sockaddr" | ||
#"sockaddr_storage" = "struct sockaddr_storage" | ||
"CandidateType" = "RiceCandidateType" | ||
"TransportType" = "RiceTransportType" | ||
"ComponentConnectionState" = "RiceComponentConnectionState" | ||
|
||
[fn] | ||
args = "vertical" | ||
|
||
[enum] | ||
rename_variants = "QualifiedScreamingSnakeCase" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os, subprocess | ||
import pathlib, configparser | ||
|
||
def parse_cargo_tree_line(line): | ||
components = line.split() | ||
# FIXME doesn't support more than single digit depths | ||
depth = int(components[0][0]) | ||
name = components[0][1:] | ||
version = components[1][1:] | ||
features = [] | ||
if len(components) > 2 and components[2][0] != '(': | ||
features = components[2].split(',') | ||
print(depth, name, version, features) | ||
return (name, version, features) | ||
|
||
CRATES_URL_TEMPL = "https://crates.io/api/v1/crates/{name}/{version}/download" | ||
|
||
def main(): | ||
crates_features = subprocess.run(["cargo", "tree", "-f", "{p} {f}", "-p", "librice-proto", "-e", "normal", "--prefix", "depth"], capture_output=True, check=True, text=True).stdout | ||
crates = {} | ||
for line in crates_features.splitlines(): | ||
(name, version, features) = parse_cargo_tree_line(line) | ||
if name != 'librice-proto': | ||
if name in crates: | ||
assert(crates[name] == (version, features)) | ||
continue | ||
crates[name] = (version, features) | ||
wrap_file = pathlib.Path('..') / 'librice-proto' / 'subprojects' / (name + '.wrap') | ||
with wrap_file.open(mode="r") as f: | ||
wrap = configparser.ConfigParser() | ||
wrap.read_file(f) | ||
name_version = name + '-' + version | ||
assert(wrap["wrap-file"]["directory"] == name_version) | ||
assert(wrap["wrap-file"]["source_url"] == CRATES_URL_TEMPL.format(name=name, version=version)) | ||
assert(wrap["wrap-file"]["source_filename"] == name_version + '.tar.gz') | ||
assert(wrap["provide"]["dependency_names"] == name + '-rs') | ||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.