2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, pythonPackages
|
|
|
|
, qscintilla
|
|
|
|
, qtbase
|
|
|
|
}:
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pythonPackages) buildPythonPackage isPy3k python sip_4 pyqt5;
|
|
|
|
in buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "qscintilla";
|
|
|
|
version = qscintilla.version;
|
|
|
|
src = qscintilla.src;
|
|
|
|
format = "other";
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [ sip_4 qtbase ];
|
2020-07-18 16:06:22 +00:00
|
|
|
buildInputs = [ qscintilla ];
|
|
|
|
propagatedBuildInputs = [ pyqt5 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Python/configure.py \
|
|
|
|
--replace \
|
|
|
|
"target_config.py_module_dir" \
|
|
|
|
"'$out/${python.sitePackages}'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
2020-07-18 16:06:22 +00:00
|
|
|
# configure.py will look for this folder
|
|
|
|
mkdir -p $out/share/sip/PyQt5
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cd Python
|
|
|
|
substituteInPlace configure.py \
|
|
|
|
--replace "qmake = {'CONFIG': 'qscintilla2'}" "qmake = {'CONFIG': 'qscintilla2', 'QT': 'widgets printsupport'}"
|
|
|
|
${python.executable} ./configure.py \
|
|
|
|
--pyqt=PyQt5 \
|
|
|
|
--destdir=$out/${python.sitePackages}/PyQt5 \
|
|
|
|
--stubsdir=$out/${python.sitePackages}/PyQt5 \
|
|
|
|
--apidir=$out/api/${python.libPrefix} \
|
|
|
|
--qsci-incdir=${qscintilla}/include \
|
|
|
|
--qsci-featuresdir=${qscintilla}/mkspecs/features \
|
|
|
|
--qsci-libdir=${qscintilla}/lib \
|
2021-06-28 23:13:55 +00:00
|
|
|
--pyqt-sipdir=${pyqt5}/${python.sitePackages}/PyQt5/bindings \
|
2020-04-24 23:36:52 +00:00
|
|
|
--qsci-sipdir=$out/share/sip/PyQt5 \
|
2021-05-20 23:08:51 +00:00
|
|
|
--sip-incdir=${sip_4}/include
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
postInstall = ''
|
|
|
|
# Needed by pythonImportsCheck to find the module
|
|
|
|
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Checked using pythonImportsCheck
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "PyQt5.Qsci" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A Python binding to QScintilla, Qt based text editing control";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ lsix ];
|
|
|
|
homepage = "https://www.riverbankcomputing.com/software/qscintilla/";
|
|
|
|
};
|
|
|
|
}
|