rocksdb: add enableLiburing option

This commit is contained in:
Benjamin Lee
2024-06-18 12:29:43 -07:00
parent c9ab1fcb37
commit 65a6502a69
2 changed files with 35 additions and 0 deletions
@@ -11,6 +11,8 @@
, windows
, enableJemalloc ? false
, jemalloc
, enableLiburing ? true
, liburing
, enableShared ? !stdenv.hostPlatform.isStatic
, sse42Support ? stdenv.hostPlatform.sse4_2Support
}:
@@ -26,11 +28,14 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-Zifn5Gu/4h6TaEqSaWQ2mFdryeAarqbHWW3fKUGGFac=";
};
patches = [ ./fix-findliburing.patch ];
nativeBuildInputs = [ cmake ninja ];
propagatedBuildInputs = [ bzip2 lz4 snappy zlib zstd ];
buildInputs = lib.optional enableJemalloc jemalloc
++ lib.optional enableLiburing liburing
++ lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64_pthreads;
outputs = [
@@ -45,6 +50,7 @@ stdenv.mkDerivation (finalAttrs: {
cmakeFlags = [
"-DPORTABLE=1"
"-DWITH_JEMALLOC=${if enableJemalloc then "1" else "0"}"
"-DWITH_LIBURING=${if enableLiburing then "1" else "0"}"
"-DWITH_JNI=0"
"-DWITH_BENCHMARK_TOOLS=0"
"-DWITH_TESTS=1"
@@ -0,0 +1,29 @@
From 23432b7958ecea64b49ba680767ea5dc696768c9 Mon Sep 17 00:00:00 2001
From: Benjamin Lee <benjamin@computer.surgery>
Date: Sun, 26 May 2024 17:17:01 -0700
Subject: [PATCH] fix findliburing
`find_package(... NAMES lib*)` is basically always wrong. The previous
code was just hardcoding the static library path to work around the fact
that this doesn't work. This breaks the build when only dynamic liburing
builds are available.
---
cmake/modules/Finduring.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/modules/Finduring.cmake b/cmake/modules/Finduring.cmake
index 8cb14cb27..87f2df474 100644
--- a/cmake/modules/Finduring.cmake
+++ b/cmake/modules/Finduring.cmake
@@ -7,7 +7,7 @@
find_path(uring_INCLUDE_DIR
NAMES liburing.h)
find_library(uring_LIBRARIES
- NAMES liburing.a liburing)
+ NAMES uring)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(uring
--
2.44.0