pythonPackages.qscintilla-qt5: add pythonImportsCheck and disable Python 2 support

This commit is contained in:
Eduardo Sánchez Muñoz 2021-05-18 19:58:36 +02:00
parent 38034013e3
commit d6e728efc2

View file

@ -10,6 +10,8 @@ buildPythonPackage rec {
src = qscintilla.src; src = qscintilla.src;
format = "other"; format = "other";
disabled = !isPy3k;
nativeBuildInputs = [ sip_4 qtbase ]; nativeBuildInputs = [ sip_4 qtbase ];
buildInputs = [ qscintilla ]; buildInputs = [ qscintilla ];
propagatedBuildInputs = [ pyqt5 ]; propagatedBuildInputs = [ pyqt5 ];
@ -23,11 +25,6 @@ buildPythonPackage rec {
"'$out/${python.sitePackages}'" "'$out/${python.sitePackages}'"
''; '';
pyqt5_sip_dir = if isPy3k then
"${pyqt5}/${python.sitePackages}/PyQt5/bindings"
else
"${pyqt5}/share/sip/PyQt5";
preConfigure = '' preConfigure = ''
# configure.py will look for this folder # configure.py will look for this folder
mkdir -p $out/share/sip/PyQt5 mkdir -p $out/share/sip/PyQt5
@ -43,11 +40,21 @@ buildPythonPackage rec {
--qsci-incdir=${qscintilla}/include \ --qsci-incdir=${qscintilla}/include \
--qsci-featuresdir=${qscintilla}/mkspecs/features \ --qsci-featuresdir=${qscintilla}/mkspecs/features \
--qsci-libdir=${qscintilla}/lib \ --qsci-libdir=${qscintilla}/lib \
--pyqt-sipdir=${pyqt5_sip_dir} \ --pyqt-sipdir=${pyqt5}/${python.sitePackages}/PyQt5/bindings \
--qsci-sipdir=$out/share/sip/PyQt5 \ --qsci-sipdir=$out/share/sip/PyQt5 \
--sip-incdir=${sip_4}/include --sip-incdir=${sip_4}/include
''; '';
postInstall = ''
# Needed by pythonImportsCheck to find the module
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
'';
# Checked using pythonImportsCheck
doCheck = false;
pythonImportsCheck = [ "PyQt5.Qsci" ];
meta = with lib; { meta = with lib; {
description = "A Python binding to QScintilla, Qt based text editing control"; description = "A Python binding to QScintilla, Qt based text editing control";
license = licenses.lgpl21Plus; license = licenses.lgpl21Plus;