1{ stdenv
2, fetchurl
3, fetchpatch
4, meson
5, ninja
6, pkgconfig
7, python3
8, gobject-introspection
9, gtk-doc
10, docbook_xsl
11, docbook_xml_dtd_412
12, glib
13, gupnp-igd
14, gst_all_1
15, gnutls
16}:
17
18stdenv.mkDerivation rec {
19 name = "libnice-0.1.16";
20
21 outputs = [ "bin" "out" "dev" "devdoc" ];
22
23 src = fetchurl {
24 url = "https://nice.freedesktop.org/releases/${name}.tar.gz";
25 sha256 = "1pzgxq0qrqlrhd78qnvpfgp8bl5c4znqh599ljaybpcldw37idh6";
26 };
27
28 patches = [
29 # Fix generating data
30 # Note: upstream is not willing to merge our fix
31 # https://gitlab.freedesktop.org/libnice/libnice/merge_requests/35#note_98871
32 (fetchpatch {
33 url = https://gitlab.freedesktop.org/libnice/libnice/commit/d470c4bf4f2449f7842df26ca1ce1efb63452bc6.patch;
34 sha256 = "0z74vizf92flfw1m83p7yz824vfykmnm0xbnk748bnnyq186i6mg";
35 })
36 ];
37
38 nativeBuildInputs = [
39 meson
40 ninja
41 pkgconfig
42 python3
43 gobject-introspection
44
45 # documentation
46 gtk-doc
47 docbook_xsl
48 docbook_xml_dtd_412
49 ];
50
51 buildInputs = [
52 gst_all_1.gstreamer
53 gst_all_1.gst-plugins-base
54 gnutls
55 gupnp-igd
56 ];
57
58 propagatedBuildInputs = [
59 glib
60 ];
61
62 mesonFlags = [
63 "-Dgtk_doc=enabled" # Disabled by default as of libnice-0.1.15
64 "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
65 ];
66
67 # Tests are flaky
68 # see https://github.com/NixOS/nixpkgs/pull/53293#issuecomment-453739295
69 doCheck = false;
70
71 meta = with stdenv.lib; {
72 description = "GLib ICE implementation";
73 longDescription = ''
74 Libnice is an implementation of the IETF's Interactice Connectivity
75 Establishment (ICE) standard (RFC 5245) and the Session Traversal
76 Utilities for NAT (STUN) standard (RFC 5389).
77
78 It provides a GLib-based library, libnice and a Glib-free library,
79 libstun as well as GStreamer elements.'';
80 homepage = "https://nice.freedesktop.org/wiki/";
81 platforms = platforms.linux;
82 license = with licenses; [ lgpl21 mpl11 ];
83 };
84}