libftdi1: Apply nixfmt

Signed-off-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
Felix Singer
2025-02-21 18:42:20 +01:00
committed by Bjørn Forsman
parent 8238601c27
commit f16285d3ec
+52 -38
View File
@@ -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 ];
};