From 1642ca5a777aff0da46156d8ce5557419322248d Mon Sep 17 00:00:00 2001 From: Harrison Houghton <28076058+hrhino@users.noreply.github.com> Date: Thu, 29 Jul 2021 17:53:32 -0400 Subject: [PATCH] libsigrok: fix c++ bindings (#131998) Doxygen and Python are needed as nativeBuildInputs (according to configure). Add a tiny installCheck for this. --- pkgs/development/tools/libsigrok/default.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/libsigrok/default.nix b/pkgs/development/tools/libsigrok/default.nix index 7b9ebd57391a..52272e619566 100644 --- a/pkgs/development/tools/libsigrok/default.nix +++ b/pkgs/development/tools/libsigrok/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, pkg-config, libzip, glib, libusb1, libftdi1, check -, libserialport, librevisa, doxygen, glibmm +, libserialport, librevisa, doxygen, glibmm, python3 , version ? "0.5.1", sha256 ? "171b553dir5gn6w4f7n37waqk62nq2kf1jykx4ifjacdz5xdw3z4" }: @@ -17,10 +17,8 @@ stdenv.mkDerivation rec { sha256 = "14sd8xqph4kb109g073daiavpadb20fcz7ch1ipn0waz7nlly4sw"; }; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ libzip glib libusb1 libftdi1 check libserialport - librevisa doxygen glibmm - ]; + nativeBuildInputs = [ doxygen pkg-config python3 ]; + buildInputs = [ libzip glib libusb1 libftdi1 check libserialport librevisa glibmm ]; strictDeps = true; @@ -29,11 +27,18 @@ stdenv.mkDerivation rec { tar --strip-components=1 -xvf "${firmware}" -C "$out/share/sigrok-firmware/" ''; + doInstallCheck = true; + installCheckPhase = '' + # assert that c++ bindings are included + [[ -f $out/include/libsigrokcxx/libsigrokcxx.hpp ]] \ + || { echo 'C++ bindings were not generated; check configure output'; false; } + ''; + meta = with lib; { description = "Core library of the sigrok signal analysis software suite"; homepage = "https://sigrok.org/"; license = licenses.gpl3Plus; platforms = platforms.linux ++ platforms.darwin; - maintainers = [ maintainers.bjornfor ]; + maintainers = with maintainers; [ bjornfor ]; }; }