2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, python3Packages
|
|
|
|
, fetchPypi
|
2021-06-28 23:13:55 +00:00
|
|
|
, wrapQtAppsHook
|
2023-07-15 17:15:38 +00:00
|
|
|
, qtbase
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "veusz";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.6.2";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchPypi {
|
2021-06-28 23:13:55 +00:00
|
|
|
inherit pname version;
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "whcaxF5LMEJNj8NSYeLpnb5uJboRl+vCQ1WxBrJjldE=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapQtAppsHook
|
|
|
|
python3Packages.sip
|
|
|
|
python3Packages.tomli
|
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
buildInputs = [ qtbase ];
|
|
|
|
|
|
|
|
# veusz is a script and not an ELF-executable, so wrapQtAppsHook will not wrap
|
|
|
|
# it automatically -> we have to do it explicitly
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
preFixup = ''
|
|
|
|
wrapQtApp "$out/bin/veusz"
|
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# pyqt_setuptools.py uses the platlib path from sysconfig, but NixOS doesn't
|
|
|
|
# really have a corresponding path, so patching the location of PyQt5 inplace
|
2021-06-28 23:13:55 +00:00
|
|
|
postPatch = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
substituteInPlace pyqt_setuptools.py \
|
|
|
|
--replace "get_path('platlib')" "'${python3Packages.pyqt5}/${python3Packages.python.sitePackages}'"
|
2021-06-28 23:13:55 +00:00
|
|
|
patchShebangs tests/runselftest.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
# you can find these options at
|
|
|
|
# https://github.com/veusz/veusz/blob/53b99dffa999f2bc41fdc5335d7797ae857c761f/pyqtdistutils.py#L71
|
|
|
|
setupPyBuildFlags = [
|
|
|
|
# veusz tries to find a libinfix and fails without one
|
|
|
|
# but we simply don't need a libinfix, so set it to empty here
|
|
|
|
"--qt-libinfix="
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
numpy
|
|
|
|
pyqt5
|
|
|
|
# optional requirements:
|
|
|
|
dbus-python
|
|
|
|
h5py
|
|
|
|
# astropy -- fails to build on master
|
|
|
|
# optional TODO: add iminuit, pyemf and sampy
|
|
|
|
];
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
wrapQtApp "tests/runselftest.py"
|
|
|
|
QT_QPA_PLATFORM=minimal tests/runselftest.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Scientific plotting and graphing program with a GUI";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "veusz";
|
2021-06-28 23:13:55 +00:00
|
|
|
homepage = "https://veusz.github.io/";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ laikq ];
|
|
|
|
};
|
|
|
|
}
|