2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pythonPackages,
|
|
|
|
qscintilla,
|
|
|
|
qtbase,
|
|
|
|
qmake,
|
|
|
|
qtmacextras,
|
|
|
|
stdenv,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
let
|
2024-06-05 15:53:02 +00:00
|
|
|
inherit (pythonPackages)
|
|
|
|
buildPythonPackage
|
|
|
|
isPy3k
|
|
|
|
python
|
|
|
|
sip
|
|
|
|
sipbuild
|
|
|
|
pyqt5
|
|
|
|
pyqt-builder
|
|
|
|
;
|
|
|
|
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;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
sip
|
|
|
|
qmake
|
|
|
|
pyqt-builder
|
|
|
|
qscintilla
|
|
|
|
pythonPackages.setuptools
|
|
|
|
];
|
2022-01-07 04:07:37 +00:00
|
|
|
buildInputs = [ qtbase ];
|
2024-09-26 11:04:55 +00:00
|
|
|
propagatedBuildInputs = [ pyqt5 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ qtmacextras ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postPatch =
|
|
|
|
''
|
|
|
|
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
|
|
|
|
''
|
2024-09-26 11:04:55 +00:00
|
|
|
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2024-06-05 15:53:02 +00:00
|
|
|
substituteInPlace project.py \
|
|
|
|
--replace \
|
|
|
|
"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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
self.builder_settings.append('QT += printsupport')
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Python binding to QScintilla, Qt based text editing control";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ lsix ];
|
|
|
|
homepage = "https://www.riverbankcomputing.com/software/qscintilla/";
|
|
|
|
};
|
|
|
|
}
|