2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-12-06 16:07:01 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-07-21 07:28:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, scipy
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
2020-11-24 20:58:05 +00:00
|
|
|
, pyqt5
|
2021-07-21 07:28:18 +00:00
|
|
|
, pyopengl
|
|
|
|
, qt5
|
|
|
|
, pytestCheckHook
|
|
|
|
, freefont_ttf
|
|
|
|
, makeFontsConf
|
2023-11-16 04:20:00 +00:00
|
|
|
, setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
let
|
|
|
|
fontsConf = makeFontsConf {
|
|
|
|
fontDirectories = [ freefont_ttf ];
|
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyqtgraph";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.13.4";
|
2023-11-16 04:20:00 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pyqtgraph";
|
|
|
|
repo = "pyqtgraph";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/pyqtgraph-${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-KVgsfvaVbR3eMRNqhJSBO4Hfk7KJgMdsZjKffx6vt84=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
2021-07-21 07:28:18 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
pyqt5
|
|
|
|
scipy
|
|
|
|
pyopengl
|
|
|
|
];
|
2020-11-24 20:58:05 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
preCheck = ''
|
|
|
|
export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
|
|
|
|
export QT_QPA_PLATFORM=offscreen
|
|
|
|
export DYLD_FRAMEWORK_PATH=/System/Library/Frameworks
|
|
|
|
export FONTCONFIG_FILE=${fontsConf}
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# we only want to run unittests
|
|
|
|
"tests"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabledTests = lib.optionals (!stdenv.hostPlatform.isx86) [
|
|
|
|
# small precision-related differences on other architectures,
|
|
|
|
# upstream doesn't consider it serious.
|
|
|
|
# https://github.com/pyqtgraph/pyqtgraph/issues/2110
|
|
|
|
"test_PolyLineROI"
|
2023-03-15 16:39:30 +00:00
|
|
|
] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
|
|
|
|
# https://github.com/pyqtgraph/pyqtgraph/issues/2645
|
|
|
|
"test_rescaleData"
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Scientific Graphics and GUI Library for Python";
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://www.pyqtgraph.org/";
|
2020-11-24 20:58:05 +00:00
|
|
|
changelog = "https://github.com/pyqtgraph/pyqtgraph/blob/master/CHANGELOG";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ koral ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|