File pulseeffects-4.8.5-exp-fs-fix.patch of Package pulseeffects
diff -ru a/include/rnnoise_ui.hpp b/include/rnnoise_ui.hpp
--- a/include/rnnoise_ui.hpp 2021-06-27 00:42:42.272543979 +0800
+++ b/include/rnnoise_ui.hpp 2021-06-27 00:53:58.524813595 +0800
@@ -21,7 +21,7 @@
#define RNNOISE_UI_HPP
#include <glibmm/i18n.h>
-#include <filesystem>
+#include <experimental/filesystem>
#include "glibmm/miscutils.h"
#include "plugin_ui_base.hpp"
@@ -50,7 +50,7 @@
Gtk::ListBox* model_listbox = nullptr;
Gtk::Label* active_model_name = nullptr;
- std::filesystem::path model_dir;
+ std::experimental::filesystem::path model_dir;
void on_import_model_clicked();
diff -ru a/src/meson.build b/src/meson.build
--- a/src/meson.build 2021-06-27 01:23:11.869382068 +0800
+++ b/src/meson.build 2021-06-27 01:24:26.640555318 +0800
@@ -114,6 +114,8 @@
dependency('threads')
]
+add_project_link_arguments(['-lstdc++fs'], language : 'cpp')
+
executable(
meson.project_name(),
pulseeffects_sources,
diff -ru a/src/rnnoise_ui.cpp b/src/rnnoise_ui.cpp
--- a/src/rnnoise_ui.cpp 2021-06-27 01:03:31.418450716 +0800
+++ b/src/rnnoise_ui.cpp 2021-06-27 01:06:33.492428489 +0800
@@ -60,8 +60,8 @@
// model dir
- if (!std::filesystem::is_directory(model_dir)) {
- if (std::filesystem::create_directories(model_dir)) {
+ if (!std::experimental::filesystem::is_directory(model_dir)) {
+ if (std::experimental::filesystem::create_directories(model_dir)) {
util::debug(log_tag + "model directory created: " + model_dir.string());
} else {
util::warning(log_tag + "failed to create model directory: " + model_dir.string());
@@ -130,14 +130,14 @@
}
void RNNoiseUi::import_model_file(const std::string& file_path) {
- std::filesystem::path p{file_path};
+ std::experimental::filesystem::path p{file_path};
- if (std::filesystem::is_regular_file(p)) {
+ if (std::experimental::filesystem::is_regular_file(p)) {
auto out_path = model_dir / p.filename();
out_path.replace_extension(".rnnn");
- std::filesystem::copy_file(p, out_path, std::filesystem::copy_options::overwrite_existing);
+ std::experimental::filesystem::copy_file(p, out_path, std::experimental::filesystem::copy_options::overwrite_existing);
util::debug(log_tag + "imported model file to: " + out_path.string());
} else {
@@ -183,7 +183,7 @@
}));
connections.emplace_back(apply_btn->signal_clicked().connect([=]() {
- auto model_file = model_dir / std::filesystem::path{row->get_name() + ".rnnn"};
+ auto model_file = model_dir / std::experimental::filesystem::path{row->get_name() + ".rnnn"};
settings->set_string("model-path", model_file.string());
}));
@@ -194,11 +194,11 @@
}
auto RNNoiseUi::get_model_names() -> std::vector<std::string> {
- std::filesystem::directory_iterator it{model_dir};
+ std::experimental::filesystem::directory_iterator it{model_dir};
std::vector<std::string> names;
- while (it != std::filesystem::directory_iterator{}) {
- if (std::filesystem::is_regular_file(it->status())) {
+ while (it != std::experimental::filesystem::directory_iterator{}) {
+ if (std::experimental::filesystem::is_regular_file(it->status())) {
if (it->path().extension().string() == ".rnnn") {
names.emplace_back(it->path().stem().string());
}
@@ -211,17 +211,17 @@
}
void RNNoiseUi::remove_model_file(const std::string& name) {
- auto model_file = model_dir / std::filesystem::path{name + ".rnnn"};
+ auto model_file = model_dir / std::experimental::filesystem::path{name + ".rnnn"};
- if (std::filesystem::exists(model_file)) {
- std::filesystem::remove(model_file);
+ if (std::experimental::filesystem::exists(model_file)) {
+ std::experimental::filesystem::remove(model_file);
util::debug(log_tag + "removed model file: " + model_file.string());
}
}
void RNNoiseUi::set_active_model_label() {
- auto path = std::filesystem::path{settings->get_string("model-path")};
+ auto path = std::experimental::filesystem::path{settings->get_string("model-path")};
if (settings->get_string("model-path").empty()) {
active_model_name->set_text(default_model_name);