From 4ef15ddf233bddec3ff3c19e0c92bdc0cf75d15d Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 10 Oct 2020 14:00:54 +0100 Subject: [PATCH 1/4] Patching BSD into our package/install scripts --- cmd/fyne/install.go | 2 +- cmd/fyne/package.go | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/cmd/fyne/install.go b/cmd/fyne/install.go index 81109879c2..c5fce41313 100644 --- a/cmd/fyne/install.go +++ b/cmd/fyne/install.go @@ -62,7 +62,7 @@ func (i *installer) install() error { switch p.os { case "darwin": i.installDir = "/Applications" - case "linux": + case "linux", "openbsd", "freebsd", "netbsd": i.installDir = "/" // the tarball contains the structure starting at usr/local case "windows": i.installDir = filepath.Join(os.Getenv("ProgramFiles"), p.name) diff --git a/cmd/fyne/package.go b/cmd/fyne/package.go index 803c98012f..27065ee66e 100644 --- a/cmd/fyne/package.go +++ b/cmd/fyne/package.go @@ -140,18 +140,17 @@ func (p *packager) packageLinux() error { defer os.RemoveAll(filepath.Join(p.dir, tempDir)) makefile, _ := os.Create(filepath.Join(p.dir, tempDir, "Makefile")) - _, err := io.WriteString(makefile, `ifneq ("$(wildcard /usr/local)","")`+"\n"+ - "PREFIX ?= /usr/local\n"+ - "else\n"+ - "PREFIX ?= /usr\n"+ - "endif\n"+ - "\n"+ - "default:\n"+ - ` # Run "sudo make install" to install the application.`+"\n"+ - "install:\n"+ - " install -Dm00644 usr/"+local+"share/applications/"+p.name+`.desktop $(DESTDIR)$(PREFIX)/share/applications/`+p.name+".desktop\n"+ - " install -Dm00755 usr/"+local+"bin/"+filepath.Base(p.exe)+` $(DESTDIR)$(PREFIX)/bin/`+filepath.Base(p.exe)+"\n"+ - " install -Dm00644 usr/"+local+"share/pixmaps/"+p.name+filepath.Ext(p.icon)+` $(DESTDIR)$(PREFIX)/share/pixmaps/`+p.name+filepath.Ext(p.icon)+"\n") + _, err := io.WriteString(makefile, + `LOCAL != test -d /usr/local && echo -n "/local" || echo -n ""`+"\n"+ + `LOCAL ?= $(shell test -d /usr/local && echo "/local" || echo "")`+"\n"+ + "PREFIX ?= /usr$(LOCAL)\n"+ + "\n"+ + "default:\n"+ + ` # Run "sudo make install" to install the application.`+"\n"+ + "install:\n"+ + " install -Dm00644 usr/"+local+"share/applications/"+p.name+`.desktop $(DESTDIR)$(PREFIX)/share/applications/`+p.name+".desktop\n"+ + " install -Dm00755 usr/"+local+"bin/"+filepath.Base(p.exe)+` $(DESTDIR)$(PREFIX)/bin/`+filepath.Base(p.exe)+"\n"+ + " install -Dm00644 usr/"+local+"share/pixmaps/"+p.name+filepath.Ext(p.icon)+` $(DESTDIR)$(PREFIX)/share/pixmaps/`+p.name+filepath.Ext(p.icon)+"\n") if err != nil { return errors.Wrap(err, "Failed to write Makefile string") } @@ -336,7 +335,7 @@ func (p *packager) packageIOS() error { } func (p *packager) addFlags() { - flag.StringVar(&p.os, "os", "", "The operating system to target (android, android/arm, android/arm64, android/amd64, android/386, darwin, ios, linux, windows)") + flag.StringVar(&p.os, "os", "", "The operating system to target (android, android/arm, android/arm64, android/amd64, android/386, darwin, freebsd, ios, linux, netbsd, openbsd, windows)") flag.StringVar(&p.exe, "executable", "", "The path to the executable, default is the current dir main binary") flag.StringVar(&p.srcDir, "sourceDir", "", "The directory to package, if executable is not set") flag.StringVar(&p.name, "name", "", "The name of the application, default is the executable file name") @@ -459,7 +458,7 @@ func (p *packager) doPackage() error { switch p.os { case "darwin": return p.packageDarwin() - case "linux": + case "linux", "openbsd", "freebsd", "netbsd": return p.packageLinux() case "windows": return p.packageWindows() From d20eda1f4960255830a1bf2d23bc7c9ff9d42723 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 10 Oct 2020 15:45:15 +0100 Subject: [PATCH 2/4] Fix to build with BSD until supported upstream --- cmd/fyne/env.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/fyne/env.go b/cmd/fyne/env.go index cd1477d41d..81c498bc27 100644 --- a/cmd/fyne/env.go +++ b/cmd/fyne/env.go @@ -3,6 +3,8 @@ package main import ( "fmt" "os" + "runtime" + "strings" "fyne.io/fyne" @@ -39,9 +41,14 @@ func (v *env) main() { reporters := []goinfo.Reporter{ &fyneReport{GoMod: &report.GoMod{WorkDir: workDir, Module: fyneModule}}, &report.GoVersion{}, - &report.OS{}, - &report.GoEnv{Filter: []string{"GOOS", "GOARCH", "CGO_ENABLED", "GO111MODULE"}}, } + if strings.Index(runtime.GOOS, "bsd") == -1 { + reporters = append(reporters, &report.OS{}) + } + + reporters = append(reporters, + &report.GoEnv{Filter: []string{"GOOS", "GOARCH", "CGO_ENABLED", "GO111MODULE"}}, + ) err = goinfo.Write(os.Stdout, reporters, &format.Text{}) if err != nil { From a5684de9eae75e542463e2a7909b03361bfe4ca9 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 10 Oct 2020 16:07:26 +0100 Subject: [PATCH 3/4] Just remove this report.OS, it is a hard compile error Will get re-instated when library supports our targets --- cmd/fyne/env.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmd/fyne/env.go b/cmd/fyne/env.go index 81c498bc27..19d4dee027 100644 --- a/cmd/fyne/env.go +++ b/cmd/fyne/env.go @@ -3,8 +3,6 @@ package main import ( "fmt" "os" - "runtime" - "strings" "fyne.io/fyne" @@ -41,14 +39,8 @@ func (v *env) main() { reporters := []goinfo.Reporter{ &fyneReport{GoMod: &report.GoMod{WorkDir: workDir, Module: fyneModule}}, &report.GoVersion{}, - } - if strings.Index(runtime.GOOS, "bsd") == -1 { - reporters = append(reporters, &report.OS{}) - } - - reporters = append(reporters, &report.GoEnv{Filter: []string{"GOOS", "GOARCH", "CGO_ENABLED", "GO111MODULE"}}, - ) + } err = goinfo.Write(os.Stdout, reporters, &format.Text{}) if err != nil { From abb7df63e4cc9b3444f03283aa650f2dfd72a77d Mon Sep 17 00:00:00 2001 From: Stuart Scott Date: Sat, 10 Oct 2020 13:33:41 -0700 Subject: [PATCH 4/4] Deprecate WidgetRenderer.BackgroundColor (#1388) --- widget.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widget.go b/widget.go index b30dd4aa78..b4c0fdab98 100644 --- a/widget.go +++ b/widget.go @@ -18,6 +18,10 @@ type Widget interface { // function and should be exactly one instance per widget in memory. type WidgetRenderer interface { // BackgroundColor returns the color that should be used to draw the background of this renderer’s widget. + // + // Deprecated: Widgets will no longer have a background to support hover and selection indication in collection widgets. + // If a widget requires a background color or image, this can be achieved by using a canvas.Rect or canvas.Image + // as the first child of a MaxLayout, followed by the rest of the widget components. BackgroundColor() color.Color // Destroy is for internal use. Destroy()