pythonPackages.qscintilla-qt5: fix darwin linking

This commit is contained in:
Will Cohen 2021-12-14 16:10:35 -05:00
parent c39ac29724
commit b83d9bd705

View File

@ -17,31 +17,18 @@ in buildPythonPackage rec {
disabled = !isPy3k;
nativeBuildInputs = [ sip qmake pyqt-builder ];
buildInputs = [ qtbase qscintilla ];
nativeBuildInputs = [ sip qmake pyqt-builder qscintilla ];
buildInputs = [ qtbase ];
propagatedBuildInputs = [ pyqt5 ] ++ lib.optional (stdenv.isDarwin) qtmacextras;
dontWrapQtApps = true;
# postPatch = ''
# substituteInPlace Python/configure.py \
# --replace \
# "target_config.py_module_dir" \
# "'$out/${python.sitePackages}'"
# '';
#
qsciFeaturesDir = qscintilla + "/mkspecs/features";
qsciIncludeDir = qscintilla + "/include";
qsciLibraryDir = qscintilla + "/lib";
sipIncludeDirs = pyqt5 + "/" + python.sitePackages + "/PyQt5/bindings";
apiDir = qscintilla + "/share";
postPatch = ''
cd Python
cp pyproject-qt5.toml pyproject.toml
echo '[tool.sip.project]' >> pyproject.toml
echo 'sip-include-dirs = [ "${sipIncludeDirs}"]' >> pyproject.toml
echo 'sip-include-dirs = [ "${pyqt5}/${python.sitePackages}/PyQt5/bindings"]' \
>> pyproject.toml
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace project.py \
--replace \
@ -56,24 +43,12 @@ in buildPythonPackage rec {
'';
dontConfigure = true;
# 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 \
# --pyqt-sipdir=${pyqt5}/${python.sitePackages}/PyQt5/bindings \
# --qsci-sipdir=$out/share/sip/PyQt5 \
# --sip-incdir=${sip}/include
#
build = "sip-install --qsci-features-dir ${qsciFeaturesDir} --qsci-include-dir ${qsciIncludeDir} \
--qsci-library-dir ${qsciLibraryDir} --api-dir ${apiDir}";
build = ''
sip-install --qsci-features-dir ${qscintilla}/mkspecs/features \
--qsci-include-dir ${qscintilla}/include \
--qsci-library-dir ${qscintilla}/lib --api-dir ${qscintilla}/share";
'';
postInstall = ''
# Needed by pythonImportsCheck to find the module
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"