mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: patchelf binary to link to correct rocksdb
This commit is contained in:
+24
-11
@@ -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
|
||||||
|
];
|
||||||
|
env = {
|
||||||
|
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
|
||||||
|
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoArtifacts = craneLib.buildDepsOnly common;
|
cargoArtifacts = craneLib.buildDepsOnly attrs;
|
||||||
|
|
||||||
rocksdb = pkgs.callPackage ./rocksdb.nix { };
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = craneLib.buildPackage (
|
default = craneLib.buildPackage (
|
||||||
lib.recursiveUpdate common {
|
lib.recursiveUpdate attrs {
|
||||||
inherit cargoArtifacts;
|
inherit cargoArtifacts;
|
||||||
env = {
|
|
||||||
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
|
# Needed to make continuwuity link to rocksdb
|
||||||
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
|
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";
|
||||||
|
|||||||
Reference in New Issue
Block a user