aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/rocksdb
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/rocksdb')
-rw-r--r--vcpkg/ports/rocksdb/0001-fix-dependencies.patch122
-rw-r--r--vcpkg/ports/rocksdb/0002-fix-android.patch16
-rw-r--r--vcpkg/ports/rocksdb/0003-include_cstdint.patch12
-rw-r--r--vcpkg/ports/rocksdb/portfile.cmake71
-rw-r--r--vcpkg/ports/rocksdb/vcpkg.json79
5 files changed, 300 insertions, 0 deletions
diff --git a/vcpkg/ports/rocksdb/0001-fix-dependencies.patch b/vcpkg/ports/rocksdb/0001-fix-dependencies.patch
new file mode 100644
index 0000000..510d2b4
--- /dev/null
+++ b/vcpkg/ports/rocksdb/0001-fix-dependencies.patch
@@ -0,0 +1,122 @@
+ CMakeLists.txt | 33 +++++++++++++++------------------
+ cmake/RocksDBConfig.cmake.in | 11 ++++++++---
+ 2 files changed, 23 insertions(+), 21 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5cfc1b480..a18af5817 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -82,7 +82,7 @@ endif()
+
+ include(CMakeDependentOption)
+
+-if(MSVC)
++if(0)
+ option(WITH_GFLAGS "build with GFlags" OFF)
+ option(WITH_XPRESS "build with windows built in compression" OFF)
+ option(ROCKSDB_SKIP_THIRDPARTY "skip thirdparty.inc" OFF)
+@@ -131,10 +131,7 @@ else()
+ endif()
+
+ if(WITH_SNAPPY)
+- find_package(Snappy CONFIG)
+- if(NOT Snappy_FOUND)
+- find_package(Snappy REQUIRED)
+- endif()
++ find_package(Snappy CONFIG REQUIRED)
+ add_definitions(-DSNAPPY)
+ list(APPEND THIRDPARTY_LIBS Snappy::snappy)
+ endif()
+@@ -158,16 +155,19 @@ else()
+ endif()
+
+ if(WITH_LZ4)
+- find_package(lz4 REQUIRED)
++ find_package(lz4 CONFIG REQUIRED)
+ add_definitions(-DLZ4)
+ list(APPEND THIRDPARTY_LIBS lz4::lz4)
+ endif()
+
+ if(WITH_ZSTD)
+- find_package(zstd REQUIRED)
++ find_package(zstd CONFIG REQUIRED)
+ add_definitions(-DZSTD)
+- include_directories(${ZSTD_INCLUDE_DIRS})
+- list(APPEND THIRDPARTY_LIBS zstd::zstd)
++ if(TARGET zstd::libzstd_shared)
++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_shared)
++ elseif(TARGET zstd::libzstd_static)
++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_static)
++ endif()
+ endif()
+ endif()
+
+@@ -307,11 +307,10 @@ int main() {
+ endif()
+
+ if (WITH_LIBURING)
+- find_package(uring)
+- if (uring_FOUND)
+- add_definitions(-DROCKSDB_IOURING_PRESENT)
+- list(APPEND THIRDPARTY_LIBS uring::uring)
+- endif()
++ find_package(PkgConfig)
++ pkg_check_modules(liburing REQUIRED IMPORTED_TARGET GLOBAL liburing>=2.0)
++ add_definitions(-DROCKSDB_IOURING_PRESENT)
++ list(APPEND THIRDPARTY_LIBS PkgConfig::liburing)
+ endif()
+
+ # Reset the required flags
+@@ -377,9 +376,9 @@ endif()
+
+ option(WITH_TBB "build with Threading Building Blocks (TBB)" OFF)
+ if(WITH_TBB)
+- find_package(TBB REQUIRED)
++ find_package(TBB CONFIG REQUIRED)
+ add_definitions(-DTBB)
+- list(APPEND THIRDPARTY_LIBS TBB::TBB)
++ list(APPEND THIRDPARTY_LIBS TBB::tbb)
+ endif()
+
+ # Stall notifications eat some performance from inserts
+@@ -1197,8 +1196,6 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS)
+ endforeach()
+ endforeach()
+
+- install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination})
+-
+ install(
+ TARGETS ${ROCKSDB_STATIC_LIB}
+ EXPORT RocksDBTargets
+diff --git a/cmake/RocksDBConfig.cmake.in b/cmake/RocksDBConfig.cmake.in
+index 0bd14be11..a420d8bfe 100644
+--- a/cmake/RocksDBConfig.cmake.in
++++ b/cmake/RocksDBConfig.cmake.in
+@@ -33,11 +33,11 @@ if(@WITH_BZ2@)
+ endif()
+
+ if(@WITH_LZ4@)
+- find_dependency(lz4)
++ find_dependency(lz4 CONFIG)
+ endif()
+
+ if(@WITH_ZSTD@)
+- find_dependency(zstd)
++ find_dependency(zstd CONFIG)
+ endif()
+
+ if(@WITH_NUMA@)
+@@ -45,7 +45,12 @@ if(@WITH_NUMA@)
+ endif()
+
+ if(@WITH_TBB@)
+- find_dependency(TBB)
++ find_dependency(TBB CONFIG)
++endif()
++
++if(@WITH_LIBURING@)
++ find_dependency(PkgConfig)
++ pkg_check_modules(liburing REQUIRED IMPORTED_TARGET GLOBAL liburing>=2.0)
+ endif()
+
+ find_dependency(Threads)
diff --git a/vcpkg/ports/rocksdb/0002-fix-android.patch b/vcpkg/ports/rocksdb/0002-fix-android.patch
new file mode 100644
index 0000000..3fbf0d8
--- /dev/null
+++ b/vcpkg/ports/rocksdb/0002-fix-android.patch
@@ -0,0 +1,16 @@
+ env/io_posix.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/env/io_posix.h b/env/io_posix.h
+index 60788df9b..8ddfb3456 100644
+--- a/env/io_posix.h
++++ b/env/io_posix.h
+@@ -30,7 +30,7 @@
+ // For non linux platform, the following macros are used only as place
+ // holder.
+ #if !(defined OS_LINUX) && !(defined OS_FREEBSD) && !(defined CYGWIN) && \
+- !(defined OS_AIX) && !(defined OS_ANDROID)
++ !(defined OS_AIX) && !(defined OS_ANDROID && __ANDROID_API__ >= 23)
+ #define POSIX_FADV_NORMAL 0 /* [MC1] no further special treatment */
+ #define POSIX_FADV_RANDOM 1 /* [MC1] expect random page refs */
+ #define POSIX_FADV_SEQUENTIAL 2 /* [MC1] expect sequential page refs */
diff --git a/vcpkg/ports/rocksdb/0003-include_cstdint.patch b/vcpkg/ports/rocksdb/0003-include_cstdint.patch
new file mode 100644
index 0000000..d25d751
--- /dev/null
+++ b/vcpkg/ports/rocksdb/0003-include_cstdint.patch
@@ -0,0 +1,12 @@
+diff --git a/db/blob/blob_file_meta.h b/db/blob/blob_file_meta.h
+index d7c8a12..d688825 100644
+--- a/db/blob/blob_file_meta.h
++++ b/db/blob/blob_file_meta.h
+@@ -10,6 +10,7 @@
+ #include <memory>
+ #include <string>
+ #include <unordered_set>
++#include <cstdint>
+
+ #include "rocksdb/rocksdb_namespace.h"
+
diff --git a/vcpkg/ports/rocksdb/portfile.cmake b/vcpkg/ports/rocksdb/portfile.cmake
new file mode 100644
index 0000000..e10fefa
--- /dev/null
+++ b/vcpkg/ports/rocksdb/portfile.cmake
@@ -0,0 +1,71 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO facebook/rocksdb
+ REF "v${VERSION}"
+ SHA512 e4665fc0491978c71b0aa4a49dccaa342621de59272af4c4015c6f7425cd7985fa9de54cea8a2bd2f8d04538a5777a6caaf77371fef8e36cbbccc13b0c71315d
+ HEAD_REF main
+ PATCHES
+ 0001-fix-dependencies.patch
+ 0002-fix-android.patch
+ # TODO: This patch should be deleted after following PR will be merged. https://github.com/facebook/rocksdb/pull/13573
+ 0003-include_cstdint.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_MD_LIBRARY)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ROCKSDB_BUILD_SHARED)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ "liburing" WITH_LIBURING
+ "snappy" WITH_SNAPPY
+ "lz4" WITH_LZ4
+ "zlib" WITH_ZLIB
+ "zstd" WITH_ZSTD
+ "bzip2" WITH_BZ2
+ "numa" WITH_NUMA
+ "tbb" WITH_TBB
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DWITH_GFLAGS=OFF
+ -DWITH_TESTS=OFF
+ -DWITH_BENCHMARK_TOOLS=OFF
+ -DWITH_TOOLS=OFF
+ -DUSE_RTTI=ON
+ -DROCKSDB_INSTALL_ON_WINDOWS=ON
+ -DFAIL_ON_WARNINGS=OFF
+ -DWITH_MD_LIBRARY=${WITH_MD_LIBRARY}
+ -DPORTABLE=1 # Minimum CPU arch to support, or 0 = current CPU, 1 = baseline CPU
+ -DROCKSDB_BUILD_SHARED=${ROCKSDB_BUILD_SHARED}
+ -DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE
+ ${FEATURE_OPTIONS}
+ OPTIONS_DEBUG
+ -DCMAKE_DEBUG_POSTFIX=d
+ -DWITH_RUNTIME_DEBUG=ON
+ OPTIONS_RELEASE
+ -DWITH_RUNTIME_DEBUG=OFF
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/rocksdb)
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_fixup_pkgconfig()
+
+vcpkg_install_copyright(COMMENT [[
+RocksDB is dual-licensed under both the GPLv2 (found in COPYING)
+and Apache 2.0 License (found in LICENSE.Apache). You may select,
+at your option, one of the above-listed licenses.
+]]
+ FILE_LIST
+ "${SOURCE_PATH}/LICENSE.leveldb"
+ "${SOURCE_PATH}/LICENSE.Apache"
+ "${SOURCE_PATH}/COPYING"
+)
diff --git a/vcpkg/ports/rocksdb/vcpkg.json b/vcpkg/ports/rocksdb/vcpkg.json
new file mode 100644
index 0000000..fafe677
--- /dev/null
+++ b/vcpkg/ports/rocksdb/vcpkg.json
@@ -0,0 +1,79 @@
+{
+ "name": "rocksdb",
+ "version": "10.4.2",
+ "description": "A library that provides an embeddable, persistent key-value store for fast storage",
+ "homepage": "https://github.com/facebook/rocksdb",
+ "license": "GPL-2.0-only OR Apache-2.0",
+ "supports": "!uwp & !(arm & !arm64 & android)",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ "zlib"
+ ],
+ "features": {
+ "bzip2": {
+ "description": "build with bzip2",
+ "dependencies": [
+ "bzip2"
+ ]
+ },
+ "liburing": {
+ "description": "build with liburing",
+ "supports": "linux",
+ "dependencies": [
+ {
+ "name": "liburing",
+ "platform": "linux"
+ }
+ ]
+ },
+ "lz4": {
+ "description": "build with lz4",
+ "dependencies": [
+ "lz4"
+ ]
+ },
+ "numa": {
+ "description": "build with NUMA policy support",
+ "supports": "linux",
+ "dependencies": [
+ {
+ "name": "numactl",
+ "platform": "linux"
+ }
+ ]
+ },
+ "snappy": {
+ "description": "build with SNAPPY",
+ "dependencies": [
+ "snappy"
+ ]
+ },
+ "tbb": {
+ "description": "build with Threading Building Blocks (TBB)",
+ "dependencies": [
+ "tbb"
+ ]
+ },
+ "zlib": {
+ "description": "build with zlib",
+ "dependencies": [
+ "zlib"
+ ]
+ },
+ "zstd": {
+ "description": "build with zstd",
+ "dependencies": [
+ "zstd"
+ ]
+ }
+ }
+}