nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ gtkWidgets ? false # build GTK widgets for libinfinity
2, daemon ? false # build infinote daemon
3, documentation ? false # build documentation
4, avahiSupport ? false # build support for Avahi in libinfinity
5, stdenv, fetchurl, pkgconfig, glib, libxml2, gnutls, gsasl
6, gtk2 ? null, gtkdoc ? null, avahi ? null, libdaemon ? null, libidn, gss
7, libintlOrEmpty }:
8
9let
10 edf = flag: feature: (if flag then "--with-" else "--without-") + feature;
11 optional = cond: elem: assert cond -> elem != null; if cond then [elem] else [];
12
13in stdenv.mkDerivation rec {
14
15 name = "libinfinity-0.6.5";
16 src = fetchurl {
17 url = "http://releases.0x539.de/libinfinity/${name}.tar.gz";
18 sha256 = "1idsxb6rz4i55g3vi2sv7hmm57psbccpb57yc4jgphaq6ydgqsr6";
19 };
20
21 buildInputs = [ pkgconfig glib libxml2 gsasl libidn gss libintlOrEmpty ]
22 ++ optional gtkWidgets gtk2
23 ++ optional documentation gtkdoc
24 ++ optional avahiSupport avahi
25 ++ optional daemon libdaemon;
26
27 propagatedBuildInputs = [ gnutls ];
28
29 configureFlags = ''
30 ${if documentation then "--enable-gtk-doc" else "--disable-gtk-doc"}
31 ${edf gtkWidgets "inftextgtk"}
32 ${edf gtkWidgets "infgtk"}
33 ${edf daemon "infinoted"}
34 ${edf daemon "libdaemon"}
35 ${edf avahiSupport "avahi"}
36 '';
37
38 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
39
40 meta = {
41 homepage = http://gobby.0x539.de/;
42 description = "An implementation of the Infinote protocol written in GObject-based C";
43 license = stdenv.lib.licenses.lgpl2Plus;
44 maintainers = [ stdenv.lib.maintainers.phreedom ];
45 platforms = with stdenv.lib.platforms; linux ++ darwin;
46 };
47
48}