From 2fec59fee99d248ec874f3e7e8b542d7169f4bfc Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 4 May 2024 10:39:20 +0200 Subject: [PATCH] python312Packages.pyscard: format with nixfmt --- .../python-modules/pyscard/default.nix | 58 +++++++++---------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/pkgs/development/python-modules/pyscard/default.nix b/pkgs/development/python-modules/pyscard/default.nix index e682a6286e66..3fd9d3c2fbd4 100644 --- a/pkgs/development/python-modules/pyscard/default.nix +++ b/pkgs/development/python-modules/pyscard/default.nix @@ -1,13 +1,14 @@ -{ lib -, stdenv -, fetchFromGitHub -, buildPythonPackage -, setuptools -, pkg-config -, swig -, pcsclite -, PCSC -, pytestCheckHook +{ + lib, + buildPythonPackage, + fetchFromGitHub, + PCSC, + pcsclite, + pkg-config, + pytestCheckHook, + setuptools, + stdenv, + swig, }: let @@ -27,33 +28,28 @@ buildPythonPackage rec { hash = "sha256-DO4Ea+mlrWPpOLI8Eki+03UnsOXEhN2PAl0+gdN5sTo="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - nativeBuildInputs = [ - swig - ] ++ lib.optionals (!withApplePCSC) [ - pkg-config - ]; + nativeBuildInputs = [ swig ] ++ lib.optionals (!withApplePCSC) [ pkg-config ]; buildInputs = if withApplePCSC then [ PCSC ] else [ pcsclite ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; postPatch = - if withApplePCSC then '' - substituteInPlace smartcard/scard/winscarddll.c \ - --replace-fail "/System/Library/Frameworks/PCSC.framework/PCSC" \ - "${PCSC}/Library/Frameworks/PCSC.framework/PCSC" - '' else '' - substituteInPlace setup.py --replace "pkg-config" "$PKG_CONFIG" - substituteInPlace smartcard/scard/winscarddll.c \ - --replace-fail "libpcsclite.so.1" \ - "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}" - ''; + if withApplePCSC then + '' + substituteInPlace smartcard/scard/winscarddll.c \ + --replace-fail "/System/Library/Frameworks/PCSC.framework/PCSC" \ + "${PCSC}/Library/Frameworks/PCSC.framework/PCSC" + '' + else + '' + substituteInPlace setup.py --replace "pkg-config" "$PKG_CONFIG" + substituteInPlace smartcard/scard/winscarddll.c \ + --replace-fail "libpcsclite.so.1" \ + "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}" + ''; preCheck = '' # remove src module, so tests use the installed module instead