diff --git a/pkgs/development/libraries/libdmapsharing/default.nix b/pkgs/development/libraries/libdmapsharing/default.nix index ba1b3c05f1a6..47b02a65e083 100644 --- a/pkgs/development/libraries/libdmapsharing/default.nix +++ b/pkgs/development/libraries/libdmapsharing/default.nix @@ -1,59 +1,74 @@ -{ stdenv -, lib -, fetchFromGitLab -, autoconf -, automake -, libtool -, which -, pkg-config -, python3 -, vala -, avahi -, gdk-pixbuf -, gst_all_1 -, glib -, gtk-doc -, docbook-xsl-nons -, docbook_xml_dtd_43 -, gobject-introspection -, libsoup_3 +{ + stdenv, + lib, + fetchFromGitLab, + autoconf, + automake, + libtool, + pkg-config, + vala, + avahi, + gdk-pixbuf, + gst_all_1, + glib, + gtk-doc, + docbook-xsl-nons, + docbook_xml_dtd_43, + gobject-introspection, + libsoup_3, + withGtkDoc ? stdenv.buildPlatform.canExecute stdenv.hostPlatform, }: stdenv.mkDerivation rec { pname = "libdmapsharing"; version = "3.9.13"; - outputs = [ "out" "dev" "devdoc" ]; + outputs = + [ + "out" + "dev" + ] + ++ lib.optionals withGtkDoc [ + "devdoc" + ]; + outputBin = "dev"; src = fetchFromGitLab { domain = "gitlab.gnome.org"; owner = "GNOME"; repo = pname; - rev = "${lib.toUpper pname}_${lib.replaceStrings ["."] ["_"] version}"; + rev = "${lib.toUpper pname}_${lib.replaceStrings [ "." ] [ "_" ] version}"; sha256 = "oR9lpOFxgGfrtzncFT6dbmhKQfcuH/NvhOR/USHAHQc="; }; - nativeBuildInputs = [ - autoconf - automake - libtool - which - pkg-config - python3 - gobject-introspection - vala - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_43 - ]; + strictDeps = true; - buildInputs = [ - avahi - gdk-pixbuf - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - ]; + nativeBuildInputs = + [ + autoconf + automake + libtool + gtk-doc # gtkdocize + pkg-config + gobject-introspection + vala + ] + ++ lib.optionals withGtkDoc [ + docbook-xsl-nons + docbook_xml_dtd_43 + ]; + + buildInputs = + [ + avahi + gdk-pixbuf + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + ] + ++ lib.optionals withGtkDoc [ + gtk-doc + ]; propagatedBuildInputs = [ glib @@ -61,10 +76,15 @@ stdenv.mkDerivation rec { ]; configureFlags = [ - "--enable-gtk-doc" - "--disable-tests" # Tests require mDNS server. + (lib.enableFeature false "tests") # Tests require mDNS server + (lib.enableFeature withGtkDoc "gtk-doc") ]; + postPatch = '' + substituteInPlace configure.ac \ + --replace-fail pkg-config "$PKG_CONFIG" + ''; + preConfigure = '' NOCONFIGURE=1 ./autogen.sh '';