mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
commit
982d14c049
3 changed files with 32 additions and 0 deletions
18
cmd/linux.go
18
cmd/linux.go
|
|
@ -25,8 +25,11 @@ const (
|
|||
RedHat
|
||||
// Debian distribution
|
||||
Debian
|
||||
// Gentoo distribution
|
||||
Gentoo
|
||||
// Zorin distribution
|
||||
Zorin
|
||||
|
||||
)
|
||||
|
||||
// DistroInfo contains all the information relating to a linux distribution
|
||||
|
|
@ -68,6 +71,8 @@ func GetLinuxDistroInfo() *DistroInfo {
|
|||
result.Distribution = Arch
|
||||
case "Debian":
|
||||
result.Distribution = Debian
|
||||
case "Gentoo":
|
||||
result.Distribution = Gentoo
|
||||
case "Zorin":
|
||||
result.Distribution = Zorin
|
||||
}
|
||||
|
|
@ -117,6 +122,8 @@ func GetLinuxDistroInfo() *DistroInfo {
|
|||
result.Distribution = Arch
|
||||
case "Debian GNU/Linux":
|
||||
result.Distribution = Debian
|
||||
case "Gentoo/Linux":
|
||||
result.Distribution = Gentoo
|
||||
default:
|
||||
result.Distribution = Unknown
|
||||
result.DistributorID = osName
|
||||
|
|
@ -125,6 +132,17 @@ func GetLinuxDistroInfo() *DistroInfo {
|
|||
return result
|
||||
}
|
||||
|
||||
// EqueryInstalled uses equery to see if a package is installed
|
||||
func EqueryInstalled(packageName string) (bool, error) {
|
||||
program := NewProgramHelper()
|
||||
equery := program.FindProgram("equery")
|
||||
if equery == nil {
|
||||
return false, fmt.Errorf("cannont check dependencies: equery not found")
|
||||
}
|
||||
_, _, exitCode, _ := equery.Run("l", packageName)
|
||||
return exitCode == 0, nil
|
||||
}
|
||||
|
||||
// DpkgInstalled uses dpkg to see if a package is installed
|
||||
func DpkgInstalled(packageName string) (bool, error) {
|
||||
program := NewProgramHelper()
|
||||
|
|
|
|||
|
|
@ -96,6 +96,9 @@ func getRequiredLibrariesLinux() (*Prerequisites, error) {
|
|||
case Ubuntu, Debian, Zorin:
|
||||
result.Add(newPrerequisite("libgtk-3-dev", "Please install with `sudo apt install libgtk-3-dev` and try again"))
|
||||
result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with `sudo apt install libwebkit2gtk-4.0-dev` and try again"))
|
||||
case Gentoo:
|
||||
result.Add(newPrerequisite("gtk+:3", "Please install with `sudo emerge gtk+:3` and try again"))
|
||||
result.Add(newPrerequisite("webkit-gtk", "Please install with `sudo emerge webkit-gtk` and try again"))
|
||||
case Arch:
|
||||
result.Add(newPrerequisite("gtk3", "Please install with `sudo pacman -S gtk3` and try again"))
|
||||
result.Add(newPrerequisite("webkit2gtk", "Please install with `sudo pacman -S webkit2gtk` and try again"))
|
||||
|
|
|
|||
|
|
@ -305,6 +305,17 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
|||
} else {
|
||||
logger.Green("Library '%s' installed.", library.Name)
|
||||
}
|
||||
case Gentoo:
|
||||
installed, err := EqueryInstalled(library.Name)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if !installed {
|
||||
errors = true
|
||||
logger.Error("Library '%s' not found. %s", library.Name, library.Help)
|
||||
} else {
|
||||
logger.Green("Library '%s' installed.", library.Name)
|
||||
}
|
||||
default:
|
||||
return false, RequestSupportForDistribution(distroInfo, library.Name)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue