2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, pythonPackages
|
|
|
|
, qscintilla
|
|
|
|
, qtbase
|
2022-01-07 04:07:37 +00:00
|
|
|
, qmake
|
|
|
|
, qtmacextras
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
let
|
2022-01-07 04:07:37 +00:00
|
|
|
inherit (pythonPackages) buildPythonPackage isPy3k python sip sipbuild pyqt5 pyqt-builder;
|
2021-06-28 23:13:55 +00:00
|
|
|
in buildPythonPackage rec {
|
2022-01-07 04:07:37 +00:00
|
|
|
pname = "qscintilla-qt5";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = qscintilla.version;
|
|
|
|
src = qscintilla.src;
|
2022-01-07 04:07:37 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
nativeBuildInputs = [ sip qmake pyqt-builder qscintilla ];
|
|
|
|
buildInputs = [ qtbase ];
|
|
|
|
propagatedBuildInputs = [ pyqt5 ] ++ lib.optionals stdenv.isDarwin [ qtmacextras ];
|
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 = ''
|
2022-01-07 04:07:37 +00:00
|
|
|
cd Python
|
|
|
|
cp pyproject-qt5.toml pyproject.toml
|
|
|
|
echo '[tool.sip.project]' >> pyproject.toml
|
|
|
|
echo 'sip-include-dirs = [ "${pyqt5}/${python.sitePackages}/PyQt5/bindings"]' \
|
|
|
|
>> pyproject.toml
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace project.py \
|
2020-04-24 23:36:52 +00:00
|
|
|
--replace \
|
2022-01-07 04:07:37 +00:00
|
|
|
"if self.project.qsci_external_lib:
|
|
|
|
if self.qsci_features_dir is not None:" \
|
|
|
|
"if self.project.qsci_external_lib:
|
|
|
|
self.builder_settings.append('QT += widgets')
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
self.builder_settings.append('QT += printsupport')
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
if self.qsci_features_dir is not None:"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
build = ''
|
|
|
|
sip-install --qsci-features-dir ${qscintilla}/mkspecs/features \
|
|
|
|
--qsci-include-dir ${qscintilla}/include \
|
|
|
|
--qsci-library-dir ${qscintilla}/lib --api-dir ${qscintilla}/share";
|
|
|
|
'';
|
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/";
|
|
|
|
};
|
|
|
|
}
|