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