From 3a7514bbdc9e06c3d9993c30afe8f2324be9037c Mon Sep 17 00:00:00 2001 From: bh90210 Date: Wed, 31 Jul 2019 02:54:59 +0300 Subject: [PATCH 1/5] fix: issue report --- cmd/wails/9_issue.go | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index 3bc77977..90df6551 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -42,10 +42,12 @@ To help you in this process, we will ask for some information, add Go/Wails deta gomodule = "(Not Set)" } - // Get versions for GCC, node & npm + // get version numbers for GCC, node & npm program := cmd.NewProgramHelper() + // string helpers var gccVersion, nodeVersion, npmVersion string + // choose between OS (mac,linux,win) switch runtime.GOOS { case "darwin": 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) } case "linux": - gcc := program.FindProgram("gcc") - if gcc != nil { - gccVersion, _, _, _ := gcc.Run("-dumpfullversion") - gccVersion = gccVersion[:len(gccVersion)-1] - gccVersion = strings.TrimSpace(gccVersion) + // for linux we have to + // collect distribution name + distro := cmd.GetLinuxDistroInfo() + // and use it as a nested switch + 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 From f4f04f21995711388ca632163f4b2ea0d986bd83 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Wed, 31 Jul 2019 03:20:08 +0300 Subject: [PATCH 2/5] fix: typo --- cmd/wails/9_issue.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index 90df6551..24d7f64d 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -56,10 +56,10 @@ To help you in this process, we will ask for some information, add Go/Wails deta gccVersion = strings.TrimSpace(stdout) } case "linux": - // for linux we have to - // collect distribution name + // for linux we have to collect + // the distribution name distro := cmd.GetLinuxDistroInfo() - // and use it as a nested switch + // and use it as nested switch switch distro.ID { default: // most supported distros are printing the right result with just 'gcc -dumpversion' gcc := program.FindProgram("gcc") From 62f7070e0cdb11a4ce6713ccb48cd825a376cb6e Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Wed, 31 Jul 2019 18:26:12 +1000 Subject: [PATCH 3/5] chore: hotfix version bump --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 78c1333e..ced7707c 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,4 +1,4 @@ package cmd // Version - Wails version -const Version = "v0.17.9-pre" +const Version = "v0.17.10-pre" From 846fe479bf6e22c7e341d4ad98c752efcee94019 Mon Sep 17 00:00:00 2001 From: "admin_3.exe" Date: Mon, 5 Aug 2019 11:35:04 +0300 Subject: [PATCH 4/5] 179 parrot distributionsupport (#181) * feat: parrot support && git push * feat: parrot support * feat: parrot support * fix: arch support * fix: gentoos support * Update README.md * Update README.md --- README.md | 10 ++++++--- cmd/linux.go | 22 +++++++++++--------- cmd/prerequisites.go | 49 +++++++++++++++++++++++++++++--------------- cmd/system.go | 4 ++-- 4 files changed, 53 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index cb8b94d5..8ec4a7a5 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Make sure you have the xcode command line tools installed. This can be done by r ### 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` @@ -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` +#### Centos 7 + +`sudo yum install webkitgtk3-devel gtk3-devel` + #### Fedora 30 `sudo yum install webkit2gtk3-devel gtk3-devel` -#### Centos 7 +#### Gentoo -`sudo yum install webkitgtk3-devel gtk3-devel` +`sudo emerge gtk+:3 webkit-gtk` ### Windows diff --git a/cmd/linux.go b/cmd/linux.go index 0b8a393f..c949044b 100644 --- a/cmd/linux.go +++ b/cmd/linux.go @@ -17,22 +17,22 @@ type LinuxDistribution int const ( // Unknown is the catch-all distro Unknown LinuxDistribution = iota + // Debian distribution + Debian // Ubuntu distribution Ubuntu // Arch linux distribution Arch - // RedHat linux distribution - RedHat // CentOS linux distribution CentOS // Fedora linux distribution Fedora - // Debian distribution - Debian // Gentoo distribution Gentoo // Zorin distribution Zorin + // Parrot distribution + Parrot ) // DistroInfo contains all the information relating to a linux distribution @@ -81,20 +81,22 @@ func GetLinuxDistroInfo() *DistroInfo { result.Release = version result.DiscoveredBy = "/etc/os-release" switch osID { - case "fedora": - result.Distribution = Fedora - case "centos": - result.Distribution = CentOS - case "arch": - result.Distribution = Arch case "debian": result.Distribution = Debian case "ubuntu": result.Distribution = Ubuntu + case "arch": + result.Distribution = Arch + case "fedora": + result.Distribution = Fedora + case "centos": + result.Distribution = CentOS case "gentoo": result.Distribution = Gentoo case "zorin": result.Distribution = Zorin + case "parrot": + result.Distribution = Parrot default: result.Distribution = Unknown } diff --git a/cmd/prerequisites.go b/cmd/prerequisites.go index e5c7533a..d9fa3e0a 100644 --- a/cmd/prerequisites.go +++ b/cmd/prerequisites.go @@ -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("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")) - 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 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 Arch: + result.Add(newPrerequisite("gcc", "Please install with `sudo pacman -S base-devel` 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 `pacman -S npm nodejs` and try again")) case CentOS: 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("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: 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")) @@ -114,21 +126,24 @@ func getRequiredLibrariesLinux() (*Prerequisites, error) { case Ubuntu: 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 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")) - 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: 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")) + 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: 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")) diff --git a/cmd/system.go b/cmd/system.go index f607a924..c70e7a83 100644 --- a/cmd/system.go +++ b/cmd/system.go @@ -272,7 +272,7 @@ func CheckDependencies(logger *Logger) (bool, error) { distroInfo := GetLinuxDistroInfo() for _, library := range *requiredLibraries { switch distroInfo.Distribution { - case Ubuntu, Zorin, Debian: + case Ubuntu, Debian, Zorin, Parrot: installed, err := DpkgInstalled(library.Name) if err != nil { return false, err @@ -294,7 +294,7 @@ func CheckDependencies(logger *Logger) (bool, error) { } else { logger.Green("Library '%s' installed.", library.Name) } - case RedHat, Fedora, CentOS: + case CentOS, Fedora: installed, err := RpmInstalled(library.Name) if err != nil { return false, err From 839815e2fba945fe5363eb59b51a798df9bcfcc8 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 5 Aug 2019 18:40:34 +1000 Subject: [PATCH 5/5] chore: bump version --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index ced7707c..781e0af0 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,4 +1,4 @@ package cmd // Version - Wails version -const Version = "v0.17.10-pre" +const Version = "v0.17.11-pre"