aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/thomasmonkman-filewatch
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/thomasmonkman-filewatch')
-rw-r--r--vcpkg/ports/thomasmonkman-filewatch/fix-unix-listen.patch37
-rw-r--r--vcpkg/ports/thomasmonkman-filewatch/portfile.cmake13
-rw-r--r--vcpkg/ports/thomasmonkman-filewatch/vcpkg.json8
3 files changed, 58 insertions, 0 deletions
diff --git a/vcpkg/ports/thomasmonkman-filewatch/fix-unix-listen.patch b/vcpkg/ports/thomasmonkman-filewatch/fix-unix-listen.patch
new file mode 100644
index 0000000..c0363c5
--- /dev/null
+++ b/vcpkg/ports/thomasmonkman-filewatch/fix-unix-listen.patch
@@ -0,0 +1,37 @@
+diff --git a/FileWatch.hpp b/FileWatch.hpp
+index 4eba08b..2c0ff6d 100644
+--- a/FileWatch.hpp
++++ b/FileWatch.hpp
+@@ -276,7 +276,7 @@ namespace filewatch {
+
+ FolderInfo _directory;
+
+- const std::uint32_t _listen_filters = IN_MODIFY | IN_CREATE | IN_DELETE;
++ const std::uint32_t _listen_filters = IN_MODIFY | IN_CREATE | IN_DELETE | IN_MOVE;
+
+ const static std::size_t event_size = (sizeof(struct inotify_event));
+ #endif // __unix__
+@@ -604,7 +604,7 @@ namespace filewatch {
+ }
+ }();
+
+- const auto watch = inotify_add_watch(folder, watch_path.c_str(), IN_MODIFY | IN_CREATE | IN_DELETE);
++ const auto watch = inotify_add_watch(folder, watch_path.c_str(), IN_MODIFY | IN_CREATE | IN_DELETE | IN_MOVE);
+ if (watch < 0)
+ {
+ throw std::system_error(errno, std::system_category());
+@@ -644,6 +644,14 @@ namespace filewatch {
+ {
+ parsed_information.emplace_back(StringType{ changed_file }, Event::modified);
+ }
++ else if (event->mask & IN_MOVED_FROM)
++ {
++ parsed_information.emplace_back(StringType{ changed_file }, Event::renamed_old);
++ }
++ else if (event->mask & IN_MOVED_TO)
++ {
++ parsed_information.emplace_back(StringType{ changed_file }, Event::renamed_new);
++ }
+ }
+ }
+ i += event_size + event->len;
diff --git a/vcpkg/ports/thomasmonkman-filewatch/portfile.cmake b/vcpkg/ports/thomasmonkman-filewatch/portfile.cmake
new file mode 100644
index 0000000..4b045ba
--- /dev/null
+++ b/vcpkg/ports/thomasmonkman-filewatch/portfile.cmake
@@ -0,0 +1,13 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ThomasMonkman/filewatch
+ REF a59891baf375b73ff28144973a6fafd3fe40aa21
+ SHA512 9a110b42a499ed7047bb8a79029134943582b388db810974ad6b5f91d1ec720e45a9a3543c4a56ee97d51439f5a34222bada0fb43281dcbc2e65bdee38f836d5
+ HEAD_REF master
+ PATCHES
+ fix-unix-listen.patch
+)
+
+file(COPY "${SOURCE_PATH}/FileWatch.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include/thomasmonkman-filewatch")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/thomasmonkman-filewatch/vcpkg.json b/vcpkg/ports/thomasmonkman-filewatch/vcpkg.json
new file mode 100644
index 0000000..c078ddf
--- /dev/null
+++ b/vcpkg/ports/thomasmonkman-filewatch/vcpkg.json
@@ -0,0 +1,8 @@
+{
+ "name": "thomasmonkman-filewatch",
+ "version-date": "2023-01-16",
+ "port-version": 2,
+ "description": "File watcher in C++.",
+ "homepage": "https://github.com/ThomasMonkman/filewatch",
+ "license": "MIT"
+}