1{
2 stdenv,
3 lib,
4 fetchurl,
5 fetchpatch2,
6 meson,
7 ninja,
8 pkg-config,
9 gobject-introspection,
10 vala,
11 gtk-doc,
12 docbook_xsl,
13 docbook_xml_dtd_412,
14 docbook_xml_dtd_45,
15 glib,
16 gssdp,
17 libsoup_2_4,
18 libxml2,
19 libuuid,
20 gnome,
21}:
22
23stdenv.mkDerivation rec {
24 pname = "gupnp";
25 version = "1.4.4";
26
27 outputs = [
28 "out"
29 "dev"
30 ]
31 ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ];
32
33 src = fetchurl {
34 url = "mirror://gnome/sources/gupnp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
35 sha256 = "sha256-N2GxXLBjYh+Efz7/t9djfwMXUA/Ka9oeGQT3OSF1Ch8=";
36 };
37
38 patches = [
39 # Bring .pc file in line with our patched pkg-config.
40 ./0001-pkg-config-Declare-header-dependencies-as-public.patch
41
42 # Unbreak build with Meson 1.2.0
43 # https://gitlab.gnome.org/GNOME/gupnp/-/merge_requests/33
44 (fetchpatch2 {
45 name = "meson-1.2-fix.patch";
46 url = "https://gitlab.gnome.org/GNOME/gupnp/-/commit/85c0244cfbf933d3e90d50ab68394c68d86f9ed5.patch";
47 hash = "sha256-poDhkEgDTpgGnTbbZLPwx8Alf0h81vmzJyx3izWmDGw=";
48 })
49
50 # Fix build against libxml2 2.11
51 # https://gitlab.gnome.org/GNOME/gupnp/-/merge_requests/34
52 (fetchpatch2 {
53 name = "libxml2-2.11-fix.patch";
54 url = "https://gitlab.gnome.org/GNOME/gupnp/-/commit/bc56f02b0f89e96f2bd74af811903d9931965f58.patch";
55 hash = "sha256-KCHlq7Es+WLIWKgIgGVTaHarVQIiZPEi5r6nMAhXTgY=";
56 })
57 ];
58
59 depsBuildBuild = [
60 pkg-config
61 ];
62
63 nativeBuildInputs = [
64 meson
65 ninja
66 pkg-config
67 gobject-introspection
68 vala
69 gtk-doc
70 docbook_xsl
71 docbook_xml_dtd_412
72 docbook_xml_dtd_45
73 ];
74
75 buildInputs = [
76 libuuid
77 ];
78
79 propagatedBuildInputs = [
80 glib
81 gssdp
82 libsoup_2_4
83 libxml2
84 ];
85
86 mesonFlags = [
87 "-Dgtk_doc=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
88 ];
89
90 # Bail out! ERROR:../tests/test-bugs.c:168:test_on_timeout: code should not be reached
91 doCheck = !stdenv.hostPlatform.isDarwin;
92
93 passthru = {
94 updateScript = gnome.updateScript {
95 packageName = pname;
96 freeze = true;
97 };
98 };
99
100 meta = with lib; {
101 homepage = "http://www.gupnp.org/";
102 description = "Implementation of the UPnP specification";
103 mainProgram = "gupnp-binding-tool-1.2";
104 license = licenses.lgpl2Plus;
105 platforms = platforms.unix;
106 };
107}