about summary refs log tree commit diff
path: root/pkgs/servers/ursadb/default.nix
blob: c9b39eccd8a817ffca45373e795aa1ddc9b61c1e (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
{ lib, stdenv, fetchFromGitHub, cmake, zeromq, cppzmq }:

stdenv.mkDerivation rec {
  pname = "ursadb";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "CERT-Polska";
    repo = "ursadb";
    rev = "v${version}";
    hash = "sha256-/EK1CKJ0IR7fkKSpQkONbWcz6uhUoAwK430ljNYsV5U=";
  };

  postPatch = ''
    substituteInPlace CMakeLists.txt \
      --replace \
        "add_executable(ursadb_test Tests.cpp)" "" \
      --replace \
        "target_link_libraries(ursadb_test ursa)" ""
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp ursadb $out/bin/
    cp ursadb_new $out/bin/
    cp ursadb_trim $out/bin/
  '';

  nativeBuildInputs = [
    cmake
  ];

  buildInputs = [
    zeromq
    cppzmq
  ];

  meta = with lib; {
    homepage = "https://github.com/CERT-Polska/ursadb";
    description = "Trigram database written in C++, suited for malware indexing";
    license = licenses.bsd3;
    maintainers = with maintainers; [ msm ];
    platforms = platforms.unix;
    broken = stdenv.isDarwin;
  };
}