From 180329d1d2f0642b0aadee03bb7bfedb7da98fcf Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 6 Jun 2020 15:07:25 +0200 Subject: [PATCH 1/5] enabled meson build --- .gitignore | 5 +++-- meson.build | 15 +++++++++++++++ subprojects/jansson.wrap | 10 ++++++++++ subprojects/libwebsockets.wrap | 6 ++++++ subprojects/webfuse.wrap | 6 ++++++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 meson.build create mode 100644 subprojects/jansson.wrap create mode 100644 subprojects/libwebsockets.wrap create mode 100644 subprojects/webfuse.wrap diff --git a/.gitignore b/.gitignore index 48e8b24..7921596 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /build/ -/.deps/ -/.vscode/ \ No newline at end of file +/.vscode/ +/subprojects/* +!/subprojects/*.wrap \ No newline at end of file diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..036b954 --- /dev/null +++ b/meson.build @@ -0,0 +1,15 @@ +project('webfuse-provider', version: '0.1.0', license: 'LGPL-3.0+') + + +webfuse_provider_dep = dependency('webfuse_provider', version: '>=0.3.0', + fallback: ['webfuse', 'webfuse_provider_dep'], default_options: ['without_adapter=true']) + +executable('webfuse-provider', + 'src/main.c', + dependencies: [webfuse_provider_dep]) + +executable('static-filesystem-provider', + 'src/static_filesystem/static_filesystem.c', + 'src/static_filesystem/path.c', + 'src/static_filesystem/main.c', + dependencies: [webfuse_provider_dep]) diff --git a/subprojects/jansson.wrap b/subprojects/jansson.wrap new file mode 100644 index 0000000..6282afd --- /dev/null +++ b/subprojects/jansson.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = jansson-2.11 + +source_url = http://www.digip.org/jansson/releases/jansson-2.11.tar.bz2 +source_filename = jansson-2.11.tar.bz2 +source_hash = 783132e2fc970feefc2fa54199ef65ee020bd8e0e991a78ea44b8586353a0947 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/jansson/2.11/3/get_zip +patch_filename = jansson-2.11-3-wrap.zip +patch_hash = 0bcac510994890048d42658c674e33dd7d88715fc1e3bf49d10012f57b0e0020 \ No newline at end of file diff --git a/subprojects/libwebsockets.wrap b/subprojects/libwebsockets.wrap new file mode 100644 index 0000000..f1aa3ee --- /dev/null +++ b/subprojects/libwebsockets.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = libwebsockets-4.0.13 + +source_url = https://github.com/warmcat/libwebsockets/archive/v4.0.13.zip +source_filename = v4.0.13.zip +source_hash = 0914ea3fdec496daf6b6a5c00f7ba1b52eb8cc3d55b66685df92920b232fd7a5 \ No newline at end of file diff --git a/subprojects/webfuse.wrap b/subprojects/webfuse.wrap new file mode 100644 index 0000000..469f97e --- /dev/null +++ b/subprojects/webfuse.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = webfuse-0.3.1 + +source_url = https://github.com/falk-werner/webfuse/archive/v0.3.1.tar.gz +source_filename = v0.3.1.tar.gz +source_hash = 46624b5f29e8f87dd1aebfce3b13ca87e766bc59546b6e5f49665d2f8c555d62 From 5233de245463c1ab686fb0044889209c4b3af6a6 Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 6 Jun 2020 15:08:12 +0200 Subject: [PATCH 2/5] removed service timeout die to api change of webfuse --- src/main.c | 4 +--- src/static_filesystem/main.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 18fe42e..261fb9b 100644 --- a/src/main.c +++ b/src/main.c @@ -11,8 +11,6 @@ #include "webfuse_provider.h" -#define SERVICE_TIMEOUT (1 * 1000) - struct config { char * url; @@ -368,7 +366,7 @@ int main(int argc, char* argv[]) while (!shutdown_requested) { - wfp_client_service(client, SERVICE_TIMEOUT); + wfp_client_service(client); } wfp_client_dispose(client); diff --git a/src/static_filesystem/main.c b/src/static_filesystem/main.c index 6d0b6f7..6596af4 100644 --- a/src/static_filesystem/main.c +++ b/src/static_filesystem/main.c @@ -7,8 +7,6 @@ #include "webfuse_provider.h" #include "static_filesystem.h" -#define SERVICE_TIMEOUT (1 * 1000) - struct args { char const * url; @@ -93,7 +91,7 @@ int main(int argc, char* argv[]) while (!shutdown_requested) { - wfp_client_service(client, SERVICE_TIMEOUT); + wfp_client_service(client); } wfp_client_dispose(client); From e0cd646a0c1f7e8683583a80a144c22a7e0fcf44 Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 6 Jun 2020 15:08:31 +0200 Subject: [PATCH 3/5] switched to meson build --- .travis.yml | 49 +++++++++---------------------------------------- 1 file changed, 9 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4774ca5..5746be7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,49 +14,18 @@ addons: - pkgconf - wget - ca-certificates + - python3 + - python3-pip + - python3-setuptools + - python3-wheel + - ninja-build before_install: - - mkdir .deps - - cd .deps - # libwebsockets - - wget https://github.com/warmcat/libwebsockets/archive/v3.2.0.tar.gz -O libwebsockets.tar.gz - - tar -xf libwebsockets.tar.gz - - cd libwebsockets-3.2.0 - - mkdir .build - - cd .build - - cmake .. - - make - - sudo make install - - cd .. - - cd .. - # jansson - - wget https://github.com/akheron/jansson/archive/v2.12.tar.gz -O jansson.tar.gz - - tar -xf jansson.tar.gz - - cd jansson-2.12 - - mkdir .build - - cd .build - - cmake .. - - make - - sudo make install - - cd .. - - cd .. - # libwebfuse - - wget https://github.com/falk-werner/webfuse/archive/v0.2.0.tar.gz -O webfuse.tar.gz - - tar -xf webfuse.tar.gz - - cd webfuse-0.2.0 - - mkdir .build - - cd .build - - cmake -DWITHOUT_ADAPTER=ON .. - - make - - sudo make install - - cd .. - - cd .. - - cd .. + - sudo pip3 install --system meson before_script: - - mkdir build - - cd build - - cmake .. + - meson build script: - make \ No newline at end of file + - cd build + - ninja \ No newline at end of file From 88a8500014dbb889e172c2647a4a544bb812ff9d Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 6 Jun 2020 15:11:49 +0200 Subject: [PATCH 4/5] removed cmake build --- CMakeLists.txt | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 763a263..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -cmake_minimum_required (VERSION 3.10) -project(webfuse-provider VERSION 0.1.0 DESCRIPTION "Webfuse provider") - -set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(Threads REQUIRED) - -find_package(PkgConfig REQUIRED) -pkg_check_modules(LWS REQUIRED libwebsockets) -pkg_check_modules(WEBFUSE REQUIRED libwebfuse-provider) - -include_directories( - "src" - ${WEBFUSE_INCLUDE_DIRS} -) - -link_directories( - ${WEBFUSE_LIBRARY_DIRS} -) - -set(CMAKE_C_STANDARD 99) -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -set(C_WARNINGS -Wall -Wextra) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -add_executable(webfuse-provider-app - src/main.c -) - -set_target_properties(webfuse-provider-app PROPERTIES OUTPUT_NAME webfuse-provider) - -target_link_libraries(webfuse-provider-app PUBLIC webfuse-provider ${WEBFUSE_LIBRARIES}) - -# static-filesystem-provider - -add_executable(static-filesystem-provider - src/static_filesystem/static_filesystem.c - src/static_filesystem/path.c - src/static_filesystem/main.c -) - -target_link_libraries(static-filesystem-provider PUBLIC webfuse-provider ${WEBFUSE_LIBRARIES}) - From 2cc851134d90ec0c16d97004bc4858554394e056 Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 6 Jun 2020 15:12:15 +0200 Subject: [PATCH 5/5] changed build instructions to meson --- README.md | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index a975141..6074533 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,9 @@ Reference implementation of webfuse provider To install dependecies, see below. - cd webfused - mkdir build + meson build cd build - cmake .. - make + ninja ./webfuse-provider ## Dependencies @@ -21,38 +19,4 @@ To install dependecies, see below. - [libwebsockets](https://libwebsockets.org/) - [jansson](https://github.com/akheron/jansson) -### Installing dependencies - -#### libwebsockets - - wget https://github.com/warmcat/libwebsockets/archive/v3.2.0.tar.gz -O libwebsockets.tar.gz - tar -xf libwebsockets.tar.gz - cd libwebsockets-3.2.0 - mkdir .build - cd .build - cmake .. - make - sudo make install - - -#### jansson - - wget https://github.com/akheron/jansson/archive/v2.12.tar.gz -O jansson.tar.gz - tar -xf jansson.tar.gz - cd jansson-2.12 - mkdir .build - cd .build - cmake .. - make - sudo make install - -#### webfuse - - wget https://github.com/falk-werner/webfuse/archive/v0.2.0.tar.gz -O webfuse.tar.gz - tar -xf webfuse.tar.gz - cd webfuse-0.2.0 - mkdir .build - cd .build - cmake -DWITHOUT_ADAPTER=ON .. - make - sudo make install +All dependencies are bundled using meson wrap files.