diff --git a/README.md b/README.md index 871e5143..0fd788de 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ requirements. Supported targets are: - darwin/amd64 + - darwin/arm64 - freebsd/amd64 - freebsd/arm64 - linux/amd64 @@ -21,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 916dc38d..ae8bc38a 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" ) @@ -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 946b9169..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 } @@ -85,14 +85,14 @@ 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 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