13 stdenv.mkDerivation rec {
17 outputs = [ "out" "lib" "dev" "python" ];
19 src = fetchFromGitHub {
20 owner = "analogdevicesinc";
23 sha256 = "0psw67mzysdb8fkh8xpcwicm7z94k8plkcc8ymxyvl6inshq0mc7";
36 ] ++ lib.optional python.isPy3k python.pkgs.setuptools;
39 "-DUDEV_RULES_INSTALL_DIR=${placeholder "out"}/lib/udev/rules.d"
40 "-DPYTHON_BINDINGS=on"
44 # Hardcode path to the shared library into the bindings.
45 sed "s#@libiio@#$lib/lib/libiio${stdenv.hostPlatform.extensions.sharedLibrary}#g" ${./hardcode-library-path.patch} | patch -p1
47 substituteInPlace libiio.rules.cmakein \
48 --replace /bin/sh ${runtimeShell}
52 # Move Python bindings into a separate output.
53 moveToOutput ${python.sitePackages} "$python"
57 description = "API for interfacing with the Linux Industrial I/O Subsystem";
58 homepage = "https://github.com/analogdevicesinc/libiio";
59 license = licenses.lgpl21Plus;
60 platforms = platforms.linux;
61 maintainers = with maintainers; [ thoughtpolice ];