Merge pull request #230545 from panicgh/pyqt5-modules

python3Packages.{pyqt3d,pyqtchart,pyqtdatavisualization}: init; python3Packages.pyqt5: add options
This commit is contained in:
Sandro 2023-06-21 18:36:25 +02:00 committed by GitHub
commit 0dc60955e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 254 additions and 0 deletions

View File

@ -17,6 +17,8 @@
, withWebKit ? false
, withWebSockets ? false
, withLocation ? false
, withSerialPort ? false
, withTools ? false
}:
buildPythonPackage rec {
@ -86,6 +88,8 @@ buildPythonPackage rec {
++ lib.optional withWebKit qtwebkit
++ lib.optional withWebSockets qtwebsockets
++ lib.optional withLocation qtlocation
++ lib.optional withSerialPort qtserialport
++ lib.optional withTools qttools
;
buildInputs = with libsForQt5; [
@ -99,6 +103,8 @@ buildPythonPackage rec {
++ lib.optional withWebKit qtwebkit
++ lib.optional withWebSockets qtwebsockets
++ lib.optional withLocation qtlocation
++ lib.optional withSerialPort qtserialport
++ lib.optional withTools qttools
;
propagatedBuildInputs = [
@ -130,6 +136,8 @@ buildPythonPackage rec {
++ lib.optional withMultimedia "PyQt5.QtMultimedia"
++ lib.optional withConnectivity "PyQt5.QtBluetooth"
++ lib.optional withLocation "PyQt5.QtPositioning"
++ lib.optional withSerialPort "PyQt5.QtSerialPort"
++ lib.optional withTools "PyQt5.QtDesigner"
;
meta = with lib; {

View File

@ -0,0 +1,77 @@
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pyqt5
, pyqt-builder
, python
, pythonOlder
, qt3d
, setuptools
, sip
}:
buildPythonPackage rec {
pname = "pyqt3d";
version = "5.15.6";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchPypi {
pname = "PyQt3D";
inherit version;
hash = "sha256-fWxtVc2PwiGzE8mVwPhymjdxFJJvA3f46QEdRevziBw=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "[tool.sip.project]" "[tool.sip.project]''\nsip-include-dirs = [\"${pyqt5}/${python.sitePackages}/PyQt5/bindings\"]"
'';
outputs = [ "out" "dev" ];
enableParallelBuilding = true;
# HACK: paralellize compilation of make calls within pyqt's setup.py
# pkgs/stdenv/generic/setup.sh doesn't set this for us because
# make gets called by python code and not its build phase
# format=pyproject means the pip-build-hook hook gets used to build this project
# pkgs/development/interpreters/python/hooks/pip-build-hook.sh
# does not use the enableParallelBuilding flag
preBuild = ''
export MAKEFLAGS+="''${enableParallelBuilding:+-j$NIX_BUILD_CORES}"
'';
dontWrapQtApps = true;
nativeBuildInputs = [
sip
qt3d
setuptools
pyqt-builder
];
buildInputs = [
qt3d
];
propagatedBuildInputs = [
pyqt5
];
dontConfigure = true;
# has no tests
doCheck = false;
pythonImportsCheck = [
"PyQt5.Qt3DCore"
];
meta = with lib; {
description = "Python bindings for the Qt 3D framework";
homepage = "https://riverbankcomputing.com/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ panicgh ];
};
}

View File

@ -0,0 +1,77 @@
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pyqt5
, pyqt-builder
, python
, pythonOlder
, qtcharts
, setuptools
, sip
}:
buildPythonPackage rec {
pname = "pyqtchart";
version = "5.15.6";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchPypi {
pname = "PyQtChart";
inherit version;
hash = "sha256-JpF5b+kqKUphdZKlxcNeeF3JH3dZ3vnrItp532N2Izk=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "[tool.sip.project]" "[tool.sip.project]''\nsip-include-dirs = [\"${pyqt5}/${python.sitePackages}/PyQt5/bindings\"]"
'';
outputs = [ "out" "dev" ];
enableParallelBuilding = true;
# HACK: paralellize compilation of make calls within pyqt's setup.py
# pkgs/stdenv/generic/setup.sh doesn't set this for us because
# make gets called by python code and not its build phase
# format=pyproject means the pip-build-hook hook gets used to build this project
# pkgs/development/interpreters/python/hooks/pip-build-hook.sh
# does not use the enableParallelBuilding flag
preBuild = ''
export MAKEFLAGS+="''${enableParallelBuilding:+-j$NIX_BUILD_CORES}"
'';
dontWrapQtApps = true;
nativeBuildInputs = [
sip
qtcharts
setuptools
pyqt-builder
];
buildInputs = [
qtcharts
];
propagatedBuildInputs = [
pyqt5
];
dontConfigure = true;
# has no tests
doCheck = false;
pythonImportsCheck = [
"PyQt5.QtChart"
];
meta = with lib; {
description = "Python bindings for the Qt Charts library";
homepage = "https://riverbankcomputing.com/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ panicgh ];
};
}

View File

@ -0,0 +1,77 @@
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pyqt5
, pyqt-builder
, python
, pythonOlder
, qtdatavis3d
, setuptools
, sip
}:
buildPythonPackage rec {
pname = "pyqtdatavisualization";
version = "5.15.5";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchPypi {
pname = "PyQtDataVisualization";
inherit version;
hash = "sha256-iSf496pwhX7wDFHj379vg92fOFX0FuDVMVknYcu53H8=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "[tool.sip.project]" "[tool.sip.project]''\nsip-include-dirs = [\"${pyqt5}/${python.sitePackages}/PyQt5/bindings\"]"
'';
outputs = [ "out" "dev" ];
enableParallelBuilding = true;
# HACK: paralellize compilation of make calls within pyqt's setup.py
# pkgs/stdenv/generic/setup.sh doesn't set this for us because
# make gets called by python code and not its build phase
# format=pyproject means the pip-build-hook hook gets used to build this project
# pkgs/development/interpreters/python/hooks/pip-build-hook.sh
# does not use the enableParallelBuilding flag
preBuild = ''
export MAKEFLAGS+="''${enableParallelBuilding:+-j$NIX_BUILD_CORES}"
'';
dontWrapQtApps = true;
nativeBuildInputs = [
sip
qtdatavis3d
setuptools
pyqt-builder
];
buildInputs = [
qtdatavis3d
];
propagatedBuildInputs = [
pyqt5
];
dontConfigure = true;
# has no tests
doCheck = false;
pythonImportsCheck = [
"PyQt5.QtDataVisualization"
];
meta = with lib; {
description = "Python bindings for the Qt Data Visualization library";
homepage = "https://riverbankcomputing.com/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ panicgh ];
};
}

View File

@ -9203,6 +9203,21 @@ self: super: with self; {
pyqt6-webengine = callPackage ../development/python-modules/pyqt6-webengine.nix { };
pyqt3d = pkgs.libsForQt5.callPackage ../development/python-modules/pyqt3d {
inherit (self) buildPythonPackage pyqt5 pyqt-builder python pythonOlder
setuptools sip;
};
pyqtchart = pkgs.libsForQt5.callPackage ../development/python-modules/pyqtchart {
inherit (self) buildPythonPackage pyqt5 pyqt-builder python pythonOlder
setuptools sip;
};
pyqtdatavisualization = pkgs.libsForQt5.callPackage ../development/python-modules/pyqtdatavisualization {
inherit (self) buildPythonPackage pyqt5 pyqt-builder python pythonOlder
setuptools sip;
};
pyqtgraph = callPackage ../development/python-modules/pyqtgraph { };
pyqtwebengine = pkgs.libsForQt5.callPackage ../development/python-modules/pyqtwebengine {