mirror of
https://github.com/taigrr/wails.git
synced 2026-04-14 10:50:53 -07:00
Compare commits
9 Commits
gitbash-fi
...
v0.17.11-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
839815e2fb | ||
|
|
846fe479bf | ||
|
|
62f7070e0c | ||
|
|
dd418b36c2 | ||
|
|
f4f04f2199 | ||
|
|
3a7514bbdc | ||
|
|
213f07fed4 | ||
|
|
ed3ed8aa18 | ||
|
|
d038dca37c |
10
README.md
10
README.md
@@ -46,7 +46,7 @@ Make sure you have the xcode command line tools installed. This can be done by r
|
|||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
#### Ubuntu 18.04, Debian 9, Zorin 15
|
#### Debian 9, Ubuntu 18.04, Zorin 15, Parrot 4.7
|
||||||
|
|
||||||
`sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev`
|
`sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev`
|
||||||
|
|
||||||
@@ -54,13 +54,17 @@ Make sure you have the xcode command line tools installed. This can be done by r
|
|||||||
|
|
||||||
`sudo pacman -S webkit2gtk gtk3`
|
`sudo pacman -S webkit2gtk gtk3`
|
||||||
|
|
||||||
|
#### Centos 7
|
||||||
|
|
||||||
|
`sudo yum install webkitgtk3-devel gtk3-devel`
|
||||||
|
|
||||||
#### Fedora 30
|
#### Fedora 30
|
||||||
|
|
||||||
`sudo yum install webkit2gtk3-devel gtk3-devel`
|
`sudo yum install webkit2gtk3-devel gtk3-devel`
|
||||||
|
|
||||||
#### Centos 7
|
#### Gentoo
|
||||||
|
|
||||||
`sudo yum install webkitgtk3-devel gtk3-devel`
|
`sudo emerge gtk+:3 webkit-gtk`
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
|
|||||||
22
cmd/linux.go
22
cmd/linux.go
@@ -17,22 +17,22 @@ type LinuxDistribution int
|
|||||||
const (
|
const (
|
||||||
// Unknown is the catch-all distro
|
// Unknown is the catch-all distro
|
||||||
Unknown LinuxDistribution = iota
|
Unknown LinuxDistribution = iota
|
||||||
|
// Debian distribution
|
||||||
|
Debian
|
||||||
// Ubuntu distribution
|
// Ubuntu distribution
|
||||||
Ubuntu
|
Ubuntu
|
||||||
// Arch linux distribution
|
// Arch linux distribution
|
||||||
Arch
|
Arch
|
||||||
// RedHat linux distribution
|
|
||||||
RedHat
|
|
||||||
// CentOS linux distribution
|
// CentOS linux distribution
|
||||||
CentOS
|
CentOS
|
||||||
// Fedora linux distribution
|
// Fedora linux distribution
|
||||||
Fedora
|
Fedora
|
||||||
// Debian distribution
|
|
||||||
Debian
|
|
||||||
// Gentoo distribution
|
// Gentoo distribution
|
||||||
Gentoo
|
Gentoo
|
||||||
// Zorin distribution
|
// Zorin distribution
|
||||||
Zorin
|
Zorin
|
||||||
|
// Parrot distribution
|
||||||
|
Parrot
|
||||||
)
|
)
|
||||||
|
|
||||||
// DistroInfo contains all the information relating to a linux distribution
|
// DistroInfo contains all the information relating to a linux distribution
|
||||||
@@ -81,20 +81,22 @@ func GetLinuxDistroInfo() *DistroInfo {
|
|||||||
result.Release = version
|
result.Release = version
|
||||||
result.DiscoveredBy = "/etc/os-release"
|
result.DiscoveredBy = "/etc/os-release"
|
||||||
switch osID {
|
switch osID {
|
||||||
case "fedora":
|
|
||||||
result.Distribution = Fedora
|
|
||||||
case "centos":
|
|
||||||
result.Distribution = CentOS
|
|
||||||
case "arch":
|
|
||||||
result.Distribution = Arch
|
|
||||||
case "debian":
|
case "debian":
|
||||||
result.Distribution = Debian
|
result.Distribution = Debian
|
||||||
case "ubuntu":
|
case "ubuntu":
|
||||||
result.Distribution = Ubuntu
|
result.Distribution = Ubuntu
|
||||||
|
case "arch":
|
||||||
|
result.Distribution = Arch
|
||||||
|
case "fedora":
|
||||||
|
result.Distribution = Fedora
|
||||||
|
case "centos":
|
||||||
|
result.Distribution = CentOS
|
||||||
case "gentoo":
|
case "gentoo":
|
||||||
result.Distribution = Gentoo
|
result.Distribution = Gentoo
|
||||||
case "zorin":
|
case "zorin":
|
||||||
result.Distribution = Zorin
|
result.Distribution = Zorin
|
||||||
|
case "parrot":
|
||||||
|
result.Distribution = Parrot
|
||||||
default:
|
default:
|
||||||
result.Distribution = Unknown
|
result.Distribution = Unknown
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,18 +57,30 @@ func getRequiredProgramsLinux() *Prerequisites {
|
|||||||
result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again"))
|
result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again"))
|
||||||
result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again"))
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again"))
|
||||||
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && sudo apt-get install -y nodejs` and try again"))
|
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && sudo apt-get install -y nodejs` and try again"))
|
||||||
case Zorin:
|
case Arch:
|
||||||
result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again"))
|
result.Add(newPrerequisite("gcc", "Please install with `sudo pacman -S base-devel` and try again"))
|
||||||
result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again"))
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo pacman -S base-devel` and try again"))
|
||||||
result.Add(newPrerequisite("npm", "Please install with `sudo snap install node --channel=12/stable --classic` and try again"))
|
result.Add(newPrerequisite("npm", "Please install with `pacman -S npm nodejs` and try again"))
|
||||||
case Fedora:
|
|
||||||
result.Add(newPrerequisite("gcc", "Please install with `sudo yum install gcc-c++ make` and try again"))
|
|
||||||
result.Add(newPrerequisite("pkg-config", "Please install with `sudo yum install pkgconf-pkg-config` and try again"))
|
|
||||||
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install -y nodejs` and try again"))
|
|
||||||
case CentOS:
|
case CentOS:
|
||||||
result.Add(newPrerequisite("gcc", "Please install with `sudo yum install gcc gcc-c++ make` and try again"))
|
result.Add(newPrerequisite("gcc", "Please install with `sudo yum install gcc gcc-c++ make` and try again"))
|
||||||
result.Add(newPrerequisite("pkg-config", "Please install with `sudo yum install pkgconfig` and try again"))
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo yum install pkgconfig` and try again"))
|
||||||
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install -y nodejs` and try again"))
|
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install -y nodejs` and try again"))
|
||||||
|
case Fedora:
|
||||||
|
result.Add(newPrerequisite("gcc", "Please install with `sudo yum install gcc-c++ make` and try again"))
|
||||||
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo yum install pkgconf-pkg-config` and try again"))
|
||||||
|
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install -y nodejs` and try again"))
|
||||||
|
case Gentoo:
|
||||||
|
result.Add(newPrerequisite("gcc", "Please install with `sudo emerge gcc make` and try again"))
|
||||||
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo emerge pkg-config` and try again"))
|
||||||
|
result.Add(newPrerequisite("npm", "Please install with `sudo emerge nodejs` and try again"))
|
||||||
|
case Zorin:
|
||||||
|
result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again"))
|
||||||
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again"))
|
||||||
|
result.Add(newPrerequisite("npm", "Please install with `sudo snap install node --channel=12/stable --classic` and try again"))
|
||||||
|
case Parrot:
|
||||||
|
result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again"))
|
||||||
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again"))
|
||||||
|
result.Add(newPrerequisite("npm", "Please install with `sudo apt install npm nodejs` and try again"))
|
||||||
default:
|
default:
|
||||||
result.Add(newPrerequisite("gcc", "Please install with your system package manager and try again"))
|
result.Add(newPrerequisite("gcc", "Please install with your system package manager and try again"))
|
||||||
result.Add(newPrerequisite("pkg-config", "Please install with your system package manager and try again"))
|
result.Add(newPrerequisite("pkg-config", "Please install with your system package manager and try again"))
|
||||||
@@ -114,21 +126,24 @@ func getRequiredLibrariesLinux() (*Prerequisites, error) {
|
|||||||
case Ubuntu:
|
case Ubuntu:
|
||||||
result.Add(newPrerequisite("libgtk-3-dev", "Please install with `sudo apt install libgtk-3-dev` and try again"))
|
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"))
|
result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with `sudo apt install libwebkit2gtk-4.0-dev` and try again"))
|
||||||
case 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:
|
case Arch:
|
||||||
result.Add(newPrerequisite("gtk3", "Please install with `sudo pacman -S gtk3` and try again"))
|
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"))
|
result.Add(newPrerequisite("webkit2gtk", "Please install with `sudo pacman -S webkit2gtk` and try again"))
|
||||||
case Fedora:
|
|
||||||
result.Add(newPrerequisite("gtk3-devel", "Please install with `sudo yum install gtk3-devel` and try again"))
|
|
||||||
result.Add(newPrerequisite("webkit2gtk3-devel", "Please install with `sudo yum install webkit2gtk3-devel` and try again"))
|
|
||||||
case CentOS:
|
case CentOS:
|
||||||
result.Add(newPrerequisite("gtk3-devel", "Please install with `sudo yum install gtk3-devel` and try again"))
|
result.Add(newPrerequisite("gtk3-devel", "Please install with `sudo yum install gtk3-devel` and try again"))
|
||||||
result.Add(newPrerequisite("webkitgtk3-devel", "Please install with `sudo yum install webkitgtk3-devel` and try again"))
|
result.Add(newPrerequisite("webkitgtk3-devel", "Please install with `sudo yum install webkitgtk3-devel` and try again"))
|
||||||
|
case Fedora:
|
||||||
|
result.Add(newPrerequisite("gtk3-devel", "Please install with `sudo yum install gtk3-devel` and try again"))
|
||||||
|
result.Add(newPrerequisite("webkit2gtk3-devel", "Please install with `sudo yum install webkit2gtk3-devel` 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 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 Parrot:
|
||||||
|
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"))
|
||||||
default:
|
default:
|
||||||
result.Add(newPrerequisite("libgtk-3-dev", "Please install with your system package manager and try again"))
|
result.Add(newPrerequisite("libgtk-3-dev", "Please install with your system package manager and try again"))
|
||||||
result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with your system package manager and try again"))
|
result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with your system package manager and try again"))
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
|||||||
distroInfo := GetLinuxDistroInfo()
|
distroInfo := GetLinuxDistroInfo()
|
||||||
for _, library := range *requiredLibraries {
|
for _, library := range *requiredLibraries {
|
||||||
switch distroInfo.Distribution {
|
switch distroInfo.Distribution {
|
||||||
case Ubuntu, Zorin, Debian:
|
case Ubuntu, Debian, Zorin, Parrot:
|
||||||
installed, err := DpkgInstalled(library.Name)
|
installed, err := DpkgInstalled(library.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
@@ -294,7 +294,7 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
|||||||
} else {
|
} else {
|
||||||
logger.Green("Library '%s' installed.", library.Name)
|
logger.Green("Library '%s' installed.", library.Name)
|
||||||
}
|
}
|
||||||
case RedHat, Fedora, CentOS:
|
case CentOS, Fedora:
|
||||||
installed, err := RpmInstalled(library.Name)
|
installed, err := RpmInstalled(library.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
// Version - Wails version
|
// Version - Wails version
|
||||||
const Version = "v0.17.9-pre"
|
const Version = "v0.17.11-pre"
|
||||||
|
|||||||
@@ -42,10 +42,12 @@ To help you in this process, we will ask for some information, add Go/Wails deta
|
|||||||
gomodule = "(Not Set)"
|
gomodule = "(Not Set)"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get versions for GCC, node & npm
|
// get version numbers for GCC, node & npm
|
||||||
program := cmd.NewProgramHelper()
|
program := cmd.NewProgramHelper()
|
||||||
|
// string helpers
|
||||||
var gccVersion, nodeVersion, npmVersion string
|
var gccVersion, nodeVersion, npmVersion string
|
||||||
|
|
||||||
|
// choose between OS (mac,linux,win)
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
gcc := program.FindProgram("gcc")
|
gcc := program.FindProgram("gcc")
|
||||||
@@ -54,11 +56,23 @@ To help you in this process, we will ask for some information, add Go/Wails deta
|
|||||||
gccVersion = strings.TrimSpace(stdout)
|
gccVersion = strings.TrimSpace(stdout)
|
||||||
}
|
}
|
||||||
case "linux":
|
case "linux":
|
||||||
gcc := program.FindProgram("gcc")
|
// for linux we have to collect
|
||||||
if gcc != nil {
|
// the distribution name
|
||||||
gccVersion, _, _, _ := gcc.Run("-dumpfullversion")
|
distro := cmd.GetLinuxDistroInfo()
|
||||||
gccVersion = gccVersion[:len(gccVersion)-1]
|
// and use it as nested switch
|
||||||
gccVersion = strings.TrimSpace(gccVersion)
|
switch distro.ID {
|
||||||
|
default: // most supported distros are printing the right result with just 'gcc -dumpversion'
|
||||||
|
gcc := program.FindProgram("gcc")
|
||||||
|
if gcc != nil {
|
||||||
|
stdout, _, _, _ := gcc.Run("-dumpversion")
|
||||||
|
gccVersion = strings.TrimSpace(stdout)
|
||||||
|
}
|
||||||
|
case "fedora", "ubuntu": // except fedora & ubuntu that require 'gcc -dumpfullversion'
|
||||||
|
gcc := program.FindProgram("gcc")
|
||||||
|
if gcc != nil {
|
||||||
|
stdout, _, _, _ := gcc.Run("-dumpfullversion")
|
||||||
|
gccVersion = strings.TrimSpace(stdout)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: windows support
|
// TODO: windows support
|
||||||
|
|||||||
Reference in New Issue
Block a user