{ buildPythonPackage, lib, setuptools, wheel, sources, sweph-data, }: buildPythonPackage rec { pname = "pyswisseph"; version = sources.pyswisseph.version; format = "setuptools"; src = sources.pyswisseph; nativeBuildInputs = [ setuptools wheel ]; # Disable system library detection to use bundled versions preBuild = '' substituteInPlace setup.py \ --replace-fail "swe_detection = True" "swe_detection = False" \ --replace-fail "sqlite3_detection = True" "sqlite3_detection = False" ''; # Set ephemeris path to use sweph-data postInstall = '' export SE_EPHE_PATH=${sweph-data}/share/sweph/ephe ''; pythonImportsCheck = ["swisseph"]; meta = with lib; { homepage = "https://astrorigin.com/pyswisseph"; description = "Python extension to the Swiss Ephemeris"; license = licenses.agpl3Only; maintainers = with maintainers; [bsima]; }; }