Update tomlplusplus dependency to 3.0.1

Last minute update because Arch started packaging this version yesterday
and there are breaking API changes compared to version 2.5.x.
This commit is contained in:
Robbert van der Helm
2022-01-15 14:27:34 +01:00
parent 390df5c264
commit 02a66cba16
3 changed files with 30 additions and 29 deletions
+3
View File
@@ -70,6 +70,9 @@ Versioning](https://semver.org/spec/v2.0.0.html).
### Packaging notes ### Packaging notes
- The tomlplusplus wrap dependency has been updated to version 3.0.1 because of
breaking API changes in version 3.0 and Arch was already shipping that
version.
- We now target VST3 SDK version 3.7.4 with git tag `v3.7.4_build_25-patched`. - We now target VST3 SDK version 3.7.4 with git tag `v3.7.4_build_25-patched`.
- Yabridgectl now uses Rust 2021 and requires rustc 1.56 or newer to build. - Yabridgectl now uses Rust 2021 and requires rustc 1.56 or newer to build.
+25 -25
View File
@@ -40,35 +40,35 @@ Configuration::Configuration(const fs::path& config_path,
// so otherwise we'll get the tables sorted by key instead. // so otherwise we'll get the tables sorted by key instead.
toml::table table = toml::parse_file(config_path.string()); toml::table table = toml::parse_file(config_path.string());
// I wasn't able to wade through the template soup to come up with a better // This table stores its children in an ordered map and it will thus be
// way to sort this by location, so please feel free to correct this if you // sorted lexicographically. For our uses we want sections from the start of
// know of a better way! The source locations has to be stored inside of the // the file to have precedence over later sections, so we need to sort the
// vector itself because the `node.source()` on the copies stored in this // tables by source location first.
// vector won't contain the proper location after we've iterated through std::vector<std::tuple<toml::key, toml::table>> sorted_tables{};
// `table`.
std::vector<std::tuple<std::string, toml::source_region, toml::table>>
sorted_tables{};
for (auto [pattern, node] : table) { for (auto [pattern, node] : table) {
if (const toml::table* config = node.as_table()) { if (const toml::table* config = node.as_table()) {
sorted_tables.push_back( sorted_tables.push_back(std::make_tuple(pattern, *config));
std::make_tuple(pattern, config->source(), *config));
} }
} }
std::sort(sorted_tables.begin(), sorted_tables.end(), std::sort(sorted_tables.begin(), sorted_tables.end(),
[](const auto& a, const auto& b) { [](const auto& a, const auto& b) {
const auto& [a_pattern, a_source, a_table] = a; const auto& [a_pattern, a_table] = a;
const auto& [b_pattern, b_source, b_table] = b; const auto& [b_pattern, b_table] = b;
return a_source.begin.line < b_source.begin.line; return a_pattern.source().begin.line <
b_pattern.source().begin.line;
}); });
// This is the path of the current .so file relative to this `yabridge.toml`
// file
const fs::path relative_path = const fs::path relative_path =
yabridge_path.lexically_relative(config_path.parent_path()); yabridge_path.lexically_relative(config_path.parent_path());
for (const auto& [pattern, source, table] : sorted_tables) { for (const auto& [pattern, table] : sorted_tables) {
// First try to match the glob pattern, allow matching an entire // First try to match the glob pattern, allow matching an entire
// directory for ease of use. If none of the patterns in the file match // directory for ease of use. If none of the patterns in the file match
// the plugin path then everything will be left at the defaults. // the plugin path then everything will be left at the defaults.
if (fnmatch(pattern.c_str(), relative_path.c_str(), const std::string key(pattern.str());
if (fnmatch(key.c_str(), relative_path.c_str(),
FNM_PATHNAME | FNM_LEADING_DIR) != 0) { FNM_PATHNAME | FNM_LEADING_DIR) != 0) {
continue; continue;
} }
@@ -84,7 +84,7 @@ Configuration::Configuration(const fs::path& config_path,
if (const auto parsed_value = value.as_string()) { if (const auto parsed_value = value.as_string()) {
group = parsed_value->get(); group = parsed_value->get();
} else { } else {
invalid_options.push_back(key); invalid_options.emplace_back(std::string());
} }
} else if (key == "disable_pipes") { } else if (key == "disable_pipes") {
// This option can be either enabled or disable with a boolean, // This option can be either enabled or disable with a boolean,
@@ -99,25 +99,25 @@ Configuration::Configuration(const fs::path& config_path,
} else if (const auto parsed_value = value.as_string()) { } else if (const auto parsed_value = value.as_string()) {
disable_pipes = parsed_value->get(); disable_pipes = parsed_value->get();
} else { } else {
invalid_options.push_back(key); invalid_options.emplace_back(key);
} }
} else if (key == "editor_coordinate_hack") { } else if (key == "editor_coordinate_hack") {
if (const auto parsed_value = value.as_boolean()) { if (const auto parsed_value = value.as_boolean()) {
editor_coordinate_hack = parsed_value->get(); editor_coordinate_hack = parsed_value->get();
} else { } else {
invalid_options.push_back(key); invalid_options.emplace_back(key);
} }
} else if (key == "editor_force_dnd") { } else if (key == "editor_force_dnd") {
if (const auto parsed_value = value.as_boolean()) { if (const auto parsed_value = value.as_boolean()) {
editor_force_dnd = parsed_value->get(); editor_force_dnd = parsed_value->get();
} else { } else {
invalid_options.push_back(key); invalid_options.emplace_back(key);
} }
} else if (key == "editor_xembed") { } else if (key == "editor_xembed") {
if (const auto parsed_value = value.as_boolean()) { if (const auto parsed_value = value.as_boolean()) {
editor_xembed = parsed_value->get(); editor_xembed = parsed_value->get();
} else { } else {
invalid_options.push_back(key); invalid_options.emplace_back(key);
} }
} else if (key == "frame_rate") { } else if (key == "frame_rate") {
if (const auto parsed_value = value.as_floating_point()) { if (const auto parsed_value = value.as_floating_point()) {
@@ -128,28 +128,28 @@ Configuration::Configuration(const fs::path& config_path,
// values and integers here // values and integers here
frame_rate = parsed_value->get(); frame_rate = parsed_value->get();
} else { } else {
invalid_options.push_back(key); invalid_options.emplace_back(key);
} }
} else if (key == "hide_daw") { } else if (key == "hide_daw") {
if (const auto parsed_value = value.as_boolean()) { if (const auto parsed_value = value.as_boolean()) {
hide_daw = parsed_value->get(); hide_daw = parsed_value->get();
} else { } else {
invalid_options.push_back(key); invalid_options.emplace_back(key);
} }
} else if (key == "vst3_no_scaling") { } else if (key == "vst3_no_scaling") {
if (const auto parsed_value = value.as_boolean()) { if (const auto parsed_value = value.as_boolean()) {
vst3_no_scaling = parsed_value->get(); vst3_no_scaling = parsed_value->get();
} else { } else {
invalid_options.push_back(key); invalid_options.emplace_back(key);
} }
} else if (key == "vst3_prefer_32bit") { } else if (key == "vst3_prefer_32bit") {
if (const auto parsed_value = value.as_boolean()) { if (const auto parsed_value = value.as_boolean()) {
vst3_prefer_32bit = parsed_value->get(); vst3_prefer_32bit = parsed_value->get();
} else { } else {
invalid_options.push_back(key); invalid_options.emplace_back(key);
} }
} else { } else {
unknown_options.push_back(key); unknown_options.emplace_back(key);
} }
} }
+2 -4
View File
@@ -1,9 +1,7 @@
[wrap-git] [wrap-git]
url = https://github.com/marzer/tomlplusplus.git url = https://github.com/marzer/tomlplusplus.git
# This is tag v2.5.0 plus a couple of additional commits because of issues with # Tag v3.0.1
# their meson.build that breaks the build with Meson 0.60 revision = 8e669aa6990e0ed219c169d491472d749f54c393
# https://github.com/marzer/tomlplusplus/issues/121
revision = 47216c8a73d77e7431ec536fb3e251aed06cc420
depth = 1 depth = 1
[provide] [provide]