getlantern / systray

a cross platfrom Go library to place an icon and menu in the notification area
Apache License 2.0
3.33k stars 464 forks source link

Can we get MacOS M1 support? #231

Closed davidnewhall closed 2 years ago

davidnewhall commented 2 years ago

I'd like to create binaries for M1 users, but this library does not seem to compile against darwin+arm64 (MacOS M1). I'll be forever grateful if this feature can be added.

Thank you!


Reproduction steps:

$ git clone git@github.com:getlantern/systray.git
$ cd systray
$ GOOS=darwin GOARCH=arm64 go build .

Output:

# github.com/getlantern/systray
./systray.go:78:2: undefined: nativeLoop
./systray.go:106:2: undefined: registerSystray
./systray.go:111:14: undefined: quit
./systray.go:136:2: undefined: addSeparator
./systray.go:190:2: undefined: hideMenuItem
./systray.go:195:2: undefined: showMenuItem
./systray.go:220:2: undefined: addOrUpdateMenuItem
davidnewhall commented 2 years ago

Come to think of it (looking at the code), this is a cross compile issue.... I'll try this on a real M1 and report back. I'm also testing on some old 10.14.6. Upgrading to Monterey now (to get latest Xcode). This may solve my problem... 🤞

davidnewhall commented 2 years ago

This works fine on M1. I'll report back if I can get cross-compiling to work.....

davidnewhall commented 2 years ago

I was able to cross compile just fine from an amd64 mac to arm64 with xcode 13.2. https://app.travis-ci.com/github/Notifiarr/notifiarr/jobs/563321323#L549

Crosse commented 2 years ago

Sorry about the delay, I went on paternity leave last week! Glad that you got this working, though!