evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / qscintilla-qt5 / default.nix
blob2ef0d3280f83d791e8f2ad8b583e67cd2ee5a8e4
2   lib,
3   pythonPackages,
4   qscintilla,
5   qtbase,
6   qmake,
7   qtmacextras,
8   stdenv,
9 }:
11 let
12   inherit (pythonPackages)
13     buildPythonPackage
14     isPy3k
15     python
16     sip
17     sipbuild
18     pyqt5
19     pyqt-builder
20     ;
22 buildPythonPackage rec {
23   pname = "qscintilla-qt5";
24   version = qscintilla.version;
25   src = qscintilla.src;
26   format = "pyproject";
28   disabled = !isPy3k;
30   nativeBuildInputs = [
31     sip
32     qmake
33     pyqt-builder
34     qscintilla
35     pythonPackages.setuptools
36   ];
37   buildInputs = [ qtbase ];
38   propagatedBuildInputs = [ pyqt5 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ qtmacextras ];
40   dontWrapQtApps = true;
42   postPatch =
43     ''
44       cd Python
45       cp pyproject-qt5.toml pyproject.toml
46       echo '[tool.sip.project]' >> pyproject.toml
47       echo 'sip-include-dirs = [ "${pyqt5}/${python.sitePackages}/PyQt5/bindings"]' \
48          >> pyproject.toml
49     ''
50     + lib.optionalString stdenv.hostPlatform.isDarwin ''
51       substituteInPlace project.py \
52         --replace \
53         "if self.project.qsci_external_lib:
54                   if self.qsci_features_dir is not None:" \
55         "if self.project.qsci_external_lib:
56                   self.builder_settings.append('QT += widgets')
58                   self.builder_settings.append('QT += printsupport')
60                   if self.qsci_features_dir is not None:"
61     '';
63   dontConfigure = true;
65   build = ''
66     sip-install --qsci-features-dir ${qscintilla}/mkspecs/features \
67     --qsci-include-dir ${qscintilla}/include \
68     --qsci-library-dir ${qscintilla}/lib --api-dir ${qscintilla}/share";
69   '';
70   postInstall = ''
71     # Needed by pythonImportsCheck to find the module
72     export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
73   '';
75   # Checked using pythonImportsCheck
76   doCheck = false;
78   pythonImportsCheck = [ "PyQt5.Qsci" ];
80   meta = with lib; {
81     description = "Python binding to QScintilla, Qt based text editing control";
82     license = licenses.lgpl21Plus;
83     maintainers = with maintainers; [ lsix ];
84     homepage = "https://www.riverbankcomputing.com/software/qscintilla/";
85   };