2018-09-13 06:33:57 +02:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
, cmake, flex, bison
|
2018-09-27 02:37:32 +02:00
|
|
|
, libxml2, python
|
2018-09-13 06:33:57 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "libiio-${version}";
|
2019-02-05 09:16:35 +01:00
|
|
|
version = "0.17";
|
2018-09-13 06:33:57 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "analogdevicesinc";
|
|
|
|
repo = "libiio";
|
|
|
|
rev = "refs/tags/v${version}";
|
2019-02-05 09:16:35 +01:00
|
|
|
sha256 = "15lghy0zlq667abs1ggbvmb1qiw7vzhhzkw8dm9vzix4ffma2igg";
|
2018-09-13 06:33:57 +02:00
|
|
|
};
|
|
|
|
|
2018-09-27 02:37:32 +02:00
|
|
|
outputs = [ "out" "lib" "dev" "python" ];
|
2018-09-13 06:33:57 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake flex bison ];
|
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
|
2018-09-27 02:37:32 +02:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $python/lib/${python.libPrefix}/site-packages/
|
|
|
|
touch $python/lib/${python.libPrefix}/site-packages/
|
|
|
|
cp ../bindings/python/iio.py $python/lib/${python.libPrefix}/site-packages/
|
|
|
|
|
|
|
|
substitute ../bindings/python/iio.py $python/lib/${python.libPrefix}/site-packages/iio.py \
|
|
|
|
--replace 'libiio.so.0' $lib/lib/libiio.so.0
|
|
|
|
'';
|
|
|
|
|
2018-09-13 06:33:57 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "API for interfacing with the Linux Industrial I/O Subsystem";
|
|
|
|
homepage = https://github.com/analogdevicesinc/libiio;
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|