Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv
2, lib
3, fetchurl
4, meson
5, ninja
6, pkg-config
7, gobject-introspection
8, vala
9, gi-docgen
10, python3
11, libsoup
12, glib
13, gnome
14, gssdp-tools
15}:
16
17stdenv.mkDerivation rec {
18 pname = "gssdp";
19 version = "1.4.1";
20
21 outputs = [ "out" "dev" ]
22 ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ];
23
24 src = fetchurl {
25 url = "mirror://gnome/sources/gssdp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
26 sha256 = "VySWVDV9PVGxQDFRaaJMBnHeeqUsb3XIxcmr1Ao1JSk=";
27 };
28
29 nativeBuildInputs = [
30 meson
31 ninja
32 pkg-config
33 gobject-introspection
34 vala
35 gi-docgen
36 python3
37 ];
38
39 buildInputs = [
40 libsoup
41 ];
42
43 propagatedBuildInputs = [
44 glib
45 ];
46
47 mesonFlags = [
48 "-Dgtk_doc=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
49 "-Dsniffer=false"
50 ];
51
52 # Bail out! GLib-GIO-FATAL-CRITICAL: g_inet_address_to_string: assertion 'G_IS_INET_ADDRESS (address)' failed
53 doCheck = !stdenv.isDarwin;
54
55 postFixup = lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) ''
56 # Move developer documentation to devdoc output.
57 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
58 find -L "$out/share/doc" -type f -regex '.*\.devhelp2?' -print0 \
59 | while IFS= read -r -d ''' file; do
60 moveToOutput "$(dirname "''${file/"$out/"/}")" "$devdoc"
61 done
62 '';
63
64 passthru = {
65 updateScript = gnome.updateScript {
66 packageName = pname;
67 freeze = true;
68 };
69
70 tests = {
71 inherit gssdp-tools;
72 };
73 };
74
75 meta = with lib; {
76 description = "GObject-based API for handling resource discovery and announcement over SSDP";
77 homepage = "http://www.gupnp.org/";
78 license = licenses.lgpl2Plus;
79 maintainers = teams.gnome.members;
80 platforms = platforms.all;
81 };
82}