2021-10-28 06:52:43 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, libiio }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libad9361";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.3";
|
2021-10-28 06:52:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "analogdevicesinc";
|
|
|
|
repo = "libad9361-iio";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-9e66qSrKpczatZY9lPAzi/6f7lHChnl2+Pih53oa28Y=";
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
buildInputs = [ libiio ];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2022-10-30 15:09:59 +00:00
|
|
|
# Fix iio include path on darwin to match linux
|
|
|
|
for i in test/*.c; do
|
|
|
|
substituteInPlace $i \
|
|
|
|
--replace 'iio/iio.h' 'iio.h'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "IIO AD9361 library for filter design and handling, multi-chip sync, etc";
|
|
|
|
homepage = "http://analogdevicesinc.github.io/libad9361-iio/";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ sikmir ];
|
2022-10-30 15:09:59 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
}
|