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}";
|
2019-05-05 14:12:17 +01:00
|
|
|
version = "0.18";
|
2018-09-13 05:33:57 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "analogdevicesinc";
|
|
|
|
repo = "libiio";
|
|
|
|
rev = "refs/tags/v${version}";
|
2019-05-05 14:12:17 +01:00
|
|
|
sha256 = "1cmg3ipam101iy9yncwz2y48idaqaw4fg7i9i4c8vfjisfcycnkk";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|