Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fusepp by jachappell/Fusepp #9310

Merged
merged 17 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions recipes/fusepp/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.4)
project(cmake_wrapper)

include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup(KEEP_RPATHS)

set(SOURCE_SUBFOLDER ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder)

file(GLOB_RECURSE INCLUDE_FILES "${SOURCE_SUBFOLDER}/Fuse*.h" "${SOURCE_SUBFOLDER}/Fuse.cpp")

add_library(fusepp ${SOURCE_SUBFOLDER}/Fuse.cpp)

set_target_properties(fusepp PROPERTIES PUBLIC_HEADER "${INCLUDE_FILES}")
install(TARGETS fusepp
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
4 changes: 4 additions & 0 deletions recipes/fusepp/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"cci.20210820":
url: "https://github.com/jachappell/Fusepp/archive/4a457accb1ae4686b0ccc2805a317bc29a5cddf8.zip"
sha256: "2ea6379f0d76b9a8e7e805d7c6941863a7254653633e2f63a551c2ef6c4605e8"
69 changes: 69 additions & 0 deletions recipes/fusepp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration


class FuseppConan(ConanFile):
name = "fusepp"
description = "A simple C++ wrapper for the FUSE filesystem."
license = "MIT"
topics = ("fuse", "fusepp", "wrapper", "filesystem")
homepage = "https://github.com/jachappell/Fusepp"
url = "https://github.com/conan-io/conan-center-index"

settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True
}
exports_sources = "CMakeLists.txt"

generators = "cmake"
winternet marked this conversation as resolved.
Show resolved Hide resolved
_cmake = None

@property
def _source_subfolder(self):
return "source_subfolder"

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, "11")
if self.settings.compiler == "gcc":
if tools.Version(self.settings.compiler.version) < "6":
raise ConanInvalidConfiguration("gcc < 6 is unsupported")

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
del self.options.fPIC
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd

def source(self):
tools.get(**self.conan_data["sources"][self.version],
strip_root=True, destination=self._source_subfolder)

def requirements(self):
self.requires("libfuse/3.10.5")

winternet marked this conversation as resolved.
Show resolved Hide resolved
def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)
self._cmake.configure()
return self._cmake

def build(self):
cmake = self._configure_cmake()
cmake.build()

def package(self):
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
cmake = self._configure_cmake()
cmake.install()
uilianries marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions recipes/fusepp/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_executable(${PROJECT_NAME} example.cpp)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
SSE4 marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 20 additions & 0 deletions recipes/fusepp/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os
from conans import ConanFile, CMake, tools


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
SSE4 marked this conversation as resolved.
Show resolved Hide resolved

def requirements(self):
self.requires("libfuse/3.10.5")

SSE4 marked this conversation as resolved.
Show resolved Hide resolved
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run("%s --version" % bin_path, run_environment=True)
9 changes: 9 additions & 0 deletions recipes/fusepp/all/test_package/example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "Fuse.h"
#include "Fuse-impl.h"

class MyFilesystem : public Fusepp::Fuse<MyFilesystem> {
};

int main() {
MyFilesystem();
}
3 changes: 3 additions & 0 deletions recipes/fusepp/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"cci.20210820":
folder: all