summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/linphone/default.nix
blob: 4282e99a712e90ba3e7d908bb848099d43a15ffd (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
{ stdenv, intltool, pkgconfig, readline, openldap, cyrus_sasl, libupnp
, zlib, libxml2, gtk2, libnotify, speex, ffmpeg, libX11, libsoup, udev
, ortp, mediastreamer, sqlite, belle-sip, libosip, libexosip, bzrtp
, mediastreamer-openh264, bctoolbox, makeWrapper, fetchFromGitHub, cmake
, libmatroska, bcunit, doxygen, gdk_pixbuf, glib, cairo, pango, polarssl
, python, graphviz, belcard
, withGui ? true
}:

stdenv.mkDerivation rec {
  baseName = "linphone";
  version = "3.12.0";
  name = "${baseName}-${version}";

  src = fetchFromGitHub {
    owner = "BelledonneCommunications";
    repo = "${baseName}";
    rev = "${version}";
    sha256 = "0az2ywrpx11sqfb4s4r2v726avcjf4k15bvrqj7xvhz7hdndmh0j";
  };

  cmakeFlags = stdenv.lib.optional withGui [ "-DENABLE_GTK_UI=ON" ];

  postPatch = ''
    touch coreapi/liblinphone_gitversion.h
  '';

  buildInputs = [
    readline openldap cyrus_sasl libupnp zlib libxml2 gtk2 libnotify speex ffmpeg libX11
    polarssl libsoup udev ortp mediastreamer sqlite belle-sip libosip libexosip
    bctoolbox libmatroska bcunit gdk_pixbuf glib cairo pango bzrtp belcard
  ];

  nativeBuildInputs = [
    intltool pkgconfig makeWrapper cmake doxygen graphviz
    (python.withPackages (ps: [ ps.pystache ps.six ]))
  ];

  NIX_CFLAGS_COMPILE = " -Wno-error -I${glib.dev}/include/glib-2.0
    -I${glib.out}/lib/glib-2.0/include -I${gtk2.dev}/include/gtk-2.0/
    -I${cairo.dev}/include/cairo -I${pango.dev}/include/pango-1.0
    -I${gtk2}/lib/gtk-2.0/include
    -DLIBLINPHONE_GIT_VERSION=\"v${version}\"
    ";

  postInstall = ''
    for i in $(cd $out/bin && ls); do
      wrapProgram $out/bin/$i --set MEDIASTREAMER_PLUGINS_DIR ${mediastreamer-openh264}/lib/mediastreamer/plugins
    done
  '';

  meta = with stdenv.lib; {
    homepage = http://www.linphone.org/;
    description = "Open Source video SIP softphone";
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}