Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.11 66 lines 1.9 kB view raw
1{ lib 2, pythonPackages 3, qscintilla 4, qtbase 5}: 6 7let 8 inherit (pythonPackages) buildPythonPackage isPy3k python sip_4 pyqt5; 9in buildPythonPackage rec { 10 pname = "qscintilla"; 11 version = qscintilla.version; 12 src = qscintilla.src; 13 format = "other"; 14 15 disabled = !isPy3k; 16 17 nativeBuildInputs = [ sip_4 qtbase ]; 18 buildInputs = [ qscintilla ]; 19 propagatedBuildInputs = [ pyqt5 ]; 20 21 dontWrapQtApps = true; 22 23 postPatch = '' 24 substituteInPlace Python/configure.py \ 25 --replace \ 26 "target_config.py_module_dir" \ 27 "'$out/${python.sitePackages}'" 28 ''; 29 30 preConfigure = '' 31 # configure.py will look for this folder 32 mkdir -p $out/share/sip/PyQt5 33 34 cd Python 35 substituteInPlace configure.py \ 36 --replace "qmake = {'CONFIG': 'qscintilla2'}" "qmake = {'CONFIG': 'qscintilla2', 'QT': 'widgets printsupport'}" 37 ${python.executable} ./configure.py \ 38 --pyqt=PyQt5 \ 39 --destdir=$out/${python.sitePackages}/PyQt5 \ 40 --stubsdir=$out/${python.sitePackages}/PyQt5 \ 41 --apidir=$out/api/${python.libPrefix} \ 42 --qsci-incdir=${qscintilla}/include \ 43 --qsci-featuresdir=${qscintilla}/mkspecs/features \ 44 --qsci-libdir=${qscintilla}/lib \ 45 --pyqt-sipdir=${pyqt5}/${python.sitePackages}/PyQt5/bindings \ 46 --qsci-sipdir=$out/share/sip/PyQt5 \ 47 --sip-incdir=${sip_4}/include 48 ''; 49 50 postInstall = '' 51 # Needed by pythonImportsCheck to find the module 52 export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH" 53 ''; 54 55 # Checked using pythonImportsCheck 56 doCheck = false; 57 58 pythonImportsCheck = [ "PyQt5.Qsci" ]; 59 60 meta = with lib; { 61 description = "A Python binding to QScintilla, Qt based text editing control"; 62 license = licenses.lgpl21Plus; 63 maintainers = with maintainers; [ lsix ]; 64 homepage = "https://www.riverbankcomputing.com/software/qscintilla/"; 65 }; 66}