feat: Use rocksdb fork

This commit is contained in:
Shuroii 2025-07-01 20:00:07 +02:00 committed by Shuroii
commit e9bc416b29
2 changed files with 49 additions and 16 deletions

View file

@ -15,6 +15,10 @@
flake-utils.url = "github:numtide/flake-utils?ref=main";
nix-filter.url = "github:numtide/nix-filter?ref=main";
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable";
rocksdb = {
url = "git+https://forgejo.ellis.link/continuwuation/rocksdb?ref=v9.11.1";
flake = false;
};
};
outputs =
@ -50,11 +54,12 @@
buildFlags = [ "library" ];
};
rocksdb = pkgs.rocksdb_9_10.overrideAttrs (oldAttrs: {
# I'm sure there's a really good reason to use the fork, but it fails to build, so we use nixpkgs instead
# src = inputs.rocksdb;
version = "v9.11.1";
src = inputs.rocksdb;
# We have this already at https://forgejo.ellis.link/continuwuation/rocksdb/commit/a935c0273e1ba44eacf88ce3685a9b9831486155
# Unsetting this so we don't have to revert it and make this nix exclusive
# patches = [ ];
patches = [ ];
cmakeFlags =
pkgs.lib.subtractLists [
@ -88,19 +93,29 @@
# We use rust-rocksdb via C interface and don't need C++ RTTI
"-DUSE_RTTI=0"
];
propagatedBuildInputs = with pkgs; [
bzip2
lz4
zstd
];
# Has "tools" which we don't need or use
outputs = [ "out" ];
# preInstall hooks has stuff for messing with ldb/sst_dump which we don't need or use
preInstall = "";
#
postPatch = ''
# Fix gcc-13 build failures due to missing <cstdint> and
# <system_error> includes, fixed upstyream sice 8.x
sed -e '1i #include <cstdint>' -i db/compaction/compaction_iteration_stats.h
sed -e '1i #include <cstdint>' -i table/block_based/data_block_hash_index.h
sed -e '1i #include <cstdint>' -i util/string_util.h
sed -e '1i #include <cstdint>' -i include/rocksdb/utilities/checkpoint.h
'';
});
propagatedBuildInputs = with pkgs; [
bzip2
lz4
zstd
];
# Has "tools" which we don't need or use
outputs = [ "out" ];
# preInstall hooks has stuff for messing with ldb/sst_dump which we don't need or use
preInstall = "";
});
scopeHost = mkScope pkgsHost;