Now comes to the mess up things:
4.1. Use the following script to let qt@5 recognize those installed kde frameworks, literally, copy those *.pri files:
import subprocess as sp
import os
li = sp.check_output("brew list | grep kf5-", shell=True, text=True).split('\n')
print(li)
for item in li:
item = item.removeprefix('kf5-')
kde_dir = '/usr/local/Cellar/kf5-' + item + '/5.90.0' #version might be different
if os.path.isdir(kde_dir):
pri_dir = kde_dir + '/mkspecs/modules'
for f in os.listdir(pri_dir):
s_path = pri_dir + "/" + f
t_path = qt_dir + f
with open(s_path) as f:
text = f.read();
text = text.replace("$$PWD", pri_dir)
with open(t_path, 'w') as f:
f.write(text)
since `i18n` doesn't have the "kf5-" prefix. Again, version might be different.
4.4. open `/usr/local/Cellar/qt@5/5.15.2_2/mkspecs/modules/qt_KSyntaxHighlighting.pri` and
4.5. change line 8 from
5. Then finally `cargo build` should do its work.
Personally, I'm not feeling good about the python and text-editing things so any improvement are welcome.
Here is how I get things work, but may mess up sth.
cmake
,gmake
,clang
,cargo
or any other compile-related tools.brew install qt@5
brew link qt@5
brew install kde-mac/kde/kf5-ktexteditor
qt@5
recognize those installed kde frameworks, literally, copy those*.pri
files:li = sp.check_output("brew list | grep kf5-", shell=True, text=True).split('\n') print(li)
qt_dir = '/usr/local/Cellar/qt@5/5.15.2_2/mkspecs/modules/'
for item in li: item = item.removeprefix('kf5-') kde_dir = '/usr/local/Cellar/kf5-' + item + '/5.90.0' #version might be different if os.path.isdir(kde_dir): pri_dir = kde_dir + '/mkspecs/modules' for f in os.listdir(pri_dir): s_path = pri_dir + "/" + f t_path = qt_dir + f with open(s_path) as f: text = f.read(); text = text.replace("$$PWD", pri_dir) with open(t_path, 'w') as f: f.write(text)
cp /usr/local/Cellar/ki18n/5.91.0/mkspecs/modules/qt_KI18n.pri /usr/local/Cellar/qt@5/5.15.2_2/mkspecs/modules
QT.KSyntaxHighlighting.includes = /usr/local/Cellar/kf5-syntax-highlighting/5.90.0/mkspecs/modules/../../include/KF5/KSyntaxHighlighting
QT.KSyntaxHighlighting.includes = /usr/local/Cellar/kf5-syntax-highlighting/5.90.0/mkspecs/modules/../../include/KF5
QT += KSyntaxHighlighting
QT += widgets QT += KTextEditor QT += KWidgetsAddons QT += KSyntaxHighlighting # <- add here TARGET = qt_subclasses