Compare commits

...

11 Commits

Author SHA1 Message Date
Adrian Lanzafame
b015f27e14 add archlinux support 2019-05-02 13:35:34 +10:00
Lea Anthony
67a1f23b13 Merge pull request #72 from qaisjp/patch-1
Fix HTML spellings
2019-05-01 20:53:28 +10:00
Qais Patankar
9c98a7a9e3 Fix HTML spelling in README.md 2019-05-01 03:06:56 +01:00
Qais Patankar
5aa5ad8ad3 Fix HTML spelling in app_config.go 2019-05-01 03:06:19 +01:00
Lea Anthony
ac203ec931 version bump 2019-04-30 08:30:46 +10:00
Lea Anthony
3fd73186f4 Version bump 2019-04-30 08:22:18 +10:00
Lea Anthony
46307469e5 Updated Readme 2019-04-29 23:23:29 +10:00
Lea Anthony
31a67f3aed Add Hound badge 2019-04-29 18:43:27 +10:00
Lea Anthony
44919d2750 dialog errors -> warnings 2019-04-27 10:16:12 +10:00
Lea Anthony
cff87c641b update bridge warning messages 2019-04-27 10:14:08 +10:00
Lea Anthony
abbd71d057 Merge pull request #71 from wailsapp/replace-wailsbridge-when-serving
always install bridge on serve
2019-04-27 09:30:33 +10:00
7 changed files with 69 additions and 15 deletions

View File

