1{ lib
2, pythonPackages
3, qscintilla
4, lndir
5, qtbase
6}:
7with pythonPackages;
8buildPythonPackage {
9 pname = "qscintilla";
10 version = qscintilla.version;
11 src = qscintilla.src;
12 format = "other";
13
14 nativeBuildInputs = [ lndir sip qtbase ];
15 buildInputs = [ qscintilla pyqt5 ];
16
17 postPatch = ''
18 substituteInPlace Python/configure.py \
19 --replace \
20 "target_config.py_module_dir" \
21 "'$out/${python.sitePackages}'"
22 '';
23
24 preConfigure = ''
25 mkdir -p $out
26 lndir ${pyqt5} $out
27 rm -rf "$out/nix-support"
28 cd Python
29 substituteInPlace configure.py \
30 --replace "qmake = {'CONFIG': 'qscintilla2'}" "qmake = {'CONFIG': 'qscintilla2', 'QT': 'widgets printsupport'}"
31 ${python.executable} ./configure.py \
32 --pyqt=PyQt5 \
33 --destdir=$out/${python.sitePackages}/PyQt5 \
34 --stubsdir=$out/${python.sitePackages}/PyQt5 \
35 --apidir=$out/api/${python.libPrefix} \
36 --qsci-incdir=${qscintilla}/include \
37 --qsci-featuresdir=${qscintilla}/mkspecs/features \
38 --qsci-libdir=${qscintilla}/lib \
39 --pyqt-sipdir=${pyqt5}/share/sip/PyQt5 \
40 --qsci-sipdir=$out/share/sip/PyQt5 \
41 --sip-incdir=${sip}/include
42 '';
43
44 meta = with lib; {
45 description = "A Python binding to QScintilla, Qt based text editing control";
46 license = licenses.lgpl21Plus;
47 maintainers = with maintainers; [ lsix ];
48 homepage = https://www.riverbankcomputing.com/software/qscintilla/;
49 };
50}