Repository: conan-io/conan-center-index

Issue:
[request] glob/0.0.1
### Package Details
  * Package Name/Version: **glob/0.0.1**
  * Website: **https://github.com/p-ranav/glob/blob/master/README.md**
  * Source code: **https://github.com/p-ranav/glob**


### Description Of The Library / Tool
Glob for C++17. Unix-style pathname pattern expansion.


Discussion:
Waiting for the release https://github.com/p-ranav/glob/issues/7

Resolving patch:
diff --git a/recipes/p-ranav-glob/all/conanfile.py b/recipes/p-ranav-glob/all/conanfile.py
new file mode 100644
--- /dev/null
+++ b/recipes/p-ranav-glob/all/conanfile.py
@@ -0,0 +1,50 @@
+import os
+from conans import ConanFile, tools
+from conans.errors import ConanInvalidConfiguration
+
+required_conan_version = ">=1.33.0"
+
+
+class PRanavGlobConan(ConanFile):
+    name = "p-ranav-glob"
+    license = "MIT"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://github.com/p-ranav/glob"
+    description = "Glob for C++17"
+    topics = ("c++17", "config", "filesystem", "header-only")
+    settings = "compiler"
+    no_copy_source = True
+
+    @property
+    def _source_subfolder(self):
+        return "source_subfolder"
+
+    @property
+    def _compilers_minimum_version(self):
+        return {
+            "gcc": "9",
+            "Visual Studio": "15.7",
+            "clang": "7",
+            "apple-clang": "11",
+        }
+
+    def configure(self):
+        if self.settings.compiler.cppstd:
+            tools.check_min_cppstd(self, 17)
+        minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
+        if minimum_version:
+            if tools.Version(self.settings.compiler.version) < minimum_version:
+                raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name))
+        else:
+            self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name))
+
+    def package_id(self):
+        self.info.header_only()
+
+    def source(self):
+        tools.get(**self.conan_data["sources"][self.version],
+                  destination=self._source_subfolder, strip_root=True)
+
+    def package(self):
+        self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
+        self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "single_include"))


Test patch:
diff --git a/recipes/p-ranav-glob/all/test_package/CMakeLists.txt b/recipes/p-ranav-glob/all/test_package/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/recipes/p-ranav-glob/all/test_package/CMakeLists.txt
@@ -0,0 +1,9 @@
+cmake_minimum_required(VERSION 3.8)
+project(test_package CXX)
+
+include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
+conan_basic_setup()
+
+add_executable(${PROJECT_NAME} test_package.cpp)
+target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
+set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
diff --git a/recipes/p-ranav-glob/all/test_package/conanfile.py b/recipes/p-ranav-glob/all/test_package/conanfile.py
new file mode 100644
--- /dev/null
+++ b/recipes/p-ranav-glob/all/test_package/conanfile.py
@@ -0,0 +1,16 @@
+from conans import ConanFile, CMake, tools
+import os
+
+class TestPackageConan(ConanFile):
+    settings = "os", "compiler", "build_type", "arch"
+    generators = "cmake"
+
+    def build(self):
+        cmake = CMake(self)
+        cmake.configure()
+        cmake.build()
+
+    def test(self):
+        if not tools.cross_building(self.settings):
+            bin_path = os.path.join("bin", "test_package")
+            self.run(bin_path, run_environment=True)
diff --git a/recipes/p-ranav-glob/all/test_package/test_package.cpp b/recipes/p-ranav-glob/all/test_package/test_package.cpp
new file mode 100644
--- /dev/null
+++ b/recipes/p-ranav-glob/all/test_package/test_package.cpp
@@ -0,0 +1,8 @@
+#include <iostream>
+#include <glob/glob.hpp>
+
+int main()
+{
+  glob::glob("");
+  return 0;
+}