2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, libzip, glib, libusb1, libftdi1, check
|
2022-01-19 12:34:13 +00:00
|
|
|
, libserialport, librevisa, doxygen, glibmm, python
|
2021-08-02 21:14:32 +01:00
|
|
|
, version ? "0.5.1", sha256 ? "171b553dir5gn6w4f7n37waqk62nq2kf1jykx4ifjacdz5xdw3z4", doInstallCheck ? true
|
2014-05-18 21:15:37 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-02 21:14:32 +01:00
|
|
|
inherit version doInstallCheck;
|
2019-06-01 16:01:05 +01:00
|
|
|
pname = "libsigrok";
|
2014-05-18 21:15:37 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-06-01 16:01:05 +01:00
|
|
|
url = "https://sigrok.org/download/source/${pname}/${pname}-${version}.tar.gz";
|
2016-05-11 20:21:35 +01:00
|
|
|
inherit sha256;
|
2014-05-18 21:15:37 +01:00
|
|
|
};
|
|
|
|
|
2015-01-01 18:45:19 +00:00
|
|
|
firmware = fetchurl {
|
2019-06-01 16:01:05 +01:00
|
|
|
url = "https://sigrok.org/download/binary/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-bin-0.1.6.tar.gz";
|
|
|
|
sha256 = "14sd8xqph4kb109g073daiavpadb20fcz7ch1ipn0waz7nlly4sw";
|
2015-01-01 18:45:19 +00:00
|
|
|
};
|
|
|
|
|
2022-01-19 12:34:13 +00:00
|
|
|
nativeBuildInputs = [ doxygen pkg-config python ];
|
2021-07-29 22:53:32 +01:00
|
|
|
buildInputs = [ libzip glib libusb1 libftdi1 check libserialport librevisa glibmm ];
|
2014-05-18 21:15:37 +01:00
|
|
|
|
2021-07-27 15:28:15 +01:00
|
|
|
strictDeps = true;
|
|
|
|
|
2015-01-01 18:45:19 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/sigrok-firmware/"
|
|
|
|
tar --strip-components=1 -xvf "${firmware}" -C "$out/share/sigrok-firmware/"
|
|
|
|
'';
|
|
|
|
|
2021-07-29 22:53:32 +01:00
|
|
|
installCheckPhase = ''
|
|
|
|
# assert that c++ bindings are included
|
2021-08-02 21:14:32 +01:00
|
|
|
# note that this is only true for modern (>0.5) versions; the 0.3 series does not have these
|
2021-07-29 22:53:32 +01:00
|
|
|
[[ -f $out/include/libsigrokcxx/libsigrokcxx.hpp ]] \
|
|
|
|
|| { echo 'C++ bindings were not generated; check configure output'; false; }
|
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2014-05-18 21:15:37 +01:00
|
|
|
description = "Core library of the sigrok signal analysis software suite";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://sigrok.org/";
|
2014-05-18 21:15:37 +01:00
|
|
|
license = licenses.gpl3Plus;
|
2019-06-06 00:05:49 +01:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2021-07-29 22:53:32 +01:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2014-05-18 21:15:37 +01:00
|
|
|
};
|
|
|
|
}
|