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