2018-09-13 05:33:57 +01:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
, cmake, flex, bison
|
2018-09-27 01:37:32 +01:00
|
|
|
, libxml2, python
|
2018-09-13 05:33:57 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "libiio-${version}";
|
2018-12-15 13:42:32 +00:00
|
|
|
version = "0.16";
|
2018-09-13 05:33:57 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "analogdevicesinc";
|
|
|
|
repo = "libiio";
|
|
|
|
rev = "refs/tags/v${version}";
|
2018-12-15 13:42:32 +00:00
|
|
|
sha256 = "1j27kyizdwawskwg1va894qaw3z5dx5s6cla1rd0ngr9kls88q2h";
|
2018-09-13 05:33:57 +01:00
|
|
|
};
|
|
|
|
|
2018-09-27 01:37:32 +01:00
|
|
|
outputs = [ "out" "lib" "dev" "python" ];
|
2018-09-13 05:33:57 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake flex bison ];
|
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
|
2018-09-27 01:37:32 +01: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 05:33:57 +01: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 ];
|
|
|
|
};
|
|
|
|
}
|