summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyqt/5.x.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pyqt/5.x.nix')
-rw-r--r--pkgs/development/python-modules/pyqt/5.x.nix248
1 files changed, 126 insertions, 122 deletions
diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix
index 0af19e2c174e..ed0264c816dd 100644
--- a/pkgs/development/python-modules/pyqt/5.x.nix
+++ b/pkgs/development/python-modules/pyqt/5.x.nix
@@ -1,28 +1,29 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, setuptools
-, isPy27
-, fetchPypi
-, pkg-config
-, dbus
-, lndir
-, dbus-python
-, sip
-, pyqt5-sip
-, pyqt-builder
-, libsForQt5
-, enableVerbose ? true
-, withConnectivity ? false
-, withMultimedia ? false
-, withWebKit ? false
-, withWebSockets ? false
-, withLocation ? false
-, withSerialPort ? false
-, withTools ? false
-, pkgsBuildTarget
-, buildPackages
-, dbusSupport ? !stdenv.isDarwin
+{
+ lib,
+ stdenv,
+ buildPythonPackage,
+ setuptools,
+ isPy27,
+ fetchPypi,
+ pkg-config,
+ dbus,
+ lndir,
+ dbus-python,
+ sip,
+ pyqt5-sip,
+ pyqt-builder,
+ libsForQt5,
+ enableVerbose ? true,
+ withConnectivity ? false,
+ withMultimedia ? false,
+ withWebKit ? false,
+ withWebSockets ? false,
+ withLocation ? false,
+ withSerialPort ? false,
+ withTools ? false,
+ pkgsBuildTarget,
+ buildPackages,
+ dbusSupport ? !stdenv.isDarwin,
}:
buildPythonPackage rec {
@@ -47,52 +48,54 @@ buildPythonPackage rec {
];
postPatch =
- # be more verbose
- ''
- cat >> pyproject.toml <<EOF
- '' + lib.optionalString enableVerbose ''
- [tool.sip.project]
- verbose = true
- ''
- # Due to bug in SIP .whl name generation we have to bump minimal macos sdk upto 11.0 for
- # aarch64-darwin. This patch can be removed once SIP will fix it in upstream,
- # see https://github.com/NixOS/nixpkgs/pull/186612#issuecomment-1214635456.
- + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
- minimum-macos-version = "11.0"
- '' + ''
- EOF
- ''
+ # be more verbose
+ ''
+ cat >> pyproject.toml <<EOF
+ ''
+ + lib.optionalString enableVerbose ''
+ [tool.sip.project]
+ verbose = true
+ ''
+ # Due to bug in SIP .whl name generation we have to bump minimal macos sdk upto 11.0 for
+ # aarch64-darwin. This patch can be removed once SIP will fix it in upstream,
+ # see https://github.com/NixOS/nixpkgs/pull/186612#issuecomment-1214635456.
+ + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
+ minimum-macos-version = "11.0"
+ ''
+ + ''
+ EOF
+ ''
- # pyqt-builder tries to compile *and run* these programs. This
- # is really sad because the only thing they do is print out a
- # flag based on whether or not some compile-time symbol was
- # defined. This could all be done without having to *execute*
- # cross-compiled programs!
- #
- # Here is the complete list of things checked:
- #
- # QT_NO_PRINTDIALOG => PyQt_PrintDialog
- # QT_NO_PRINTER => PyQt_Printer
- # QT_NO_PRINTPREVIEWDIALOG => PyQt_PrintPreviewDialog
- # QT_NO_PRINTPREVIEWWIDGET => PyQt_PrintPreviewWidget
- # QT_NO_SSL => PyQt_SSL
- # QT_SHARED || QT_DLL => shared (otherwise static)
- # QT_NO_PROCESS => PyQt_Process
- # QT_NO_FPU || Q_PROCESSOR_ARM || Q_OS_WINCE => PyQt_qreal_double
- # sizeof (qreal) != sizeof (double) => PyQt_qreal_double
- # !Q_COMPILER_CONSTEXPR !Q_COMPILER_UNIFORM_INIT => PyQt_CONSTEXPR
- # QT_NO_ACCESSIBILITY => PyQt_Accessibility
- # QT_NO_OPENGL => PyQt_OpenGL PyQt_Desktop_OpenGL
- # defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_ES_3) => PyQt_Desktop_OpenGL
- # QT_NO_RAWFONT => PyQt_RawFont
- # QT_NO_SESSIONMANAGER => PyQt_SessionManager
- #
- + lib.optionalString (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) ''
- rm config-tests/cfgtest_QtCore.cpp
- rm config-tests/cfgtest_QtGui.cpp
- rm config-tests/cfgtest_QtNetwork.cpp
- rm config-tests/cfgtest_QtPrintSupport.cpp
- '';
+ # pyqt-builder tries to compile *and run* these programs. This
+ # is really sad because the only thing they do is print out a
+ # flag based on whether or not some compile-time symbol was
+ # defined. This could all be done without having to *execute*
+ # cross-compiled programs!
+ #
+ # Here is the complete list of things checked:
+ #
+ # QT_NO_PRINTDIALOG => PyQt_PrintDialog
+ # QT_NO_PRINTER => PyQt_Printer
+ # QT_NO_PRINTPREVIEWDIALOG => PyQt_PrintPreviewDialog
+ # QT_NO_PRINTPREVIEWWIDGET => PyQt_PrintPreviewWidget
+ # QT_NO_SSL => PyQt_SSL
+ # QT_SHARED || QT_DLL => shared (otherwise static)
+ # QT_NO_PROCESS => PyQt_Process
+ # QT_NO_FPU || Q_PROCESSOR_ARM || Q_OS_WINCE => PyQt_qreal_double
+ # sizeof (qreal) != sizeof (double) => PyQt_qreal_double
+ # !Q_COMPILER_CONSTEXPR !Q_COMPILER_UNIFORM_INIT => PyQt_CONSTEXPR
+ # QT_NO_ACCESSIBILITY => PyQt_Accessibility
+ # QT_NO_OPENGL => PyQt_OpenGL PyQt_Desktop_OpenGL
+ # defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_ES_3) => PyQt_Desktop_OpenGL
+ # QT_NO_RAWFONT => PyQt_RawFont
+ # QT_NO_SESSIONMANAGER => PyQt_SessionManager
+ #
+ + lib.optionalString (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) ''
+ rm config-tests/cfgtest_QtCore.cpp
+ rm config-tests/cfgtest_QtGui.cpp
+ rm config-tests/cfgtest_QtNetwork.cpp
+ rm config-tests/cfgtest_QtPrintSupport.cpp
+ '';
enableParallelBuilding = true;
# HACK: paralellize compilation of make calls within pyqt's setup.py
@@ -106,56 +109,57 @@ buildPythonPackage rec {
'';
# tons of warnings from subpackages, no point in playing whack-a-mole
- env = lib.optionalAttrs (!enableVerbose) {
- NIX_CFLAGS_COMPILE = "-w";
- };
+ env = lib.optionalAttrs (!enableVerbose) { NIX_CFLAGS_COMPILE = "-w"; };
- outputs = [ "out" "dev" ];
+ outputs = [
+ "out"
+ "dev"
+ ];
dontWrapQtApps = true;
- nativeBuildInputs = [
- pkg-config
- ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
- libsForQt5.qmake
- ] ++ [
- setuptools
- lndir
- sip
- ] ++ (with pkgsBuildTarget.targetPackages.libsForQt5; [
- ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
- qmake
- ] ++ [
- qtbase
- qtsvg
- qtdeclarative
- qtwebchannel
- ]
- ++ lib.optional withConnectivity qtconnectivity
- ++ lib.optional withMultimedia qtmultimedia
- ++ lib.optional withWebKit qtwebkit
- ++ lib.optional withWebSockets qtwebsockets
- ++ lib.optional withLocation qtlocation
- ++ lib.optional withSerialPort qtserialport
- ++ lib.optional withTools qttools
- );
+ nativeBuildInputs =
+ [ pkg-config ]
+ ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ libsForQt5.qmake ]
+ ++ [
+ setuptools
+ lndir
+ sip
+ ]
+ ++ (
+ with pkgsBuildTarget.targetPackages.libsForQt5;
+ [ ]
+ ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ qmake ]
+ ++ [
+ qtbase
+ qtsvg
+ qtdeclarative
+ qtwebchannel
+ ]
+ ++ lib.optional withConnectivity qtconnectivity
+ ++ lib.optional withMultimedia qtmultimedia
+ ++ lib.optional withWebKit qtwebkit
+ ++ lib.optional withWebSockets qtwebsockets
+ ++ lib.optional withLocation qtlocation
+ ++ lib.optional withSerialPort qtserialport
+ ++ lib.optional withTools qttools
+ );
- buildInputs = with libsForQt5; [
- dbus
- ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
- qtbase
- ] ++ [
- qtsvg
- qtdeclarative
- pyqt-builder
- ]
+ buildInputs =
+ with libsForQt5;
+ [ dbus ]
+ ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ qtbase ]
+ ++ [
+ qtsvg
+ qtdeclarative
+ pyqt-builder
+ ]
++ lib.optional withConnectivity qtconnectivity
++ lib.optional withWebKit qtwebkit
++ lib.optional withWebSockets qtwebsockets
++ lib.optional withLocation qtlocation
++ lib.optional withSerialPort qtserialport
- ++ lib.optional withTools qttools
- ;
+ ++ lib.optional withTools qttools;
propagatedBuildInputs = [
dbus-python
@@ -178,27 +182,27 @@ buildPythonPackage rec {
# Checked using pythonImportsCheck
doCheck = false;
- pythonImportsCheck = [
- "PyQt5"
- "PyQt5.QtCore"
- "PyQt5.QtQml"
- "PyQt5.QtWidgets"
- "PyQt5.QtGui"
- ]
+ 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.QtBluetooth"
++ lib.optional withLocation "PyQt5.QtPositioning"
++ lib.optional withSerialPort "PyQt5.QtSerialPort"
- ++ lib.optional withTools "PyQt5.QtDesigner"
- ;
+ ++ lib.optional withTools "PyQt5.QtDesigner";
meta = with lib; {
description = "Python bindings for Qt5";
- homepage = "https://riverbankcomputing.com/";
- license = licenses.gpl3Only;
- platforms = platforms.mesaPlatforms;
+ homepage = "https://riverbankcomputing.com/";
+ license = licenses.gpl3Only;
+ platforms = platforms.mesaPlatforms;
maintainers = with maintainers; [ sander ];
};
}