From 2de067fa3fe2f3745355cd499147eebb7d30aa53 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sun, 25 Aug 2024 14:25:43 -0400 Subject: [PATCH] libdmapsharing: fix cross compilation --- .../libraries/libdmapsharing/default.nix | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/libdmapsharing/default.nix b/pkgs/development/libraries/libdmapsharing/default.nix index ba1b3c05f1a60..04a9def5c7432 100644 --- a/pkgs/development/libraries/libdmapsharing/default.nix +++ b/pkgs/development/libraries/libdmapsharing/default.nix @@ -4,9 +4,7 @@ , autoconf , automake , libtool -, which , pkg-config -, python3 , vala , avahi , gdk-pixbuf @@ -17,13 +15,20 @@ , 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 { @@ -34,16 +39,17 @@ stdenv.mkDerivation rec { sha256 = "oR9lpOFxgGfrtzncFT6dbmhKQfcuH/NvhOR/USHAHQc="; }; + strictDeps = true; + nativeBuildInputs = [ autoconf automake libtool - which + gtk-doc # gtkdocize pkg-config - python3 gobject-introspection vala - gtk-doc + ] ++ lib.optionals withGtkDoc [ docbook-xsl-nons docbook_xml_dtd_43 ]; @@ -53,6 +59,8 @@ stdenv.mkDerivation rec { gdk-pixbuf gst_all_1.gstreamer gst_all_1.gst-plugins-base + ] ++ lib.optionals withGtkDoc [ + gtk-doc ]; propagatedBuildInputs = [ @@ -61,10 +69,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 '';