blob: 62857f464dfc002fc1097bf002c51f5da3775f0f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
{
lib,
stdenv,
fetchFromGitHub,
nix-update-script,
nixosTests,
rustPlatform,
sonic-server,
testers,
}:
rustPlatform.buildRustPackage rec {
pname = "sonic-server";
version = "1.4.9";
src = fetchFromGitHub {
owner = "valeriansaliou";
repo = "sonic";
rev = "refs/tags/v${version}";
hash = "sha256-PTujR3ciLRvbpiqStNMx3W5fkUdW2dsGmCj/iFRTKJM=";
};
cargoHash = "sha256-bH9u38gvH6QEySQ3XFXEHBiSqKKtB+kjcZRLjx4Z6XM=";
nativeBuildInputs = [
rustPlatform.bindgenHook
];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-faligned-allocation";
postPatch = ''
substituteInPlace src/main.rs \
--replace-fail "./config.cfg" "$out/etc/sonic/config.cfg"
'';
postInstall = ''
install -Dm444 -t $out/etc/sonic config.cfg
install -Dm444 -t $out/lib/systemd/system debian/sonic.service
substituteInPlace $out/lib/systemd/system/sonic.service \
--replace-fail /usr/bin/sonic $out/bin/sonic \
--replace-fail /etc/sonic.cfg $out/etc/sonic/config.cfg
'';
# Found argument '--test-threads' which wasn't expected, or isn't valid in this context
doCheck = false;
passthru = {
tests = {
inherit (nixosTests) sonic-server;
version = testers.testVersion {
command = "sonic --version";
package = sonic-server;
};
};
updateScript = nix-update-script { };
};
meta = with lib; {
description = "Fast, lightweight and schema-less search backend";
homepage = "https://github.com/valeriansaliou/sonic";
changelog = "https://github.com/valeriansaliou/sonic/releases/tag/v${version}";
license = licenses.mpl20;
platforms = platforms.unix;
mainProgram = "sonic";
maintainers = with maintainers; [
pleshevskiy
anthonyroussel
];
};
}
|