1{ bctoolbox
2, belcard
3, belle-sip
4, belr
5, cmake
6, doxygen
7, fetchFromGitLab
8, jsoncpp
9, libxml2
10, lime
11, mediastreamer
12, python3
13, bc-soci
14, sqlite
15, lib
16, stdenv
17, xercesc
18, zxing-cpp
19}:
20
21stdenv.mkDerivation rec {
22 pname = "liblinphone";
23 version = "5.2.17";
24
25 src = fetchFromGitLab {
26 domain = "gitlab.linphone.org";
27 owner = "public";
28 group = "BC";
29 repo = pname;
30 rev = version;
31 hash = "sha256-zxp+jcClfKm+VsylRtydF2rlDCkO+sa9vw8GpwAfKHM=";
32 };
33
34 postPatch = ''
35 substituteInPlace src/CMakeLists.txt \
36 --replace "jsoncpp_object" "jsoncpp" \
37 --replace "jsoncpp_static" "jsoncpp"
38 '';
39
40 cmakeFlags = [
41 "-DENABLE_STATIC=NO" # Do not build static libraries
42 "-DENABLE_UNIT_TESTS=NO" # Do not build test executables
43 ];
44
45 buildInputs = [
46 # Made by BC
47 belcard
48 belle-sip
49 lime
50 mediastreamer
51
52 # Vendored by BC
53 bc-soci
54
55 jsoncpp
56 libxml2
57 (python3.withPackages (ps: [ ps.pystache ps.six ]))
58 sqlite
59 xercesc
60 zxing-cpp
61 ];
62
63 nativeBuildInputs = [
64 cmake
65 doxygen
66 ];
67
68 strictDeps = true;
69
70 # Some grammar files needed to be copied too from some dependencies. I suppose
71 # if one define a dependency in such a way that its share directory is found,
72 # then this copying would be unnecessary. Instead of actually copying these
73 # files, create a symlink.
74 postInstall = ''
75 mkdir -p $out/share/belr/grammars
76 ln -s ${belcard}/share/belr/grammars/* $out/share/belr/grammars/
77 '';
78
79 meta = with lib; {
80 homepage = "https://www.linphone.org/technical-corner/liblinphone";
81 description = "Library for SIP calls and instant messaging";
82 license = licenses.gpl3Plus;
83 platforms = platforms.linux;
84 maintainers = with maintainers; [ jluttine ];
85 };
86}