1{
2 gtkWidgets ? false, # build GTK widgets for libinfinity
3 avahiSupport ? false, # build support for Avahi in libinfinity
4 lib,
5 stdenv,
6 fetchurl,
7 pkg-config,
8 glib,
9 libxml2,
10 gnutls,
11 gsasl,
12 gobject-introspection,
13 gtk3 ? null,
14 gtk-doc,
15 docbook_xsl,
16 docbook_xml_dtd_412,
17 avahi ? null,
18 libdaemon,
19 libidn,
20 gss,
21 libintl,
22}:
23
24assert avahiSupport -> avahi != null;
25assert gtkWidgets -> gtk3 != null;
26
27let
28 self = stdenv.mkDerivation rec {
29 pname = "libinfinity";
30 version = "0.7.2";
31 src = fetchurl {
32 url = "https://github.com/gobby/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
33 sha256 = "17i3g61hxz9pzl3ryd1yr15142r25m06jfzjrpdy7ic1b8vjjw3f";
34 };
35
36 outputs = [
37 "bin"
38 "out"
39 "dev"
40 "man"
41 "devdoc"
42 ];
43
44 nativeBuildInputs = [
45 pkg-config
46 gtk-doc
47 docbook_xsl
48 docbook_xml_dtd_412
49 gobject-introspection
50 ];
51 buildInputs = [
52 glib
53 libxml2
54 gsasl
55 libidn
56 gss
57 libintl
58 libdaemon
59 ]
60 ++ lib.optional gtkWidgets gtk3
61 ++ lib.optional avahiSupport avahi;
62
63 propagatedBuildInputs = [ gnutls ];
64
65 configureFlags = [
66 (lib.enableFeature true "gtk-doc")
67 (lib.enableFeature true "introspection")
68 (lib.withFeature gtkWidgets "inftextgtk")
69 (lib.withFeature gtkWidgets "infgtk")
70 (lib.withFeature true "infinoted")
71 (lib.withFeature true "libdaemon")
72 (lib.withFeature avahiSupport "avahi")
73 ];
74
75 passthru = {
76 infinoted = "${self.bin}/bin/infinoted-${lib.versions.majorMinor version}";
77 };
78
79 meta = {
80 homepage = "https://gobby.github.io/";
81 description = "Implementation of the Infinote protocol written in GObject-based C";
82 mainProgram = "infinoted-0.7";
83 license = lib.licenses.lgpl2Plus;
84 maintainers = [ ];
85 platforms = with lib.platforms; linux ++ darwin;
86 };
87 };
88in
89self