depot/third_party/nixpkgs/pkgs/development/python-modules/monotonic/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

30 lines
734 B
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
}:
buildPythonPackage rec {
pname = "monotonic";
version = "1.6";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "3a55207bcfed53ddd5c5bae174524062935efed17792e9de2ad0205ce9ad63f7";
};
__propagatedImpureHostDeps = lib.optional stdenv.isDarwin "/usr/lib/libc.dylib";
patchPhase = lib.optionalString stdenv.isLinux ''
substituteInPlace monotonic.py --replace \
"ctypes.util.find_library('c')" "'${stdenv.cc.libc}/lib/libc.so'"
'';
meta = with lib; {
description = "Implementation of time.monotonic() for Python 2 & < 3.3";
homepage = "https://github.com/atdt/monotonic";
license = licenses.asl20;
};
}