mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-14 00:22:08 +08:00
9f0611507e
* probably broke a lot, need the commit though
* finally works
* make it work...
* ...
* kind of works
* better styling
* all should work
* tiny cleanup
* temp
* looks nicer
* create JWT in C++
* kilometers -> km
* use correct free methods
* dont put code in assert statement
* Build JWT payload dynamically
* get dongle id once
* include cleanup
* Remove qDebug
* Update drive_stats.cc
Github is a nice editor :)
* swap week and all and fix sconscript
* install openssl
* openssl include dirs on mac
* is this where openssl is?
* It's here
* small cleanup
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 5b26c97141
104 lines
3.6 KiB
Python
104 lines
3.6 KiB
Python
import os
|
|
Import('env', 'arch', 'real_arch', 'common', 'messaging', 'gpucommon', 'visionipc', 'cereal')
|
|
|
|
qt_env = None
|
|
if arch in ["x86_64", "Darwin", "larch64"]:
|
|
qt_env = env.Clone()
|
|
|
|
if arch == "Darwin":
|
|
qt_env['QTDIR'] = "/usr/local/opt/qt"
|
|
QT_BASE = "/usr/local/opt/qt/"
|
|
qt_dirs = [
|
|
QT_BASE + "include/",
|
|
QT_BASE + "include/QtWidgets",
|
|
QT_BASE + "include/QtGui",
|
|
QT_BASE + "include/QtCore",
|
|
QT_BASE + "include/QtDBus",
|
|
QT_BASE + "include/QtMultimedia",
|
|
QT_BASE + "include/QtNetwork",
|
|
]
|
|
qt_env["LINKFLAGS"] += ["-F" + QT_BASE + "lib"]
|
|
else:
|
|
qt_env['QTDIR'] = "/usr"
|
|
qt_dirs = [
|
|
f"/usr/include/{real_arch}-linux-gnu/qt5",
|
|
f"/usr/include/{real_arch}-linux-gnu/qt5/QtWidgets",
|
|
f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui",
|
|
f"/usr/include/{real_arch}-linux-gnu/qt5/QtCore",
|
|
f"/usr/include/{real_arch}-linux-gnu/qt5/QtDBus",
|
|
f"/usr/include/{real_arch}-linux-gnu/qt5/QtMultimedia",
|
|
f"/usr/include/{real_arch}-linux-gnu/qt5/QtNetwork",
|
|
f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui/5.5.1/QtGui",
|
|
f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui/5.12.8/QtGui",
|
|
]
|
|
|
|
qt_env.Tool('qt')
|
|
qt_env['CPPPATH'] += qt_dirs + ["#selfdrive/ui/qt/"]
|
|
qt_flags = [
|
|
"-D_REENTRANT",
|
|
"-DQT_NO_DEBUG",
|
|
"-DQT_WIDGETS_LIB",
|
|
"-DQT_GUI_LIB",
|
|
"-DQT_CORE_LIB"
|
|
]
|
|
qt_env['CXXFLAGS'] += qt_flags
|
|
qt_env['LIBPATH'] += ['#selfdrive/ui']
|
|
|
|
|
|
src = ['ui.cc', 'paint.cc', 'sidebar.cc', '#phonelibs/nanovg/nanovg.c']
|
|
libs = [common, 'zmq', 'capnp', 'kj', 'm', cereal, messaging, gpucommon, visionipc]
|
|
|
|
|
|
if qt_env is None:
|
|
libs += ['EGL', 'GLESv3', 'gnustl_shared', 'log', 'utils', 'gui', 'hardware',
|
|
'ui', 'CB', 'gsl', 'adreno_utils', 'OpenSLES', 'cutils', 'uuid', 'OpenCL']
|
|
linkflags = ['-Wl,-rpath=/system/lib64,-rpath=/system/comma/usr/lib']
|
|
|
|
src += ["android/ui.cc", "android/sl_sound.cc"]
|
|
env.Program('_ui', src,
|
|
LINKFLAGS=linkflags,
|
|
LIBS=libs)
|
|
else:
|
|
qt_libs = ["pthread", "ssl", "crypto"]
|
|
|
|
qt_modules = ["Widgets", "Gui", "Core", "DBus", "Multimedia", "Network"]
|
|
|
|
if arch == "larch64":
|
|
qt_libs += ["GLESv2", "wayland-client"]
|
|
elif arch != "Darwin":
|
|
qt_libs += ["GL"]
|
|
|
|
if arch == "Darwin":
|
|
qt_env["FRAMEWORKS"] += [f"Qt{m}" for m in qt_modules] + ["OpenGL"]
|
|
else:
|
|
qt_libs += [f"Qt5{m}" for m in qt_modules]
|
|
|
|
|
|
widgets = qt_env.Library("qt_widgets",
|
|
["qt/qt_window.cc", "qt/qt_sound.cc", "qt/widgets/keyboard.cc", "qt/widgets/input_field.cc", "qt/widgets/drive_stats.cc",
|
|
"qt/offroad/wifi.cc", "qt/offroad/wifiManager.cc", "qt/widgets/toggle.cc", "qt/widgets/offroad_alerts.cc"],
|
|
LIBS=qt_libs)
|
|
qt_libs.append(widgets)
|
|
|
|
qt_src = ["qt/ui.cc", "qt/window.cc", "qt/home.cc", "qt/offroad/settings.cc", "qt/offroad/onboarding.cc"] + src
|
|
qt_env.Program("_ui", qt_src, LIBS=qt_libs + libs)
|
|
|
|
# spinner and text window
|
|
qt_env.Program("qt/text", ["qt/text.cc"], LIBS=qt_libs + libs)
|
|
qt_env.Program("qt/spinner", ["qt/spinner.cc"], LIBS=qt_libs + libs)
|
|
|
|
# build setup, factory resetter, and installer
|
|
if "BUILD_SETUP" in os.environ:
|
|
qt_env.Program("qt/setup/reset", ["qt/setup/reset.cc"], LIBS=qt_libs)
|
|
qt_env.Program("qt/setup/setup", ["qt/setup/setup.cc"], LIBS=qt_libs + ['curl', 'common'])
|
|
|
|
installers = [
|
|
("openpilot", "master"),
|
|
("openpilot_test", "master"),
|
|
#("dashcam", "dashcam"),
|
|
#("dashcam_test", "dashcam"),
|
|
]
|
|
for name, branch in installers:
|
|
flags = qt_env["CXXFLAGS"] + [f"-D{branch}"]
|
|
qt_env.Program(f"qt/setup/installer_{name}", ["qt/setup/installer.cc"], LIBS=qt_libs, CXXFLAGS=flags)
|