{ lib, python3Packages, }: python3Packages.buildPythonPackage rec { pname = "fatfs"; version = "0.1.2"; format = "setuptools"; src = python3Packages.fetchPypi { inherit pname version; hash = "sha256-gkx2ebxtJcRitGX68Xf4EAlxHP+b8wAbKpH5xb+lxYk="; }; # wrapper.c is pre-generated in the sdist; Cython is not needed at build time. # Patch out setup_requires=['cython'] to prevent setuptools from trying to # fetch it via pip at build time (which fails in the Nix sandbox). postPatch = '' substituteInPlace setup.py \ --replace-fail "setup_requires=['cython']," "" ''; nativeBuildInputs = with python3Packages; [ setuptools ]; doCheck = false; pythonImportsCheck = [ "fatfs" ]; meta = with lib; { description = "Python bindings for ChaN's FatFS, the generic FAT/exFAT filesystem module"; homepage = "https://pypi.org/project/fatfs/"; license = licenses.mit; maintainers = [ ]; }; }