feat: Try to load the libs from the system libs first

This commit is contained in:
unknown 2024-08-08 02:21:15 +03:30
parent bf6ebb00fd
commit e76961c2c8
No known key found for this signature in database
GPG Key ID: C2CA486E4F771093

View File

@ -19,8 +19,21 @@ func Launcher() {
cmd := exec.Command("./nekoray", flag.Args()...)
ld_env := "LD_LIBRARY_PATH=" + filepath.Join(wd, "./usr/lib")
qt_plugin_env := "QT_PLUGIN_PATH=" + filepath.Join(wd, "./usr/plugins")
system_ld_env := os.Getenv("LD_LIBRARY_PATH")
ld_env := "LD_LIBRARY_PATH="
if len(system_ld_env) != 0 {
ld_env += system_ld_env + ":"
}
ld_env += "/lib:/usr/lib:/lib64:/usr/lib/x86_64:/usr/local/Qt:/opt/Qt"
ld_env += filepath.Join(wd, "./usr/lib")
system_qt_plugin_env := os.Getenv("QT_PLUGIN_PATH")
qt_plugin_env := "QT_PLUGIN_PATH="
if system_qt_plugin_env != "" {
qt_plugin_env += system_qt_plugin_env + ":"
}
qt_plugin_env += "/usr/lib/qt6/plugins:/usr/lib/x86_64-linux-gnu/qt6/plugins:/usr/lib64/qt6/plugins:/usr/lib/qt/plugins:/usr/lib64/qt/plugins:"
qt_plugin_env += filepath.Join(wd, "./usr/plugins")
// Qt 5.12 abi is usually compatible with system Qt 5.15
// But use package Qt 5.12 by default.