about summary refs log tree commit diff
path: root/pkgs/development/libraries/avahi
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2022-05-21 18:26:37 +0200
committerJan Tojnar <jtojnar@gmail.com>2022-05-21 18:53:14 +0200
commitd5cf13f483e7805b4a8aa9b703d7d5d86dda631a (patch)
treef295dc6e1d434e7e89b78bf0739920162fff83fa /pkgs/development/libraries/avahi
parent3925da79a55c954b9bdf5ca92799210484f36832 (diff)
avahi: format the expression
- Use `nixpkgs-fmt`.
- Order attributes according to common convention.
- Use `enableFeature` consistently.
Diffstat (limited to 'pkgs/development/libraries/avahi')
-rw-r--r--pkgs/development/libraries/avahi/default.nix112
1 files changed, 77 insertions, 35 deletions
diff --git a/pkgs/development/libraries/avahi/default.nix b/pkgs/development/libraries/avahi/default.nix
index 1732b5df04e2a..e3e959b56ef23 100644
--- a/pkgs/development/libraries/avahi/default.nix
+++ b/pkgs/development/libraries/avahi/default.nix
@@ -1,14 +1,28 @@
-{ fetchurl, fetchpatch, lib, stdenv, pkg-config, libdaemon, dbus, perlPackages
-, expat, gettext, intltool, glib, libiconv, writeShellScriptBin, libevent
+{ fetchurl
+, fetchpatch
+, lib
+, stdenv
+, pkg-config
+, libdaemon
+, dbus
+, perlPackages
+, expat
+, gettext
+, intltool
+, glib
+, libiconv
+, libevent
 , nixosTests
-, gtk3Support ? false, gtk3 ? null
+, gtk3Support ? false
+, gtk3 ? null
 , qt4 ? null
 , qt4Support ? false
 , qt5 ? null
 , qt5Support ? false
 , withLibdnssdCompat ? false
 , python ? null
-, withPython ? false }:
+, withPython ? false
+}:
 
 assert qt4Support -> qt4 != null;
 
@@ -26,46 +40,74 @@ stdenv.mkDerivation rec {
     sha256 = "1npdixwxxn3s9q1f365x9n9rc5xgfz39hxf23faqvlrklgbhj0q6";
   };
 
-  prePatch = ''
-    substituteInPlace configure \
-      --replace pkg-config "$PKG_CONFIG"
-  '';
-
   patches = [
     ./no-mkdir-localstatedir.patch
+
     (fetchpatch {
       url = "https://github.com/lathiat/avahi/commit/9d31939e55280a733d930b15ac9e4dda4497680c.patch";
       sha256 = "sha256-BXWmrLWUvDxKPoIPRFBpMS3T4gijRw0J+rndp6iDybU=";
     })
   ];
 
-  buildInputs = [ libdaemon dbus glib expat libiconv libevent ]
-    ++ (with perlPackages; [ perl XMLParser ])
-    ++ (lib.optional gtk3Support gtk3)
-    ++ (lib.optional qt4Support qt4)
-    ++ (lib.optional qt5Support qt5);
-
-  propagatedBuildInputs =
-    lib.optionals withPython (with python.pkgs; [ python pygobject3 dbus-python ]);
-
-  nativeBuildInputs = [ pkg-config pkg-config-helper gettext intltool glib ];
-
-  configureFlags =
-    [ "--disable-qt3" "--disable-gdbm" "--disable-mono"
-      "--disable-gtk" "--with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
-      (lib.enableFeature gtk3Support "gtk3")
-      "--${if qt4Support then "enable" else "disable"}-qt4"
-      "--${if qt5Support then "enable" else "disable"}-qt5"
-      (lib.enableFeature withPython "python")
-      "--localstatedir=/var" "--with-distro=none"
-      # A systemd unit is provided by the avahi-daemon NixOS module
-      "--with-systemdsystemunitdir=no" ]
-    ++ lib.optional withLibdnssdCompat "--enable-compat-libdns_sd"
+  nativeBuildInputs = [
+    pkg-config
+    pkg-config-helper
+    gettext
+    glib
+  ];
+
+  buildInputs = [
+    libdaemon
+    dbus
+    glib
+    expat
+    libiconv
+    libevent
+  ] ++ (with perlPackages; [
+    perl
+    XMLParser
+  ]) ++ lib.optionals gtk3Support [
+    gtk3
+  ] ++ lib.optionals qt4Support [
+    qt4
+  ] ++ lib.optionals qt5Support [
+    qt5
+  ];
+
+  propagatedBuildInputs = lib.optionals withPython (with python.pkgs; [
+    python
+    pygobject3
+    dbus-python
+  ]);
+
+  configureFlags = [
+    "--disable-qt3"
+    "--disable-gdbm"
+    "--disable-mono"
+    "--disable-gtk"
+    "--with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
+    (lib.enableFeature gtk3Support "gtk3")
+    (lib.enableFeature qt4Support "qt4")
+    (lib.enableFeature qt5Support "qt5")
+    (lib.enableFeature withPython "python")
+    "--localstatedir=/var"
+    "--with-distro=none"
+    # A systemd unit is provided by the avahi-daemon NixOS module
+    "--with-systemdsystemunitdir=no"
+  ] ++ lib.optionals withLibdnssdCompat [
+    "--enable-compat-libdns_sd"
+  ] ++ lib.optionals stdenv.isDarwin [
     # autoipd won't build on darwin
-    ++ lib.optional stdenv.isDarwin "--disable-autoipd";
+    "--disable-autoipd"
+  ];
 
   NIX_CFLAGS_COMPILE = "-DAVAHI_SERVICE_DIR=\"/etc/avahi/services\"";
 
+  prePatch = ''
+    substituteInPlace configure \
+      --replace pkg-config "$PKG_CONFIG"
+  '';
+
   preBuild = lib.optionalString stdenv.isDarwin ''
     sed -i '20 i\
     #define __APPLE_USE_RFC_2292' \
@@ -89,9 +131,9 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "mDNS/DNS-SD implementation";
-    homepage    = "http://avahi.org";
-    license     = licenses.lgpl2Plus;
-    platforms   = platforms.unix;
+    homepage = "http://avahi.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
     maintainers = with maintainers; [ lovek323 globin ];
 
     longDescription = ''