2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2023-05-24 13:37:59 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2020-06-15 15:56:04 +00:00
|
|
|
, colorama
|
|
|
|
, libunwind
|
|
|
|
, pytz
|
2020-04-24 23:36:52 +00:00
|
|
|
, requests
|
|
|
|
, six
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.4.17";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "vmprof";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-ACYj7Lb/QT6deG0uuiPCj850QXhaw4XuQX6aZu8OM2U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
buildInputs = [ libunwind ];
|
|
|
|
propagatedBuildInputs = [ colorama requests six pytz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "${pname}-python-3.10-compat.patch";
|
|
|
|
# https://github.com/vmprof/vmprof-python/pull/198
|
|
|
|
url = "https://github.com/vmprof/vmprof-python/commit/e4e99e5aa677f96d1970d88c8a439f995f429f85.patch";
|
|
|
|
hash = "sha256-W/c6WtVuKi7xO2sCOr71mrZTWqI86bWg5a0FeDNolh0=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "${pname}-python-3.11-compat.patch";
|
|
|
|
# https://github.com/vmprof/vmprof-python/pull/251 (not yet merged)
|
|
|
|
url = "https://github.com/matthiasdiener/vmprof-python/compare/a1a1b5264ec0b197444c0053e44f8ae4ffed9353...13c39166363b960017393b614270befe01230be8.patch";
|
|
|
|
excludes = [ "test_requirements.txt" ];
|
|
|
|
hash = "sha256-3+0PVdAf83McNd93Q9dD4HLXt39UinVU5BA8jWfT6F4=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# No tests included
|
|
|
|
doCheck = false;
|
2020-06-15 15:56:04 +00:00
|
|
|
pythonImportsCheck = [ "vmprof" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: src/vmprof_unix.o:src/vmprof_common.h:92: multiple definition of
|
|
|
|
# `_PyThreadState_Current'; src/_vmprof.o:src/vmprof_common.h:92: first defined here
|
|
|
|
# TODO: can be removed once next release contains:
|
|
|
|
# https://github.com/vmprof/vmprof-python/pull/203
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A vmprof client";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "vmprofshow";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://vmprof.readthedocs.org/";
|
|
|
|
};
|
|
|
|
}
|