2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2018-10-17 05:36:07 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "monotonic";
|
2018-11-04 10:35:06 +00:00
|
|
|
version = "1.5";
|
2018-10-17 05:36:07 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-11-04 10:35:06 +00:00
|
|
|
sha256 = "23953d55076df038541e648a53676fb24980f7a1be290cdda21300b3bc21dfb0";
|
2018-10-17 05:36:07 +01:00
|
|
|
};
|
|
|
|
|
2021-01-24 00:29:22 +00:00
|
|
|
__propagatedImpureHostDeps = lib.optional stdenv.isDarwin "/usr/lib/libc.dylib";
|
2018-10-17 05:36:07 +01:00
|
|
|
|
2021-01-24 00:29:22 +00:00
|
|
|
patchPhase = lib.optionalString stdenv.isLinux ''
|
2018-10-17 05:36:07 +01:00
|
|
|
substituteInPlace monotonic.py --replace \
|
|
|
|
"ctypes.util.find_library('c')" "'${stdenv.glibc.out}/lib/libc.so.6'"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-17 05:36:07 +01:00
|
|
|
description = "An implementation of time.monotonic() for Python 2 & < 3.3";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/atdt/monotonic";
|
2018-10-17 05:36:07 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|