summary refs log tree commit diff
path: root/pkgs/development/libraries/liblinphone/default.nix
blob: 33220f193b597e7629082a04eb397833073fc0b5 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{ bctoolbox
, belcard
, belle-sip
, belr
, cmake
, doxygen
, fetchFromGitLab
, jsoncpp
, libxml2
, lime
, mediastreamer
, python3
, bc-soci
, sqlite
, lib
, stdenv
, xercesc
, zxing-cpp
}:

stdenv.mkDerivation rec {
  pname = "liblinphone";
  version = "5.2.98";

  src = fetchFromGitLab {
    domain = "gitlab.linphone.org";
    owner = "public";
    group = "BC";
    repo = pname;
    rev = version;
    hash = "sha256-kQZePMa7MTaSJLEObM8khfSFYLqhlgTcVyKfTPLwKYU=";
  };

  postPatch = ''
    substituteInPlace src/CMakeLists.txt \
      --replace "jsoncpp_object" "jsoncpp" \
      --replace "jsoncpp_static" "jsoncpp"
  '';

  cmakeFlags = [
    "-DENABLE_STATIC=NO" # Do not build static libraries
    "-DENABLE_UNIT_TESTS=NO" # Do not build test executables
    "-DENABLE_STRICT=NO" # Do not build with -Werror
  ];

  buildInputs = [
    # Made by BC
    belcard
    belle-sip
    lime
    mediastreamer

    # Vendored by BC
    bc-soci

    jsoncpp
    libxml2
    (python3.withPackages (ps: [ ps.pystache ps.six ]))
    sqlite
    xercesc
    zxing-cpp
  ];

  nativeBuildInputs = [
    cmake
    doxygen
  ];

  strictDeps = true;

  # Some grammar files needed to be copied too from some dependencies. I suppose
  # if one define a dependency in such a way that its share directory is found,
  # then this copying would be unnecessary. Instead of actually copying these
  # files, create a symlink.
  postInstall = ''
    mkdir -p $out/share/belr/grammars
    ln -s ${belcard}/share/belr/grammars/* $out/share/belr/grammars/
  '';

  meta = with lib; {
    homepage = "https://www.linphone.org/technical-corner/liblinphone";
    description = "Library for SIP calls and instant messaging";
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ jluttine ];
  };
}