nixpkgs/pkgs/servers/matrix-conduit/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.7 KiB
Nix
Raw Normal View History

2023-08-11 07:10:18 +01:00
{ lib
, rustPlatform
, fetchFromGitLab
, pkg-config
, sqlite
, stdenv
, darwin
, nixosTests
2024-04-25 16:13:48 +01:00
, rocksdb
, rust-jemalloc-sys
2023-08-11 07:10:18 +01:00
}:
2021-09-02 10:23:48 +01:00
rustPlatform.buildRustPackage rec {
pname = "matrix-conduit";
version = "0.8.0";
2021-09-02 10:23:48 +01:00
src = fetchFromGitLab {
owner = "famedly";
repo = "conduit";
rev = "v${version}";
hash = "sha256-/qKPeE2Ptweaf+rHOvdW0TUDLwN9D93MMgDoU4fTzEA=";
2021-09-02 10:23:48 +01: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 = {
"ruma-0.10.1" = "sha256-I1mTeJLo+pgIqFkn1D2De/oACQPkUELjGdyGf3MVuLQ=";
};
};
2023-01-20 00:40: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-04 20:04:21 +00:00
nativeBuildInputs = [
rustPlatform.bindgenHook
pkg-config
2022-02-04 20:04:21 +00:00
];
buildInputs = [
sqlite
rust-jemalloc-sys
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
2022-02-04 20:04:21 +00:00
];
2023-08-11 07:10:18 +01:00
env = {
2023-08-10 20:33:23 +01:00
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
2023-08-11 07:10:18 +01:00
};
# tests failed on x86_64-darwin with SIGILL: illegal instruction
doCheck = !(stdenv.isx86_64 && stdenv.isDarwin);
2021-09-02 10:23:48 +01:00
passthru.tests = {
inherit (nixosTests) matrix-conduit;
};
2021-09-02 10:23:48 +01:00
meta = with lib; {
description = "Matrix homeserver written in Rust";
homepage = "https://conduit.rs/";
license = licenses.asl20;
maintainers = with maintainers; [ pstn pimeys ];
mainProgram = "conduit";
2021-09-02 10:23:48 +01:00
};
}