diff --git a/config/lib.json b/config/lib.json index 160d43f2..dc792c3b 100644 --- a/config/lib.json +++ b/config/lib.json @@ -854,5 +854,14 @@ "zstd.h", "zstd_errors.h" ] + }, + "watcher": { + "source": "watcher", + "static-libs-unix": [ + "libwatcher-c.a" + ], + "headers": [ + "wtr/watcher-c.h" + ] } } diff --git a/config/source.json b/config/source.json index 2ad8ec87..57a10a4e 100644 --- a/config/source.json +++ b/config/source.json @@ -1070,5 +1070,14 @@ "type": "file", "path": "LICENSE" } + }, + "watcher": { + "type": "ghtar", + "repo": "e-dant/watcher", + "prefer-stable": true, + "license": { + "type": "file", + "path": "license" + } } } diff --git a/src/SPC/builder/freebsd/library/watcher.php b/src/SPC/builder/freebsd/library/watcher.php new file mode 100644 index 00000000..1a08dd24 --- /dev/null +++ b/src/SPC/builder/freebsd/library/watcher.php @@ -0,0 +1,12 @@ +cd($this->source_dir . '/watcher-c') + ->initializeEnv($this) + ->exec(getenv('CC') . ' -c -o libwatcher-c.o ./src/watcher-c.cpp -I ./include -I ../include -std=c++17 -Wall -Wextra -fPIC') + ->exec(getenv('AR') . ' rcs libwatcher-c.a libwatcher-c.o'); + + copy($this->source_dir . '/watcher-c/libwatcher-c.a', BUILD_LIB_PATH . '/libwatcher-c.a'); + FileSystem::createDir(BUILD_INCLUDE_PATH . '/wtr'); + copy($this->source_dir . '/watcher-c/include/wtr/watcher-c.h', BUILD_INCLUDE_PATH . '/wtr/watcher-c.h'); + } +}