depot/third_party/nixpkgs/pkgs/development/python-modules/monotonic/default.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

30 lines
760 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.hostPlatform.isDarwin "/usr/lib/libc.dylib";
patchPhase = lib.optionalString stdenv.hostPlatform.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;
};
}