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