2022-08-14 08:12:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, libzip
|
|
|
|
, glib
|
|
|
|
, libusb1
|
|
|
|
, libftdi1
|
|
|
|
, check
|
|
|
|
, libserialport
|
|
|
|
, librevisa
|
|
|
|
, doxygen
|
|
|
|
, glibmm
|
|
|
|
, python
|
|
|
|
, hidapi
|
|
|
|
, libieee1284
|
|
|
|
, bluez
|
2022-08-14 08:12:19 +00:00
|
|
|
, sigrok-firmware-fx2lafw
|
2014-05-18 20:15:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-06-01 15:01:05 +00:00
|
|
|
pname = "libsigrok";
|
2022-08-14 08:12:19 +00:00
|
|
|
version = "0.5.2";
|
2014-05-18 20:15:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-06-01 15:01:05 +00:00
|
|
|
url = "https://sigrok.org/download/source/${pname}/${pname}-${version}.tar.gz";
|
2022-08-14 08:12:19 +00:00
|
|
|
sha256 = "0g6fl684bpqm5p2z4j12c62m45j1dircznjina63w392ns81yd2d";
|
2014-05-18 20:15:37 +00:00
|
|
|
};
|
|
|
|
|
2022-08-14 08:12:19 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-01-19 12:34:13 +00:00
|
|
|
nativeBuildInputs = [ doxygen pkg-config python ];
|
2022-08-14 08:12:19 +00:00
|
|
|
buildInputs = [
|
|
|
|
libzip glib libusb1 libftdi1 check libserialport librevisa glibmm hidapi
|
|
|
|
] ++ lib.optionals stdenv.isLinux [ libieee1284 bluez ];
|
2014-05-18 20:15:37 +00:00
|
|
|
|
2021-07-27 14:28:15 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2015-01-01 18:45:19 +00:00
|
|
|
postInstall = ''
|
2022-08-14 08:12:19 +00:00
|
|
|
mkdir -p $out/etc/udev/rules.d
|
|
|
|
cp contrib/*.rules $out/etc/udev/rules.d
|
|
|
|
|
2015-01-01 18:45:19 +00:00
|
|
|
mkdir -p "$out/share/sigrok-firmware/"
|
2022-08-14 08:12:19 +00:00
|
|
|
cp ${sigrok-firmware-fx2lafw}/share/sigrok-firmware/* "$out/share/sigrok-firmware/"
|
2015-01-01 18:45:19 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-14 08:12:19 +00:00
|
|
|
doInstallCheck = true;
|
2021-07-29 21:53:32 +00:00
|
|
|
installCheckPhase = ''
|
|
|
|
# assert that c++ bindings are included
|
2021-08-02 20:14:32 +00:00
|
|
|
# note that this is only true for modern (>0.5) versions; the 0.3 series does not have these
|
2021-07-29 21:53:32 +00: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 20:15:37 +00:00
|
|
|
description = "Core library of the sigrok signal analysis software suite";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://sigrok.org/";
|
2014-05-18 20:15:37 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2019-06-05 23:05:49 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2021-07-29 21:53:32 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2014-05-18 20:15:37 +00:00
|
|
|
};
|
|
|
|
}
|