fix: patchelf binary to link to correct rocksdb

This commit is contained in:
Henry-Hiles
2026-04-07 20:41:19 +00:00
committed by Henry Hiles
parent 3d9fd34012
commit 7643b64f60
+26 -13
View File
@@ -27,28 +27,41 @@
name = "source"; name = "source";
}; };
common = { rocksdb = pkgs.callPackage ./rocksdb.nix { };
attrs = {
inherit src; inherit src;
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
pkg-config pkg-config
rustPlatform.bindgenHook rustPlatform.bindgenHook
]; ];
buildInputs = [ pkgs.liburing ]; buildInputs = [
env.LIBCLANG_PATH = lib.makeLibraryPath [ pkgs.llvmPackages.libclang.lib ]; pkgs.liburing
}; ];
cargoArtifacts = craneLib.buildDepsOnly common;
rocksdb = pkgs.callPackage ./rocksdb.nix { };
in
{
default = craneLib.buildPackage (
lib.recursiveUpdate common {
inherit cargoArtifacts;
env = { env = {
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include"; ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
ROCKSDB_LIB_DIR = "${rocksdb}/lib"; ROCKSDB_LIB_DIR = "${rocksdb}/lib";
}; };
};
cargoArtifacts = craneLib.buildDepsOnly attrs;
in
{
default = craneLib.buildPackage (
lib.recursiveUpdate attrs {
inherit cargoArtifacts;
# Needed to make continuwuity link to rocksdb
postFixup = ''
old_rpath="$(patchelf --print-rpath $out/bin/conduwuit)"
extra_rpath="${
pkgs.lib.makeLibraryPath [
pkgs.rocksdb
]
}"
patchelf --set-rpath "$old_rpath:$extra_rpath" $out/bin/conduwuit
'';
meta = { meta = {
description = "A community-driven Matrix homeserver in Rust"; description = "A community-driven Matrix homeserver in Rust";