From f16285d3eccc1d98c76927d65498bfd1fdab2eac Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Thu, 20 Feb 2025 01:56:27 +0100 Subject: [PATCH] libftdi1: Apply nixfmt Signed-off-by: Felix Singer --- pkgs/development/libraries/libftdi/1.x.nix | 90 +++++++++++++--------- 1 file changed, 52 insertions(+), 38 deletions(-) diff --git a/pkgs/development/libraries/libftdi/1.x.nix b/pkgs/development/libraries/libftdi/1.x.nix index 89f3a991e9a3..8d74ed67f2e6 100644 --- a/pkgs/development/libraries/libftdi/1.x.nix +++ b/pkgs/development/libraries/libftdi/1.x.nix @@ -1,19 +1,20 @@ -{ lib -, stdenv -, fetchgit -, fetchpatch -, cmake -, pkg-config -, libusb1 -, libconfuse -, cppSupport ? true -, boost -, pythonSupport ? true -, python3 -, swig -, docSupport ? true -, doxygen -, graphviz +{ + lib, + stdenv, + fetchgit, + fetchpatch, + cmake, + pkg-config, + libusb1, + libconfuse, + cppSupport ? true, + boost, + pythonSupport ? true, + python3, + swig, + docSupport ? true, + doxygen, + graphviz, }: let @@ -42,38 +43,51 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = [ cmake pkg-config ] - ++ optionals docSupport [ doxygen graphviz ] + nativeBuildInputs = + [ + cmake + pkg-config + ] + ++ optionals docSupport [ + doxygen + graphviz + ] ++ optionals pythonSupport [ swig ]; - buildInputs = [ libconfuse ] - ++ optionals cppSupport [ boost ]; + buildInputs = [ libconfuse ] ++ optionals cppSupport [ boost ]; - cmakeFlags = [ - "-DFTDIPP=${onOff cppSupport}" - "-DBUILD_TESTS=${onOff cppSupport}" - "-DLINK_PYTHON_LIBRARY=${onOff pythonSupport}" - "-DPYTHON_BINDINGS=${onOff pythonSupport}" - "-DDOCUMENTATION=${onOff docSupport}" - ] ++ lib.optionals pythonSupport [ - "-DPYTHON_EXECUTABLE=${python3.pythonOnBuildForHost.interpreter}" - "-DPYTHON_LIBRARY=${python3}/lib/libpython${python3.pythonVersion}${stdenv.hostPlatform.extensions.sharedLibrary}" - ]; + cmakeFlags = + [ + "-DFTDIPP=${onOff cppSupport}" + "-DBUILD_TESTS=${onOff cppSupport}" + "-DLINK_PYTHON_LIBRARY=${onOff pythonSupport}" + "-DPYTHON_BINDINGS=${onOff pythonSupport}" + "-DDOCUMENTATION=${onOff docSupport}" + ] + ++ lib.optionals pythonSupport [ + "-DPYTHON_EXECUTABLE=${python3.pythonOnBuildForHost.interpreter}" + "-DPYTHON_LIBRARY=${python3}/lib/libpython${python3.pythonVersion}${stdenv.hostPlatform.extensions.sharedLibrary}" + ]; propagatedBuildInputs = [ libusb1 ]; - postInstall = '' - mkdir -p "$out/etc/udev/rules.d/" - cp ../packages/99-libftdi.rules "$out/etc/udev/rules.d/" - '' + optionalString docSupport '' - cp -r doc/man "$out/share/" - cp -r doc/html "$out/share/doc/libftdi1/" - ''; + postInstall = + '' + mkdir -p "$out/etc/udev/rules.d/" + cp ../packages/99-libftdi.rules "$out/etc/udev/rules.d/" + '' + + optionalString docSupport '' + cp -r doc/man "$out/share/" + cp -r doc/html "$out/share/doc/libftdi1/" + ''; meta = with lib; { description = "Library to talk to FTDI chips using libusb"; homepage = "https://www.intra2net.com/en/developer/libftdi/"; - license = with licenses; [ lgpl2Only gpl2Only ]; + license = with licenses; [ + lgpl2Only + gpl2Only + ]; platforms = platforms.all; maintainers = with maintainers; [ bjornfor ]; };