From af10a338feb5c039ef2ae4a606697b7b5e769c1e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 15 Aug 2024 10:11:35 +0200 Subject: [PATCH] gst_all_1.gstreamer: disable libunwind if unavailable --- .../libraries/gstreamer/core/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix index 40d40d742463..2cf0569b3e9e 100644 --- a/pkgs/development/libraries/gstreamer/core/default.nix +++ b/pkgs/development/libraries/gstreamer/core/default.nix @@ -10,7 +10,6 @@ , glib , makeWrapper , libcap -, libunwind , elfutils # for libdw , bash-completion , lib @@ -19,6 +18,9 @@ , gobject-introspection , rustc , testers +, libunwind +# darwin.libunwind doesn't have pkg-config definitions so meson doesn't detect it. +, withLibunwind ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform libunwind # Checks meson.is_cross_build(), so even canExecute isn't enough. , enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc }: @@ -70,9 +72,10 @@ stdenv.mkDerivation (finalAttrs: { bash-completion ] ++ lib.optionals stdenv.isLinux [ libcap - libunwind ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ elfutils + ] ++ lib.optionals withLibunwind [ + libunwind ] ++ lib.optionals stdenv.isDarwin [ Cocoa CoreServices @@ -86,10 +89,8 @@ stdenv.mkDerivation (finalAttrs: { "-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those "-Dexamples=disabled" # requires many dependencies and probably not useful for our users (lib.mesonEnable "doc" enableDocumentation) - ] ++ lib.optionals stdenv.isDarwin [ - # darwin.libunwind doesn't have pkg-config definitions so meson doesn't detect it. - "-Dlibunwind=disabled" - "-Dlibdw=disabled" + (lib.mesonEnable "libunwind" withLibunwind) + (lib.mesonEnable "libdw" withLibunwind) ]; postPatch = ''