• Stars
    star
    237
  • Rank 169,885 (Top 4 %)
  • Language
    Go
  • License
    BSD 3-Clause "New...
  • Created about 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cross compiler tool for Fyne apps

Fyne Cross

CI Go Report Card GoDoc version

fyne-cross is a simple tool to cross compile and create distribution packages for Fyne applications using docker images that include Linux, the MinGW compiler for Windows, FreeBSD, and a macOS SDK, along with the Fyne requirements.

Supported targets are:

  • darwin/amd64
  • darwin/arm64
  • freebsd/amd64
  • freebsd/arm64
  • linux/amd64
  • linux/386
  • linux/arm
  • linux/arm64
  • windows/amd64
  • windows/arm64
  • windows/386
  • android (multiple architectures)
  • android/386
  • android/amd64
  • android/arm
  • android/arm64
  • ios

Note:

  • iOS compilation is supported only on darwin hosts. See fyne pre-requisites 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: requires a copy of the macOS SDK on the host. The fyne-cross darwin-sdk-extractor command can be used to extract the SDK from the XCode CLI Tool file, see the Extract the macOS SDK 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.
  • starting from v1.4.0, Arm64 hosts are supported for all platforms except Android.

Requirements

  • go >= 1.14
  • docker

Installation

For go >= 1.16:

go install github.com/fyne-io/fyne-cross@latest

To install a fyne-cross with kubernetes engine support:

go install -tags k8s github.com/fyne-io/fyne-cross@latest

For older go:

GO111MODULE=on go get -u github.com/fyne-io/fyne-cross

fyne-cross will be installed in GOPATH/bin, unless GOBIN is set.

Updating docker images

To update to a newer docker image the --pull flag can be specified. If set, fyne-cross will attempt to pull the image required to cross compile the application for the specified target.

For example:

fyne-cross linux --pull

will pull only the fyne-cross:base-latest image required to cross compile for linux target.

Usage

fyne-cross <command> [options]

The commands are:

	darwin        Build and package a fyne application for the darwin OS
	linux         Build and package a fyne application for the linux OS
	windows       Build and package a fyne application for the windows OS
	android       Build and package a fyne application for the android OS
	ios           Build and package a fyne application for the iOS OS
	freebsd       Build and package a fyne application for the freebsd OS
	version       Print the fyne-cross version information

Use "fyne-cross <command> -help" for more information about a command.

Wildcards

The arch flag support wildcards in case want to compile against all supported GOARCH for a specified GOOS

Example:

fyne-cross windows -arch=*

is equivalent to

fyne-cross windows -arch=amd64,386

Example

The example below cross compile and package the fyne examples application

git clone https://github.com/fyne-io/examples.git
cd examples

Compile and package the main example app

fyne-cross linux

Note: by default fyne-cross will compile the package into the current dir.

The command above is equivalent to: fyne-cross linux .

Compile and package a particular example app

fyne-cross linux -output bugs ./cmd/bugs

Extract the macOS SDK for OSX/Darwin/Apple cross-compiling

cross-compile from NOT darwin (i.e. linux) to darwin requires a copy of the macOS SDK on the host. The fyne-cross darwin-sdk-extractor command can be used to extract the SDK from the XCode CLI Tool file.

Please ensure you have read and understood the Xcode license terms before continuing.

To extract the SDKs:

  1. Download Command Line Tools for Xcode >= 12.4 (macOS SDK 11.x)
  2. Run: fyne-cross darwin-sdk-extract --xcode-path /path/to/Command_Line_Tools_for_Xcode_12.5.dmg

Contribute

  • Fork and clone the repository
  • Make and test your changes
  • Open a pull request against the develop branch

Contributors

See contributors page

Credits

  • osxcross for the macOS Cross toolchain for Linux
  • golang-cross for the inspiration and the docker images used in the initial versions
  • xgo for the inspiration

More Repositories

1

fyne

Cross platform GUI toolkit in Go inspired by Material Design
Go
24,550
star
2

examples

Examples apps using the Fyne toolkit
Go
596
star
3

fynedesk

A full desktop environment for Linux/Unix using Fyne
Go
526
star
4

terminal

A graphical terminal emulator for Linux using Fyne
Go
247
star
5

fyne-x

Community extensions to the cross platform GUI in Go based on Material Design
Go
233
star
6

defyne

The Fyne IDE
Go
181
star
7

calculator

Fyne Calculator application
Go
47
star
8

fyne-io.github.io

Fyne.io Website
SCSS
37
star
9

developer.fyne.io

Fyne developer documentation website
HTML
27
star
10

solitaire

Fyne solitaire application
Go
26
star
11

pixeledit

A image pixel editing app
Go
20
star
12

apps

Fyne App Browser
Go
18
star
13

apps.fyne.io

A central listing site for available Fyne applications
CSS
17
star
14

fin

A Fyne login manager for linux desktop computers
Go
16
star
15

7guis

Fyne implementation of 7GUIs: A GUI Programming Benchmark - https://eugenkiss.github.io/7guis/
Go
15
star
16

life

Fyne game of life simulation
Go
12
star
17

flatpak_demo

A demo of a Fyne application packaged as a Flatpak.
Go
10
star
18

docs.fyne.io

Documentation website
SCSS
10
star
19

gomobile-bridge

A bridge module for Fyne based mobile apps and libraries that rely on gomobile
Go
7
star
20

tools

Toolchain and helpful commands for building and managing Fyne apps
Go
6
star
21

image

Collection of image codecs useful in GUI apps
Go
5
star
22

setup

Helper tools for getting your development environment set up for Fyne
Go
5
star
23

tutorials

Source code for all of the YouTube / https://developer.fyne.io tutorials
Go
3
star
24

fyne-cross-images

Repository for managing fyne-cross images
Dockerfile
3
star
25

tour.fyne.io

A web based tour of the Fyne toolkit - replaced by developer.fyne.io/tour/
Go
3
star
26

proposals

Proposals that we are working on for future releases
3
star
27

demo.fyne.io

Fyne website to demo running inside a browser
JavaScript
2
star
28

conf.fyne.io

Website for Fyne Conference information
SCSS
1
star
29

cloud

Cloud providers and helpers for the Fyne toolkit
Go
1
star