Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at release-18.03 49 lines 1.7 kB view raw
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.7.1"; 16 src = fetchurl { 17 url = "http://releases.0x539.de/libinfinity/${name}.tar.gz"; 18 sha256 = "1jw2fhrcbpyz99bij07iyhy9ffyqdn87vl8cb1qz897y3f2f0vk2"; 19 }; 20 21 nativeBuildInputs = [ pkgconfig ]; 22 buildInputs = [ glib libxml2 gsasl libidn gss libintlOrEmpty ] 23 ++ optional gtkWidgets gtk2 24 ++ optional documentation gtkdoc 25 ++ optional avahiSupport avahi 26 ++ optional daemon libdaemon; 27 28 propagatedBuildInputs = [ gnutls ]; 29 30 configureFlags = '' 31 ${if documentation then "--enable-gtk-doc" else "--disable-gtk-doc"} 32 ${edf gtkWidgets "inftextgtk"} 33 ${edf gtkWidgets "infgtk"} 34 ${edf daemon "infinoted"} 35 ${edf daemon "libdaemon"} 36 ${edf avahiSupport "avahi"} 37 ''; 38 39 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl"; 40 41 meta = { 42 homepage = http://gobby.0x539.de/; 43 description = "An implementation of the Infinote protocol written in GObject-based C"; 44 license = stdenv.lib.licenses.lgpl2Plus; 45 maintainers = [ stdenv.lib.maintainers.phreedom ]; 46 platforms = with stdenv.lib.platforms; linux ++ darwin; 47 }; 48 49}