Bring back macOS functionality
gdamjan opened this issue · 5 comments
Tried compiling this for my friends x86 MacBook with make GOOS=darwin GOARCH=amd64
but it failed on go-gl
.
Maybe the GUI can be made optional for macOS?
$ make GOOS=darwin GOARCH=amd64
rm -rf ./build
go build -ldflags "-s -w -X main.build=`date -u +%Y%m%d%H%M%S` -X main.version=`cat ./version.txt` " -o build/go2tv cmd/go2tv/go2tv.go cmd/go2tv/flagfuncs.go
package command-line-arguments
imports github.com/alexballas/go2tv/internal/gui
imports fyne.io/fyne/v2/app
imports fyne.io/fyne/v2/internal/driver/glfw
imports fyne.io/fyne/v2/internal/painter/gl
imports github.com/go-gl/gl/v3.2-core/gl: build constraints exclude all Go files in /home/damjan/go/pkg/mod/github.com/go-gl/gl@v0.0.0-20190320180904-bf2b1f2f34d7/v3.2-core/gl
make: *** [Makefile:4: build] Error 1
Hello, I'll prepare some build instructions on how to build it for Mac from Linux, later today
You can use https://github.com/fyne-io/fyne-cross#build-the-docker-image-for-osxdarwinapple-cross-compiling to build for Mac
To sum up
Requirements
- go >= 1.16
- docker
Steps:
- Run
go get github.com/fyne-io/fyne-cross
- Make sure that the go path is correctly exported, if not
export PATH=$PATH:$(go env GOPATH)/bin
- Download Command Line Tools for Xcode >= 12.4 (macOS SDK 11.x) from here https://developer.apple.com/download/more
- Run:
fyne-cross darwin-image --xcode-path /path/to/Command_Line_Tools_for_Xcode_12.5.dmg
. This will prepare a docker image. (it takes a while) - Git pull Go2TV
git clone https://github.com/alexballas/go2tv.git
andcd go2tv
- Run
fyne-cross darwin -icon assets/go2tv-icon.png -app-id "go2tv" cmd/go2tv/go2tv.go
. This will build you an .app file which should work fine on Mac.
Optionally if you want to convert the .app file to DMG you could try something like that https://askubuntu.com/questions/1117461/how-do-i-create-a-dmg-file-on-linux-ubuntu-for-macos
Since I don't personally own a Mac, I have not tested the generated file to one. Let me know if you need help building it.
Thanks for this.
I'll have to see if it's easier to try this approach, or just compile it on my friends Mac itself (if they have xcode even).
Thanks. One thing to keep in mind is that after the "Catalina" version, Apple made it even harder to open applications that were not signed with their notarization process. Distributing Mac software requires the usage of a Mac device. On top of that, notarizing the application requires you to be enrolled in the Apple Developer Program for $99/year.
These are practically the reasons why I'm not distributing any Mac builds (yet)
I'll keep this ticket open to properly document the build process.
Resolving. Please refer to the latest release binaries