mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Check system for user installed Linux dependencies (#1180)
* [linux] Fix discovery of other deps * Update v2/internal/system/system_linux.go Co-authored-by: stffabi <stffabi@users.noreply.github.com> * Try setting locale before running apt * Use LC_ALL * Remove continue Co-authored-by: stffabi <stffabi@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,26 @@ import (
|
||||
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
|
||||
)
|
||||
|
||||
func checkLocallyInstalled(checker func() *packagemanager.Dependancy, dependency *packagemanager.Dependancy) {
|
||||
if !dependency.Installed {
|
||||
locallyInstalled := checker()
|
||||
if locallyInstalled.Installed {
|
||||
dependency.Installed = true
|
||||
dependency.Version = locallyInstalled.Version
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var checkerFunctions = map[string]func() *packagemanager.Dependancy{
|
||||
"npm": checkNPM,
|
||||
"docker": checkDocker,
|
||||
"upx": checkUPX,
|
||||
"gcc": checkGCC,
|
||||
"pkg-config": checkPkgConfig,
|
||||
"libgtk-3": checkLibrary("libgtk-3"),
|
||||
"libwebkit": checkLibrary("libwebkit"),
|
||||
}
|
||||
|
||||
func (i *Info) discover() error {
|
||||
|
||||
var err error
|
||||
@@ -24,26 +44,9 @@ func (i *Info) discover() error {
|
||||
return err
|
||||
}
|
||||
for _, dep := range dependencies {
|
||||
if dep.Name == "npm" {
|
||||
locallyInstalled := checkNPM()
|
||||
if locallyInstalled.Installed {
|
||||
dep.Installed = true
|
||||
dep.Version = locallyInstalled.Version
|
||||
}
|
||||
}
|
||||
if dep.Name == "docker" {
|
||||
locallyInstalled := checkDocker()
|
||||
if locallyInstalled.Installed {
|
||||
dep.Installed = true
|
||||
dep.Version = locallyInstalled.Version
|
||||
}
|
||||
}
|
||||
if dep.Name == "upx" {
|
||||
locallyInstalled := checkUPX()
|
||||
if locallyInstalled.Installed {
|
||||
dep.Installed = true
|
||||
dep.Version = locallyInstalled.Version
|
||||
}
|
||||
checker := checkerFunctions[dep.Name]
|
||||
if checker != nil {
|
||||
checkLocallyInstalled(checker, dep)
|
||||
}
|
||||
if dep.Name == "nsis" {
|
||||
locallyInstalled := checkNSIS()
|
||||
|
||||
Reference in New Issue
Block a user