nixpkgs/pkgs/development/python-modules/pyqt/5.x.nix

121 lines
2.5 KiB
Nix
Raw Normal View History

{ lib
, buildPythonPackage
, isPy27
, fetchPypi
, pkg-config
, dbus
, lndir
, python
, dbus-python
, sip
, pyqt-builder
, libsForQt5
, withConnectivity ? false
, withMultimedia ? false
, withWebKit ? false
, withWebSockets ? false
}:
2014-07-07 07:23:55 +01:00
let
2021-01-07 15:56:39 +00:00
pyqt5_sip = buildPythonPackage rec {
pname = "PyQt5_sip";
2021-04-26 16:19:00 +01:00
version = "12.9.0";
2021-01-07 15:56:39 +00:00
src = fetchPypi {
2021-01-07 15:56:39 +00:00
inherit pname version;
2021-04-26 16:19:00 +01:00
sha256 = "0cmfxb7igahxy74qkq199l6zdxrr75bnxris42fww3ibgjflir6k";
2021-01-07 15:56:39 +00:00
};
# There is no test code and the check phase fails with:
# > error: could not create 'PyQt5/sip.cpython-38-x86_64-linux-gnu.so': No such file or directory
doCheck = false;
};
2018-12-10 21:24:09 +00:00
in buildPythonPackage rec {
2020-04-04 03:49:18 +01:00
pname = "PyQt5";
2021-04-26 16:19:00 +01:00
version = "5.15.4";
format = "pyproject";
disabled = isPy27;
2014-07-07 07:23:55 +01:00
src = fetchPypi {
2020-04-04 03:49:18 +01:00
inherit pname version;
2021-04-26 16:19:00 +01:00
sha256 = "1gp5jz71nmg58zsm1h4vzhcphf36rbz37qgsfnzal76i1mz5js9a";
2014-07-07 07:23:55 +01:00
};
outputs = [ "out" "dev" ];
2017-06-02 16:40:19 +01:00
dontWrapQtApps = true;
nativeBuildInputs = with libsForQt5; [
pkg-config
qmake
lndir
sip
qtbase
qtsvg
qtdeclarative
qtwebchannel
]
++ lib.optional withConnectivity qtconnectivity
++ lib.optional withMultimedia qtmultimedia
++ lib.optional withWebKit qtwebkit
++ lib.optional withWebSockets qtwebsockets
;
buildInputs = with libsForQt5; [
dbus
qtbase
qtsvg
qtdeclarative
pyqt-builder
]
++ lib.optional withConnectivity qtconnectivity
++ lib.optional withWebKit qtwebkit
++ lib.optional withWebSockets qtwebsockets
;
propagatedBuildInputs = [
dbus-python
pyqt5_sip
];
2014-07-07 07:23:55 +01:00
patches = [
# Fix some wrong assumptions by ./project.py
# TODO: figure out how to send this upstream
./pyqt5-fix-dbus-mainloop-support.patch
];
passthru = {
inherit sip;
multimediaEnabled = withMultimedia;
webKitEnabled = withWebKit;
WebSocketsEnabled = withWebSockets;
};
dontConfigure = true;
2014-07-07 07:23:55 +01:00
2021-01-07 15:56:39 +00:00
# Checked using pythonImportsCheck
doCheck = false;
pythonImportsCheck = [
"PyQt5"
"PyQt5.QtCore"
"PyQt5.QtQml"
"PyQt5.QtWidgets"
"PyQt5.QtGui"
]
++ lib.optional withWebSockets "PyQt5.QtWebSockets"
++ lib.optional withWebKit "PyQt5.QtWebKit"
++ lib.optional withMultimedia "PyQt5.QtMultimedia"
++ lib.optional withConnectivity "PyQt5.QtConnectivity"
2021-01-07 15:56:39 +00:00
;
2018-12-10 21:24:09 +00:00
meta = with lib; {
description = "Python bindings for Qt5";
homepage = "https://riverbankcomputing.com/";
license = licenses.gpl3Only;
2018-12-10 21:24:09 +00:00
platforms = platforms.mesaPlatforms;
maintainers = with maintainers; [ sander ];
};
2014-07-07 07:23:55 +01:00
}