libepc: clean up

- Do not require avahi-ui, only used for examples which are not installed anyway.
- Format the expression.
- Use finalAttrs.

Note that the library has become abandoned upstream:
https://gitlab.gnome.org/Archive/libepc

+65 -8
+29 -8
pkgs/development/libraries/libepc/default.nix
··· 1 - { lib, stdenv, fetchurl, pkg-config, intltool, gtk-doc, glib, avahi, gnutls, libuuid, libsoup, gtk3, gnome }: 1 + { stdenv 2 + , lib 3 + , fetchurl 4 + , autoreconfHook 5 + , pkg-config 6 + , intltool 7 + , gtk-doc 8 + , glib 9 + , avahi 10 + , gnutls 11 + , libuuid 12 + , libsoup 13 + , gtk3 14 + , gnome 15 + }: 2 16 3 - let 4 - avahiWithGtk = avahi.override { gtk3Support = true; }; 5 - in stdenv.mkDerivation rec { 17 + stdenv.mkDerivation (finalAttrs: { 6 18 pname = "libepc"; 7 19 version = "0.4.6"; 8 20 9 21 outputs = [ "out" "dev" "devdoc" ]; 10 22 11 23 src = fetchurl { 12 - url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 24 + url = "mirror://gnome/sources/libepc/${lib.versions.majorMinor finalAttrs.version}/libepc-${finalAttrs.version}.tar.xz"; 13 25 sha256 = "1s3svb2slqjsrqfv50c2ymnqcijcxb5gnx6bfibwh9l5ga290n91"; 14 26 }; 15 27 28 + patches = [ 29 + # Remove dependency that is only needed by uninstalled examples. 30 + ./no-avahi-ui.patch 31 + ]; 32 + 16 33 nativeBuildInputs = [ 34 + autoreconfHook 35 + gnome.gnome-common 17 36 pkg-config 18 37 intltool 19 38 gtk-doc 20 39 ]; 40 + 21 41 buildInputs = [ 22 42 glib 23 43 libuuid 24 44 gtk3 25 45 ]; 46 + 26 47 propagatedBuildInputs = [ 27 - avahiWithGtk 48 + avahi 28 49 gnutls 29 50 libsoup 30 51 ]; ··· 33 54 34 55 passthru = { 35 56 updateScript = gnome.updateScript { 36 - packageName = pname; 57 + packageName = "libepc"; 37 58 versionPolicy = "odd-unstable"; 38 59 }; 39 60 }; ··· 45 66 maintainers = teams.gnome.members; 46 67 platforms = platforms.linux; 47 68 }; 48 - } 69 + })
+36
pkgs/development/libraries/libepc/no-avahi-ui.patch
··· 1 + diff --git a/Makefile.am b/Makefile.am 2 + index acf0d25..13022d1 100644 3 + --- a/Makefile.am 4 + +++ b/Makefile.am 5 + @@ -32,8 +32,6 @@ noinst_PROGRAMS = \ 6 + examples/lookup-resource \ 7 + examples/service-browser \ 8 + examples/simple-publisher \ 9 + - examples/consumer-ui \ 10 + - examples/publisher-ui \ 11 + examples/server-credentials \ 12 + $(TESTS) 13 + TESTS = \ 14 + @@ -155,10 +153,6 @@ examples_service_browser_LDADD = $(example_epc_libs) 15 + examples_simple_publisher_CFLAGS = $(example_epc_cflags) 16 + examples_simple_publisher_LDADD = $(example_epc_libs) 17 + 18 + -examples_consumer_ui_CFLAGS = $(example_epc_ui_cflags) $(AVAHI_UI_CFLAGS) 19 + -examples_consumer_ui_LDADD = $(example_epc_ui_libs) $(AVAHI_UI_LIBS) 20 + -examples_publisher_ui_CFLAGS = $(example_epc_ui_cflags) $(AVAHI_UI_CFLAGS) -rdynamic 21 + -examples_publisher_ui_LDADD = $(example_epc_ui_libs) $(AVAHI_UI_LIBS) 22 + examples_server_credentials_CFLAGS = $(example_epc_ui_cflags) 23 + examples_server_credentials_LDADD = $(example_epc_ui_libs) 24 + 25 + diff --git a/configure.ac b/configure.ac 26 + index d68bf94..89bd471 100644 27 + --- a/configure.ac 28 + +++ b/configure.ac 29 + @@ -53,7 +53,6 @@ PKG_CHECK_EXISTS([$GIO_REQUIREMENT], 30 + GIO=$GIO_REQUIREMENT], 31 + [AC_MSG_RESULT([no])]) 32 + 33 + -PKG_CHECK_MODULES(AVAHI_UI, [avahi-ui-gtk3 >= 0.6]) 34 + PKG_CHECK_MODULES(LIBEPC, [avahi-client >= 0.6 35 + avahi-glib >= 0.6 36 + glib-2.0 >= 2.36