about summary refs log tree commit diff
path: root/pkgs/development/python-modules/monotonic/default.nix
blob: 46e8e0f35492687fcb8ca02639e4da36fd746a62 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
  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;
  };
}