Skip to content

Commit

Permalink
(#9652) xxhash: add version 0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
toge authored Mar 10, 2022
1 parent 9252f3d commit a40fa78
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
7 changes: 7 additions & 0 deletions recipes/xxhash/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
sources:
"0.8.1":
url: "https://github.com/Cyan4973/xxHash/archive/v0.8.1.tar.gz"
sha256: "3bb6b7d6f30c591dd65aaaff1c8b7a5b94d81687998ca9400082c739a690436c"
"0.8.0":
url: "https://github.com/Cyan4973/xxHash/archive/v0.8.0.tar.gz"
sha256: "7054c3ebd169c97b64a92d7b994ab63c70dd53a06974f1f630ab782c28db0f4f"
patches:
"0.8.1":
- patch_file: "patches/0.8.1-fix-cmakelists.patch"
base_path: "source_subfolder"
9 changes: 8 additions & 1 deletion recipes/xxhash/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ class XxHashConan(ConanFile):
}

generators = "cmake"
exports_sources = "CMakeLists.txt"
_cmake = None

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

def export_sources(self):
self.copy("CMakeLists.txt")
for patch in self.conan_data.get("patches", {}).get(self.version, []):
self.copy(patch["patch_file"])

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand Down Expand Up @@ -59,6 +63,8 @@ def _configure_cmake(self):
return self._cmake

def build(self):
for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.patch(**patch)
cmake = self._configure_cmake()
cmake.build()

Expand All @@ -67,6 +73,7 @@ def package(self):
cmake = self._configure_cmake()
cmake.install()
tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
tools.rmdir(os.path.join(self.package_folder, "share"))

def package_info(self):
Expand Down
13 changes: 13 additions & 0 deletions recipes/xxhash/all/patches/0.8.1-fix-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt
index d5456b0..aca3d1f 100644
--- a/cmake_unofficial/CMakeLists.txt
+++ b/cmake_unofficial/CMakeLists.txt
@@ -122,7 +122,7 @@ if(NOT XXHASH_BUNDLED_MODE)
install(TARGETS xxhsum
EXPORT xxHashTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
- install(FILES "${XXHASH_DIR}/xxhsum.1"
+ install(FILES "${XXHSUM_DIR}/xxhsum.1"
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
endif(XXHASH_BUILD_XXHSUM)

2 changes: 2 additions & 0 deletions recipes/xxhash/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"0.8.1":
folder: all
"0.8.0":
folder: all

0 comments on commit a40fa78

Please sign in to comment.