From 700f1a4bcd4c1a6dee3d9f1e31510a03b2f3c5bb Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 14 May 2024 10:23:08 +0200 Subject: [PATCH] libcamera: disable tracing if unavailable lttng-ust has a mandatory dependency on liburcu, which requires architecture-specific code that isn't available for all platforms. To enable building libcamera for those platforms, disable tracing support if lttng-ust is unavailable. This fixes building libcamera for, for example, loongarch64-linux. --- pkgs/by-name/li/libcamera/package.nix | 12 ++++++------ pkgs/development/tools/misc/lttng-ust/generic.nix | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/li/libcamera/package.nix b/pkgs/by-name/li/libcamera/package.nix index dabf457de743..6ecd7be1c3d1 100644 --- a/pkgs/by-name/li/libcamera/package.nix +++ b/pkgs/by-name/li/libcamera/package.nix @@ -9,7 +9,6 @@ , libdrm , libevent , libyaml -, lttng-ust , gst_all_1 , gtest , graphviz @@ -17,6 +16,8 @@ , python3 , python3Packages , systemd # for libudev +, withTracing ? lib.meta.availableOn stdenv.hostPlatform lttng-ust +, lttng-ust # withTracing , withQcam ? false , qt5 # withQcam , libtiff # withQcam @@ -67,14 +68,12 @@ stdenv.mkDerivation rec { # hotplugging systemd - # lttng tracing - lttng-ust - # yamlparser libyaml gtest - ] ++ lib.optionals withQcam [ libtiff qt5.qtbase qt5.qttools ]; + ] ++ lib.optionals withTracing [ lttng-ust ] + ++ lib.optionals withQcam [ libtiff qt5.qtbase qt5.qttools ]; nativeBuildInputs = [ meson @@ -92,7 +91,8 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dv4l2=true" - "-Dqcam=${if withQcam then "enabled" else "disabled"}" + (lib.mesonEnable "tracing" withTracing) + (lib.mesonEnable "qcam" withQcam) "-Dlc-compliance=disabled" # tries unconditionally to download gtest when enabled # Avoid blanket -Werror to evade build failures on less # tested compilers. diff --git a/pkgs/development/tools/misc/lttng-ust/generic.nix b/pkgs/development/tools/misc/lttng-ust/generic.nix index 89bc888828e2..24d022e4d851 100644 --- a/pkgs/development/tools/misc/lttng-ust/generic.nix +++ b/pkgs/development/tools/misc/lttng-ust/generic.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { mainProgram = "lttng-gen-tp"; homepage = "https://lttng.org/"; license = with licenses; [ lgpl21Only gpl2Only mit ]; - platforms = platforms.linux; + platforms = lib.intersectLists platforms.linux liburcu.meta.platforms; maintainers = [ maintainers.bjornfor ]; };