2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
2022-12-17 10:02:37 +00:00
|
|
|
, stdenv
|
2022-10-21 18:38:19 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pkg-config
|
|
|
|
, dbus
|
|
|
|
, lndir
|
|
|
|
, setuptools
|
|
|
|
, dbus-python
|
|
|
|
, sip
|
|
|
|
, pyqt6-sip
|
|
|
|
, pyqt-builder
|
|
|
|
, qt6Packages
|
|
|
|
, pythonOlder
|
|
|
|
, withMultimedia ? true
|
|
|
|
, withWebSockets ? true
|
2023-07-15 17:15:38 +00:00
|
|
|
, withLocation ? true
|
2022-10-21 18:38:19 +00:00
|
|
|
# Not currently part of PyQt6
|
|
|
|
#, withConnectivity ? true
|
2023-04-29 16:46:19 +00:00
|
|
|
, withPrintSupport ? true
|
|
|
|
, cups
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "PyQt6";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "6.5.2";
|
2022-10-21 18:38:19 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-FIfuc1D5/7ZtYKtBdlGSUsKzcXYsvo+DQP2VH2OAEoA=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Fix some wrong assumptions by ./project.py
|
|
|
|
# TODO: figure out how to send this upstream
|
|
|
|
# FIXME: make a version for PyQt6?
|
|
|
|
# ./pyqt5-fix-dbus-mainloop-support.patch
|
|
|
|
# confirm license when installing via pyqt6_sip
|
|
|
|
./pyqt5-confirm-license.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
# be more verbose
|
|
|
|
postPatch = ''
|
|
|
|
cat >> pyproject.toml <<EOF
|
|
|
|
[tool.sip.project]
|
|
|
|
verbose = true
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
|
|
|
postUnpack = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
export MAKEFLAGS+="''${enableParallelBuilding:+-j$NIX_BUILD_CORES}"
|
2022-10-21 18:38:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = with qt6Packages; [
|
|
|
|
pkg-config
|
|
|
|
lndir
|
|
|
|
sip
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtdeclarative
|
|
|
|
qtwebchannel
|
|
|
|
qmake
|
|
|
|
qtquick3d
|
|
|
|
qtquicktimeline
|
|
|
|
]
|
|
|
|
# ++ lib.optional withConnectivity qtconnectivity
|
|
|
|
++ lib.optional withMultimedia qtmultimedia
|
|
|
|
++ lib.optional withWebSockets qtwebsockets
|
2023-07-15 17:15:38 +00:00
|
|
|
++ lib.optional withLocation qtlocation
|
2022-10-21 18:38:19 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
buildInputs = with qt6Packages; [
|
|
|
|
dbus
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtdeclarative
|
|
|
|
pyqt-builder
|
|
|
|
qtquick3d
|
|
|
|
qtquicktimeline
|
|
|
|
]
|
|
|
|
# ++ lib.optional withConnectivity qtconnectivity
|
|
|
|
++ lib.optional withWebSockets qtwebsockets
|
2023-07-15 17:15:38 +00:00
|
|
|
++ lib.optional withLocation qtlocation
|
2022-10-21 18:38:19 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
dbus-python
|
|
|
|
pyqt6-sip
|
|
|
|
setuptools
|
2023-04-29 16:46:19 +00:00
|
|
|
]
|
|
|
|
# ld: library not found for -lcups
|
|
|
|
++ lib.optionals (withPrintSupport && stdenv.isDarwin) [
|
|
|
|
cups
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit sip pyqt6-sip;
|
|
|
|
multimediaEnabled = withMultimedia;
|
|
|
|
WebSocketsEnabled = withWebSockets;
|
|
|
|
};
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
# Checked using pythonImportsCheck, has no tests
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"PyQt6"
|
|
|
|
"PyQt6.QtCore"
|
|
|
|
"PyQt6.QtQml"
|
|
|
|
"PyQt6.QtWidgets"
|
|
|
|
"PyQt6.QtGui"
|
|
|
|
"PyQt6.QtQuick"
|
|
|
|
]
|
|
|
|
++ lib.optional withWebSockets "PyQt6.QtWebSockets"
|
|
|
|
++ lib.optional withMultimedia "PyQt6.QtMultimedia"
|
|
|
|
# ++ lib.optional withConnectivity "PyQt6.QtConnectivity"
|
2023-07-15 17:15:38 +00:00
|
|
|
++ lib.optional withLocation "PyQt6.QtPositioning"
|
2022-10-21 18:38:19 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for Qt6";
|
|
|
|
homepage = "https://riverbankcomputing.com/";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
platforms = platforms.mesaPlatforms;
|
|
|
|
maintainers = with maintainers; [ LunNova ];
|
|
|
|
};
|
|
|
|
}
|