1 { gtkWidgets ? false # build GTK widgets for libinfinity
2 , avahiSupport ? false # build support for Avahi in libinfinity
3 , lib, stdenv, fetchurl, pkg-config, glib, libxml2, gnutls, gsasl
4 , gobject-introspection
5 , gtk3 ? null, gtk-doc, docbook_xsl, docbook_xml_dtd_412, avahi ? null, libdaemon, libidn, gss
8 assert avahiSupport -> avahi != null;
9 assert gtkWidgets -> gtk3 != null;
12 mkFlag = flag: feature: (if flag then "--with-" else "--without-") + feature;
14 self = stdenv.mkDerivation rec {
15 pname = "libinfinity";
18 url = "https://github.com/gobby/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
19 sha256 = "17i3g61hxz9pzl3ryd1yr15142r25m06jfzjrpdy7ic1b8vjjw3f";
22 outputs = [ "bin" "out" "dev" "man" "devdoc" ];
24 nativeBuildInputs = [ pkg-config gtk-doc docbook_xsl docbook_xml_dtd_412 gobject-introspection ];
25 buildInputs = [ glib libxml2 gsasl libidn gss libintl libdaemon ]
26 ++ lib.optional gtkWidgets gtk3
27 ++ lib.optional avahiSupport avahi;
29 propagatedBuildInputs = [ gnutls ];
33 "--enable-introspection"
34 (mkFlag gtkWidgets "inftextgtk")
35 (mkFlag gtkWidgets "infgtk")
38 (mkFlag avahiSupport "avahi")
42 infinoted = "${self.bin}/bin/infinoted-${lib.versions.majorMinor version}";
46 homepage = "https://gobby.github.io/";
47 description = "An implementation of the Infinote protocol written in GObject-based C";
48 license = lib.licenses.lgpl2Plus;
49 maintainers = [ lib.maintainers.phreedom ];
50 platforms = with lib.platforms; linux ++ darwin;