From c829aa4625a9206e5c15a979485da2fed79bb5ff Mon Sep 17 00:00:00 2001 From: lucor Date: Wed, 31 Mar 2021 20:15:12 +0200 Subject: [PATCH 1/4] Enable darwin arm64 build --- README.md | 1 + internal/command/darwin.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b803b3b0..ab32d348 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ requirements. Supported targets are: - darwin/amd64 + - darwin/arm64 - freebsd/amd64 - linux/amd64 - linux/386 diff --git a/internal/command/darwin.go b/internal/command/darwin.go index 916dc38d..07d147b8 100644 --- a/internal/command/darwin.go +++ b/internal/command/darwin.go @@ -18,7 +18,7 @@ const ( var ( // darwinArchSupported defines the supported target architectures on darwin - darwinArchSupported = []Architecture{ArchAmd64} + darwinArchSupported = []Architecture{ArchAmd64, ArchArm64} // darwinImage is the fyne-cross image for the Darwin OS darwinImage = "fyneio/fyne-cross:1.1-darwin" ) From 1eac6133cc7fe0ced65c2f2dff118e5f6075b752 Mon Sep 17 00:00:00 2001 From: lucor Date: Fri, 9 Apr 2021 19:19:48 +0200 Subject: [PATCH 2/4] Fix typo --- internal/command/darwin_image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/command/darwin_image.go b/internal/command/darwin_image.go index 946b9169..376d9b92 100644 --- a/internal/command/darwin_image.go +++ b/internal/command/darwin_image.go @@ -92,7 +92,7 @@ func (cmd *DarwinImage) Run() error { err = dockerCmd.Run() if err != nil { - return fmt.Errorf("could not package the Fyne app: %v", err) + return fmt.Errorf("could not create the docker darwin image: %v", err) } log.Infof("[✓] Docker image created: %s", darwinImage) return nil From c1f971a95969747c7ec08bb4b20be71b08a4a460 Mon Sep 17 00:00:00 2001 From: lucor Date: Fri, 9 Apr 2021 19:20:20 +0200 Subject: [PATCH 3/4] Force base image pull --- internal/command/darwin_image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/command/darwin_image.go b/internal/command/darwin_image.go index 376d9b92..e9709cff 100644 --- a/internal/command/darwin_image.go +++ b/internal/command/darwin_image.go @@ -85,7 +85,7 @@ func (cmd *DarwinImage) Run() error { log.Info("[i] Building docker image...") // run the command from the host - dockerCmd := exec.Command("docker", "build", "-t", darwinImage, ".") + dockerCmd := exec.Command("docker", "build", "--pull", "-t", darwinImage, ".") dockerCmd.Dir = workDir dockerCmd.Stdout = os.Stdout dockerCmd.Stderr = os.Stderr From ab89c0961519e38d568e31e6ad44c8887f0fd0ad Mon Sep 17 00:00:00 2001 From: lucor Date: Sat, 17 Apr 2021 20:16:54 +0200 Subject: [PATCH 4/4] Make the "--local" flag default for darwin->darwin builds --- README.md | 4 +++- internal/command/command.go | 2 +- internal/command/darwin.go | 2 +- internal/command/darwin_image.go | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 98bf9d00..0fd788de 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,12 @@ Supported targets are: - ios > Note: -> - starting from v1.1.0 the image with the OSX SDK is no more available via docker hub and has to be build manually, see the [Build the darwin image](#build_darwin_image) section below. > - iOS compilation is supported only on darwin hosts. See [fyne pre-requisites](https://developer.fyne.io/started/#prerequisites) for details. > - macOS packaging for public distrubution (release mode) is supported only on darwin hosts. > - windows packaging for public distrubution (release mode) is supported only on windows hosts. +> - starting from v1.1.0: +> - cross-compile from NOT `darwin` (i.e. linux) to `darwin`: the image with the OSX SDK is no more available via docker hub and has to be built manually, see the [Build the darwin image](#build_darwin_image) section below. +> - cross-compile from `darwin` to `darwin` by default will use under the hood the fyne CLI tool and requires Go and the macOS SDK installed on the host. ## Requirements diff --git a/internal/command/command.go b/internal/command/command.go index 2c0a5a35..1459b8ed 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -109,7 +109,7 @@ func printUsage(template string, data interface{}) { func checkFyneBinHost(ctx Context) (string, error) { fyne, err := exec.LookPath("fyne") if err != nil { - return "", fmt.Errorf("missed requirement: fyne. To install: `go get fyne.io/fyne/cmd/fyne` and add $GOPATH/bin to $PATH") + return "", fmt.Errorf("missed requirement: fyne. To install: `go get fyne.io/fyne/v2/cmd/fyne` and add $GOPATH/bin to $PATH") } if ctx.Debug { diff --git a/internal/command/darwin.go b/internal/command/darwin.go index 07d147b8..ae8bc38a 100644 --- a/internal/command/darwin.go +++ b/internal/command/darwin.go @@ -54,7 +54,7 @@ func (cmd *Darwin) Parse(args []string) error { // Add flags to use only on darwin host if runtime.GOOS == darwinOS { - flagSet.BoolVar(&cmd.localBuild, "local", false, "If set uses the fyne CLI tool installed on the host in place of the docker images") + flagSet.BoolVar(&cmd.localBuild, "local", true, "If set uses the fyne CLI tool installed on the host in place of the docker images") } // flags used only in release mode diff --git a/internal/command/darwin_image.go b/internal/command/darwin_image.go index e9709cff..b2dbb569 100644 --- a/internal/command/darwin_image.go +++ b/internal/command/darwin_image.go @@ -13,7 +13,7 @@ import ( "github.com/fyne-io/fyne-cross/internal/volume" ) -// DarwinImage build and package the fyne app for the freebsd OS +// DarwinImage builds the darwin docker image type DarwinImage struct { sdkPath string }