mirror of
				https://github.com/Xahau/xahaud.git
				synced 2025-11-04 10:45:50 +00:00 
			
		
		
		
	Housekeeping (#170)
* Update pull_request_template.md * strip out unused files * Update CONTRIBUTING.md * fix docker * remove conan stuff * update license * update hook directory * Delete .codecov.yml * Update .dockerignore * Update genesis.json * update validator list example * Update rippled-standalone.cfg * Update CONTRIBUTING.md
This commit is contained in:
		
							
								
								
									
										16
									
								
								external/snappy/conandata.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								external/snappy/conandata.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,16 +0,0 @@
 | 
			
		||||
sources:
 | 
			
		||||
  "1.1.9":
 | 
			
		||||
    url: "https://github.com/google/snappy/archive/1.1.9.tar.gz"
 | 
			
		||||
    sha256: "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7"
 | 
			
		||||
  "1.1.8":
 | 
			
		||||
    url: "https://github.com/google/snappy/archive/1.1.8.tar.gz"
 | 
			
		||||
    sha256: "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f"
 | 
			
		||||
  "1.1.7":
 | 
			
		||||
    url: "https://github.com/google/snappy/archive/1.1.7.tar.gz"
 | 
			
		||||
    sha256: "3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4"
 | 
			
		||||
patches:
 | 
			
		||||
  "1.1.9":
 | 
			
		||||
    - patch_file: "patches/1.1.9-0001-fix-inlining-failure.patch"
 | 
			
		||||
    - patch_file: "patches/1.1.9-0002-no-Werror.patch"
 | 
			
		||||
    - patch_file: "patches/1.1.9-0003-fix-clobber-list-older-llvm.patch"
 | 
			
		||||
    - patch_file: "patches/1.1.9-0004-rtti-by-default.patch"
 | 
			
		||||
							
								
								
									
										89
									
								
								external/snappy/conanfile.py
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										89
									
								
								external/snappy/conanfile.py
									
									
									
									
										vendored
									
									
								
							@@ -1,89 +0,0 @@
 | 
			
		||||
from conan import ConanFile
 | 
			
		||||
from conan.tools.build import check_min_cppstd
 | 
			
		||||
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
 | 
			
		||||
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
 | 
			
		||||
from conan.tools.scm import Version
 | 
			
		||||
import os
 | 
			
		||||
 | 
			
		||||
required_conan_version = ">=1.54.0"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class SnappyConan(ConanFile):
 | 
			
		||||
    name = "snappy"
 | 
			
		||||
    description = "A fast compressor/decompressor"
 | 
			
		||||
    topics = ("google", "compressor", "decompressor")
 | 
			
		||||
    url = "https://github.com/conan-io/conan-center-index"
 | 
			
		||||
    homepage = "https://github.com/google/snappy"
 | 
			
		||||
    license = "BSD-3-Clause"
 | 
			
		||||
 | 
			
		||||
    package_type = "library"
 | 
			
		||||
    settings = "os", "arch", "compiler", "build_type"
 | 
			
		||||
    options = {
 | 
			
		||||
        "shared": [True, False],
 | 
			
		||||
        "fPIC": [True, False],
 | 
			
		||||
    }
 | 
			
		||||
    default_options = {
 | 
			
		||||
        "shared": False,
 | 
			
		||||
        "fPIC": True,
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    def export_sources(self):
 | 
			
		||||
        export_conandata_patches(self)
 | 
			
		||||
 | 
			
		||||
    def config_options(self):
 | 
			
		||||
        if self.settings.os == 'Windows':
 | 
			
		||||
            del self.options.fPIC
 | 
			
		||||
 | 
			
		||||
    def configure(self):
 | 
			
		||||
        if self.options.shared:
 | 
			
		||||
            self.options.rm_safe("fPIC")
 | 
			
		||||
 | 
			
		||||
    def layout(self):
 | 
			
		||||
        cmake_layout(self, src_folder="src")
 | 
			
		||||
 | 
			
		||||
    def validate(self):
 | 
			
		||||
        if self.settings.compiler.get_safe("cppstd"):
 | 
			
		||||
            check_min_cppstd(self, 11)
 | 
			
		||||
 | 
			
		||||
    def source(self):
 | 
			
		||||
        get(self, **self.conan_data["sources"][self.version], strip_root=True)
 | 
			
		||||
 | 
			
		||||
    def generate(self):
 | 
			
		||||
        tc = CMakeToolchain(self)
 | 
			
		||||
        tc.variables["SNAPPY_BUILD_TESTS"] = False
 | 
			
		||||
        if Version(self.version) >= "1.1.8":
 | 
			
		||||
            tc.variables["SNAPPY_FUZZING_BUILD"] = False
 | 
			
		||||
            tc.variables["SNAPPY_REQUIRE_AVX"] = False
 | 
			
		||||
            tc.variables["SNAPPY_REQUIRE_AVX2"] = False
 | 
			
		||||
            tc.variables["SNAPPY_INSTALL"] = True
 | 
			
		||||
        if Version(self.version) >= "1.1.9":
 | 
			
		||||
            tc.variables["SNAPPY_BUILD_BENCHMARKS"] = False
 | 
			
		||||
        tc.generate()
 | 
			
		||||
 | 
			
		||||
    def build(self):
 | 
			
		||||
        apply_conandata_patches(self)
 | 
			
		||||
        cmake = CMake(self)
 | 
			
		||||
        cmake.configure()
 | 
			
		||||
        cmake.build()
 | 
			
		||||
 | 
			
		||||
    def package(self):
 | 
			
		||||
        copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
 | 
			
		||||
        cmake = CMake(self)
 | 
			
		||||
        cmake.install()
 | 
			
		||||
        rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
 | 
			
		||||
 | 
			
		||||
    def package_info(self):
 | 
			
		||||
        self.cpp_info.set_property("cmake_file_name", "Snappy")
 | 
			
		||||
        self.cpp_info.set_property("cmake_target_name", "Snappy::snappy")
 | 
			
		||||
        # TODO: back to global scope in conan v2 once cmake_find_package* generators removed
 | 
			
		||||
        self.cpp_info.components["snappylib"].libs = ["snappy"]
 | 
			
		||||
        if not self.options.shared:
 | 
			
		||||
            if self.settings.os in ["Linux", "FreeBSD"]:
 | 
			
		||||
                self.cpp_info.components["snappylib"].system_libs.append("m")
 | 
			
		||||
 | 
			
		||||
        # TODO: to remove in conan v2 once cmake_find_package* generators removed
 | 
			
		||||
        self.cpp_info.names["cmake_find_package"] = "Snappy"
 | 
			
		||||
        self.cpp_info.names["cmake_find_package_multi"] = "Snappy"
 | 
			
		||||
        self.cpp_info.components["snappylib"].names["cmake_find_package"] = "snappy"
 | 
			
		||||
        self.cpp_info.components["snappylib"].names["cmake_find_package_multi"] = "snappy"
 | 
			
		||||
        self.cpp_info.components["snappylib"].set_property("cmake_target_name", "Snappy::snappy")
 | 
			
		||||
@@ -1,14 +0,0 @@
 | 
			
		||||
Fixes the following error:
 | 
			
		||||
error: inlining failed in call to ‘always_inline’ ‘size_t snappy::AdvanceToNextTag(const uint8_t**, size_t*)’: function body can be overwritten at link time
 | 
			
		||||
 | 
			
		||||
--- snappy-stubs-internal.h
 | 
			
		||||
+++ snappy-stubs-internal.h
 | 
			
		||||
@@ -100,7 +100,7 @@
 | 
			
		||||
 
 | 
			
		||||
 // Inlining hints.
 | 
			
		||||
 #ifdef HAVE_ATTRIBUTE_ALWAYS_INLINE
 | 
			
		||||
-#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
 | 
			
		||||
+#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE
 | 
			
		||||
 #else
 | 
			
		||||
 #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE
 | 
			
		||||
 #endif
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
--- CMakeLists.txt
 | 
			
		||||
+++ CMakeLists.txt
 | 
			
		||||
@@ -69,7 +69,7 @@
 | 
			
		||||
-  # Use -Werror for clang only.
 | 
			
		||||
+if(0)
 | 
			
		||||
   if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 | 
			
		||||
     if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
 | 
			
		||||
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
 | 
			
		||||
     endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
 | 
			
		||||
   endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 | 
			
		||||
-
 | 
			
		||||
+endif()
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
asm clobbers do not work for clang < 9 and apple-clang < 11 (found by SpaceIm)
 | 
			
		||||
--- snappy.cc
 | 
			
		||||
+++ snappy.cc
 | 
			
		||||
@@ -1026,7 +1026,7 @@
 | 
			
		||||
   size_t literal_len = *tag >> 2;
 | 
			
		||||
   size_t tag_type = *tag;
 | 
			
		||||
   bool is_literal;
 | 
			
		||||
-#if defined(__GNUC__) && defined(__x86_64__)
 | 
			
		||||
+#if defined(__GNUC__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) )
 | 
			
		||||
   // TODO clang misses the fact that the (c & 3) already correctly
 | 
			
		||||
   // sets the zero flag.
 | 
			
		||||
   asm("and $3, %k[tag_type]\n\t"
 | 
			
		||||
@@ -1,20 +0,0 @@
 | 
			
		||||
--- a/CMakeLists.txt
 | 
			
		||||
+++ b/CMakeLists.txt
 | 
			
		||||
@@ -53,8 +53,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
 | 
			
		||||
   add_definitions(-D_HAS_EXCEPTIONS=0)
 | 
			
		||||
 
 | 
			
		||||
   # Disable RTTI.
 | 
			
		||||
-  string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 | 
			
		||||
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
 | 
			
		||||
 else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
 | 
			
		||||
   # Use -Wall for clang and gcc.
 | 
			
		||||
   if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
 | 
			
		||||
@@ -78,8 +76,6 @@ endif()
 | 
			
		||||
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
 | 
			
		||||
 
 | 
			
		||||
   # Disable RTTI.
 | 
			
		||||
-  string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 | 
			
		||||
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
 | 
			
		||||
 endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
 | 
			
		||||
 
 | 
			
		||||
 # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make
 | 
			
		||||
		Reference in New Issue
	
	Block a user