2023-03-24 00:07:29 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitLab, pkg-config, sqlite, stdenv, darwin, nixosTests, rocksdb_6_23 }:
|
2022-01-03 16:56:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "matrix-conduit";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "0.5.0";
|
2022-01-03 16:56:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "famedly";
|
|
|
|
repo = "conduit";
|
|
|
|
rev = "v${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
sha256 = "sha256-GSCpmn6XRbmnfH31R9c6QW3/pez9KHPjI99dR+ln0P4=";
|
2022-01-03 16:56:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
# We have to use importCargoLock here because `cargo vendor` currently doesn't support workspace
|
|
|
|
# inheritance within Git dependencies, but importCargoLock does.
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"heed-0.10.6" = "sha256-rm02pJ6wGYN4SsAbp85jBVHDQ5ITjZZd+79EC2ubRsY=";
|
|
|
|
"reqwest-0.11.9" = "sha256-wH/q7REnkz30ENBIK5Rlxnc1F6vOyuEANMHFmiVPaGw=";
|
|
|
|
"ruma-0.7.4" = "sha256-ztobLdOXSGyK1YcPMMIycO3ZmnjxG5mLkHltf0Fbs8s=";
|
|
|
|
};
|
|
|
|
};
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
# Conduit enables rusqlite's bundled feature by default, but we'd rather use our copy of SQLite.
|
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace Cargo.toml --replace "features = [\"bundled\"]" "features = []"
|
|
|
|
cargo update --offline -p rusqlite
|
|
|
|
'';
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
nativeBuildInputs = [
|
2022-03-05 16:20:37 +00:00
|
|
|
rustPlatform.bindgenHook
|
2023-03-24 00:07:29 +00:00
|
|
|
pkg-config
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
buildInputs = [ sqlite ] ++ lib.optionals stdenv.isDarwin [
|
2022-12-28 21:21:41 +00:00
|
|
|
darwin.apple_sdk.frameworks.Security
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
ROCKSDB_INCLUDE_DIR = "${rocksdb_6_23}/include";
|
|
|
|
ROCKSDB_LIB_DIR = "${rocksdb_6_23}/lib";
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
# tests failed on x86_64-darwin with SIGILL: illegal instruction
|
|
|
|
doCheck = !(stdenv.isx86_64 && stdenv.isDarwin);
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) matrix-conduit;
|
|
|
|
};
|
2022-01-03 16:56:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A Matrix homeserver written in Rust";
|
|
|
|
homepage = "https://conduit.rs/";
|
|
|
|
license = licenses.asl20;
|
2022-02-10 20:34:41 +00:00
|
|
|
maintainers = with maintainers; [ pstn piegames pimeys ];
|
2022-12-28 21:21:41 +00:00
|
|
|
mainProgram = "conduit";
|
2022-01-03 16:56:52 +00:00
|
|
|
};
|
|
|
|
}
|