libiio: unbreak on darwin

This commit is contained in:
Jiajie Chen 2022-10-26 01:12:34 +08:00
parent 7c9a97cbff
commit a4fc59a477
2 changed files with 11 additions and 3 deletions

View File

@ -11,6 +11,8 @@
, runtimeShell , runtimeShell
, lib , lib
, pkg-config , pkg-config
, CFNetwork
, CoreServices
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -42,12 +44,17 @@ stdenv.mkDerivation rec {
libxml2 libxml2
libusb1 libusb1
avahi avahi
libaio ] ++ lib.optional python.isPy3k python.pkgs.setuptools
] ++ lib.optional python.isPy3k python.pkgs.setuptools; ++ lib.optional stdenv.isLinux libaio
++ lib.optionals stdenv.isDarwin [ CFNetwork CoreServices ];
cmakeFlags = [ cmakeFlags = [
"-DUDEV_RULES_INSTALL_DIR=${placeholder "out"}/lib/udev/rules.d" "-DUDEV_RULES_INSTALL_DIR=${placeholder "out"}/lib/udev/rules.d"
"-DPYTHON_BINDINGS=on" "-DPYTHON_BINDINGS=on"
# osx framework is disabled,
# the linux-like directory structure is used for proper output splitting
"-DOSX_PACKAGE=off"
"-DOSX_FRAMEWORK=off"
]; ];
postPatch = '' postPatch = ''
@ -67,7 +74,7 @@ stdenv.mkDerivation rec {
description = "API for interfacing with the Linux Industrial I/O Subsystem"; description = "API for interfacing with the Linux Industrial I/O Subsystem";
homepage = "https://github.com/analogdevicesinc/libiio"; homepage = "https://github.com/analogdevicesinc/libiio";
license = licenses.lgpl21Plus; license = licenses.lgpl21Plus;
platforms = platforms.linux; platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ thoughtpolice ]; maintainers = with maintainers; [ thoughtpolice ];
}; };
} }

View File

@ -20030,6 +20030,7 @@ with pkgs;
libgxps = callPackage ../development/libraries/libgxps { }; libgxps = callPackage ../development/libraries/libgxps { };
libiio = callPackage ../development/libraries/libiio { libiio = callPackage ../development/libraries/libiio {
inherit (darwin.apple_sdk.frameworks) CFNetwork CoreServices;
python = python3; python = python3;
}; };