@@ -8,6 +8,7 @@
<a href="http://godoc.org/github.com/wailsapp/wails"><img src="https://img.shields.io/badge/godoc-reference-blue.svg"/></a> <a href="http://godoc.org/github.com/wailsapp/wails"><img src="https://img.shields.io/badge/godoc-reference-blue.svg"/></a>
<a href="https://www.codefactor.io/repository/github/wailsapp/wails"><img src="https://www.codefactor.io/repository/github/wailsapp/wails/badge" alt="CodeFactor" /></a> <a href="https://www.codefactor.io/repository/github/wailsapp/wails"><img src="https://www.codefactor.io/repository/github/wailsapp/wails/badge" alt="CodeFactor" /></a>
<a href="https://github.com/wailsapp/wails/issues"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" /></a> <a href="https://github.com/wailsapp/wails/issues"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" /></a>
<a href="https://houndci.com"><img src="https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg"/></a>
</p> </p>
The traditional method of providing web interfaces to Go programs is via a built-in web server. Wails offers a different approach: it provides the ability to wrap both Go code and a web frontend into a single binary. Tools are provided to make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative! The traditional method of providing web interfaces to Go programs is via a built-in web server. Wails offers a different approach: it provides the ability to wrap both Go code and a web frontend into a single binary. Tools are provided to make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative!
@@ -23,6 +24,10 @@ The traditional method of providing web interfaces to Go programs is via a built
- Powerful cli tool - Powerful cli tool
- Multiplatform - Multiplatform
## Project Status
Wails is currently in Beta. Please make sure you read the [Project Status](https://wails.app/project_status.html) if you are interested in using this project.
## Installation ## Installation
Wails uses cgo to bind to the native rendering engines so a number of platform dependent libraries are needed as well as an installation of Go. The basic requirements are: Wails uses cgo to bind to the native rendering engines so a number of platform dependent libraries are needed as well as an installation of Go. The basic requirements are:
@@ -68,17 +73,37 @@ It is recommended at this stage to read the comprehensive documentation at [http
* Who is this project aimed at? * Who is this project aimed at?
Go programmers who want to bundle an HMTL frontend with their applications, without resorting to creating a server and opening a browser to view it. Go programmers who want to bundle an HTML/JS/CSS frontend with their applications, without resorting to creating a server and opening a browser to view it.
* What's with the name?
When I saw WebView, I thought "What I really want is tooling around building a WebView app, a bit like Rails is to Ruby". So initially it was a play on words (Webview on Rails). It just so happened to also be a homophone of the English name for the [Country](https://en.wikipedia.org/wiki/Wales) I am from. So it stuck.
## Shoulders of Giants ## Shoulders of Giants
Without the following people, this project would never have existed: Without the following people, this project would never have existed:
* [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - His support and feedback has been immense. More patience than you can throw a stick at. * [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - His support and feedback has been immense. More patience than you can throw a stick at (Not long now Dustin!).
* [Serge Zaitsev](https://github.com/zserge) - Creator of [Webview](https://github.com/zserge/webview) which Wails uses for the windowing. * [Serge Zaitsev](https://github.com/zserge) - Creator of [Webview](https://github.com/zserge/webview) which Wails uses for the windowing.
Special Mentions: Special Mentions:
* [Bill Kennedy](https://twitter.com/goinggodotnet) - Go guru, encourager and all-round nice guy, whose energy and inspiration powered me on when I had none left. * [Bill Kennedy](https://twitter.com/goinggodotnet) - Go guru, encourager and all-round nice guy, whose infectious energy and inspiration powered me on when I had none left.
* [Mark Bates](https://github.com/markbates) - Creator of [Packr](https://github.com/gobuffalo/packr), inspiration for packing strategies. * [Mark Bates](https://github.com/markbates) - Creator of [Packr](https://github.com/gobuffalo/packr), inspiration for packing strategies which fed into some of the tooling.
This project was mainly coded to the following albums:
* [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
* [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
* [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
* [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
* [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
* [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
* [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
* [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
* [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
* [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
* [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
* [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
* [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)

View File

@@ -41,7 +41,7 @@ func (a *AppConfig) merge(in *AppConfig) error {
a.HTML = strings.TrimSpace(inlineHTML) a.HTML = strings.TrimSpace(inlineHTML)
// Deduce whether this is a full html page or a fragment // Deduce whether this is a full html page or a fragment
// The document is determined to be a fragment if an HMTL // The document is determined to be a fragment if an HTML
// tag exists and is located before the first div tag // tag exists and is located before the first div tag
HTMLTagIndex := strings.Index(a.HTML, "<html") HTMLTagIndex := strings.Index(a.HTML, "<html")
DivTagIndex := strings.Index(a.HTML, "<div") DivTagIndex := strings.Index(a.HTML, "<div")

View File

@@ -10,9 +10,11 @@ type LinuxDistribution int
const ( const (
// Unknown is the catch-all distro // Unknown is the catch-all distro
Unknown LinuxDistribution = 0 Unknown LinuxDistribution = iota
// Ubuntu distribution // Ubuntu distribution
Ubuntu LinuxDistribution = 1 Ubuntu
// Arch linux distribution
Arch
) )
// DistroInfo contains all the information relating to a linux distribution // DistroInfo contains all the information relating to a linux distribution
@@ -49,6 +51,8 @@ func GetLinuxDistroInfo() *DistroInfo {
switch value { switch value {
case "Ubuntu": case "Ubuntu":
result.Distribution = Ubuntu result.Distribution = Ubuntu
case "Arch":
result.Distribution = Arch
} }
case "Description": case "Description":
result.Description = value result.Description = value
@@ -75,3 +79,14 @@ func DpkgInstalled(packageName string) (bool, error) {
_, _, exitCode, _ := dpkg.Run("-L", packageName) _, _, exitCode, _ := dpkg.Run("-L", packageName)
return exitCode == 0, nil return exitCode == 0, nil
} }
// PacmanInstalled uses pacman to see if a package is installed.
func PacmanInstalled(packageName string) (bool, error) {
program := NewProgramHelper()
pacman := program.FindProgram("pacman")
if pacman == nil {
return false, fmt.Errorf("cannot check dependencies: pacman not found")
}
_, _, exitCode, _ := pacman.Run("-Qs", packageName)
return exitCode == 0, nil
}

View File

@@ -97,6 +97,9 @@ 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 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"))
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"))

View File

@@ -272,6 +272,17 @@ func CheckDependencies(logger *Logger) (bool, error) {
} else { } else {
logger.Green("Library '%s' installed.", library.Name) logger.Green("Library '%s' installed.", library.Name)
} }
case Arch:
installed, err := PacmanInstalled(library.Name)
if err != nil {
return false, err
}
if !installed {
errors = true
logger.Red("Library '%s' not found. %s", library.Name, library.Help)
} else {
logger.Green("Library '%s' installed.", library.Name)
}
default: default:
return false, fmt.Errorf("unable to check libraries on distribution '%s'. Please ensure that the '%s' equivalent is installed", distroInfo.DistributorID, library.Name) return false, fmt.Errorf("unable to check libraries on distribution '%s'. Please ensure that the '%s' equivalent is installed", distroInfo.DistributorID, library.Name)
} }

View File

@@ -1,4 +1,4 @@
package cmd package cmd
// Version - Wails version // Version - Wails version
const Version = "v0.11.7" const Version = "v0.11.9"

View File

@@ -172,21 +172,21 @@ func (h *Headless) NewBinding(methodName string) error {
// SelectFile is unsupported for Headless but required // SelectFile is unsupported for Headless but required
// for the Renderer interface // for the Renderer interface
func (h *Headless) SelectFile() string { func (h *Headless) SelectFile() string {
h.log.Error("SelectFile() unsupported in headless mode") h.log.Warn("SelectFile() unsupported in bridge mode")
return "" return ""
} }
// SelectDirectory is unsupported for Headless but required // SelectDirectory is unsupported for Headless but required
// for the Renderer interface // for the Renderer interface
func (h *Headless) SelectDirectory() string { func (h *Headless) SelectDirectory() string {
h.log.Error("SelectDirectory() unsupported in headless mode") h.log.Warn("SelectDirectory() unsupported in bridge mode")
return "" return ""
} }
// SelectSaveFile is unsupported for Headless but required // SelectSaveFile is unsupported for Headless but required
// for the Renderer interface // for the Renderer interface
func (h *Headless) SelectSaveFile() string { func (h *Headless) SelectSaveFile() string {
h.log.Error("SelectSaveFile() unsupported in headless mode") h.log.Warn("SelectSaveFile() unsupported in bridge mode")
return "" return ""
} }
@@ -245,23 +245,23 @@ func (h *Headless) SetColour(colour string) error {
// Fullscreen is unsupported for Headless but required // Fullscreen is unsupported for Headless but required
// for the Renderer interface // for the Renderer interface
func (h *Headless) Fullscreen() { func (h *Headless) Fullscreen() {
h.log.Warn("Fullscreen() unsupported in headless mode") h.log.Warn("Fullscreen() unsupported in bridge mode")
} }
// UnFullscreen is unsupported for Headless but required // UnFullscreen is unsupported for Headless but required
// for the Renderer interface // for the Renderer interface
func (h *Headless) UnFullscreen() { func (h *Headless) UnFullscreen() {
h.log.Warn("UnFullscreen() unsupported in headless mode") h.log.Warn("UnFullscreen() unsupported in bridge mode")
} }
// SetTitle is currently unsupported for Headless but required // SetTitle is currently unsupported for Headless but required
// for the Renderer interface // for the Renderer interface
func (h *Headless) SetTitle(title string) { func (h *Headless) SetTitle(title string) {
h.log.WarnFields("SetTitle() unsupported in headless mode", Fields{"title": title}) h.log.WarnFields("SetTitle() unsupported in bridge mode", Fields{"title": title})
} }
// Close is unsupported for Headless but required // Close is unsupported for Headless but required
// for the Renderer interface // for the Renderer interface
func (h *Headless) Close() { func (h *Headless) Close() {
h.log.Warn("Close() unsupported in headless mode") h.log.Warn("Close() unsupported in bridge mode")
} }