From ffe4fa61ee0a69de736b1a42a4adf5fa1d91938e Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Fri, 22 Aug 2025 11:32:34 +0100 Subject: [PATCH 1/2] Build on a mac without environment variables --- BUILD.md | 10 ---------- Makefile | 2 +- backend/mpmedia_mac.go | 4 ++-- backend/player/mpv/peaks_mac.go | 7 +++++++ 4 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 backend/player/mpv/peaks_mac.go diff --git a/BUILD.md b/BUILD.md index c6db723..cb289ec 100644 --- a/BUILD.md +++ b/BUILD.md @@ -55,16 +55,6 @@ Supersonic is available in the AUR and can be built either manually with `makepk ### Build -#### Homebrew setup -* Make sure header and library include paths include the dir in which homebrew installs headers/dylibs (may differ dep. on OS/Homebrew version) - - ``export C_INCLUDE_PATH=/opt/homebrew/include:$C_INCLUDE_PATH`` - - ``export LIBRARY_PATH=/opt/homebrew/lib:$LIBRARY_PATH`` - -#### Macports setup -* Make sure header and library include paths include the dir in which macports installs headers/dylibs - - ``export C_INCLUDE_PATH=/opt/local/include:$C_INCLUDE_PATH`` - - ``export LIBRARY_PATH=/opt/local/lib:$LIBRARY_PATH`` - #### Building the application * clone the repo, CD into the repo root, and run ``make build`` * (note that the first build will take some time as it will download and build the UI library) diff --git a/Makefile b/Makefile index b4cb945..62f9090 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ build: # so the last 3 cmds move it over manually. This is a bit fragile though # since it assumes a specific location and version of the dependency package_macos: - CGO_CFLAGS="-I/usr/local/include -I/opt/homebrew/include" CGO_LDFLAGS="-L/usr/local/lib -L/opt/homebrew/lib" fyne package -os darwin -tags migrated_fynedo + fyne package -os darwin -tags migrated_fynedo bundledeps_macos_homebrew: dylibbundler -od -b -x ./Supersonic.app/Contents/MacOS/supersonic -d ./Supersonic.app/Contents/Frameworks/ -p @executable_path/../Frameworks/ diff --git a/backend/mpmedia_mac.go b/backend/mpmedia_mac.go index 84fdd6f..e6d36ab 100644 --- a/backend/mpmedia_mac.go +++ b/backend/mpmedia_mac.go @@ -7,8 +7,8 @@ package backend **/ /* -#cgo CFLAGS: -x objective-c -#cgo LDFLAGS: -framework Cocoa -framework MediaPlayer +#cgo CFLAGS: -x objective-c -I/opt/homebrew/include -I/opt/local/include +#cgo LDFLAGS: -framework Cocoa -framework MediaPlayer -L/opt/homebrew/lib -L/opt/local/lib #include "mpmediabridge.h" */ import ( diff --git a/backend/player/mpv/peaks_mac.go b/backend/player/mpv/peaks_mac.go new file mode 100644 index 0000000..29ffe95 --- /dev/null +++ b/backend/player/mpv/peaks_mac.go @@ -0,0 +1,7 @@ +package mpv + +/* +#cgo CFLAGS: -I/opt/homebrew/include -I/opt/local/include +#cgo LDFLAGS: -L/opt/homebrew/lib -L/opt/local/lib +*/ +import "C" From 9eac586675d65279fd66c0a589cf56d2c89cd5f2 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 26 Aug 2025 14:18:59 +0100 Subject: [PATCH 2/2] Use the macos "go build" compatible mpv --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 29a0db3..cf9cd03 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/pelletier/go-toml/v2 v2.0.8 github.com/quarckster/go-mpris-server v1.0.3 github.com/supersonic-app/fyne-lyrics v0.0.0-20250614151306-b1880a70a410 - github.com/supersonic-app/go-mpv v0.1.0 + github.com/supersonic-app/go-mpv v0.1.1-0.20250822102843-7a8cde5f5449 github.com/supersonic-app/go-subsonic v0.0.0-20241224013245-9b2841f3711d github.com/supersonic-app/go-upnpcast v0.0.0-20250330154256-b957204209a5 github.com/zalando/go-keyring v0.2.6 diff --git a/go.sum b/go.sum index 21bade3..a65c288 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,6 @@ github.com/dweymouth/fyne-tooltip v0.3.0 h1:NKCyTkh9NtvnTsiHtTOtaJzRDOFYP8AckQ2t github.com/dweymouth/fyne-tooltip v0.3.0/go.mod h1:m04ShLW/Tp6LXrNieTumApvNgo7YSB+wi+jZTN+kDBU= github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250712002006-5064d705dac4 h1:Q3r94AcVL8yaF4Nrd3EQFKyLL3UN/zHPkj+My9B2vCQ= github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250712002006-5064d705dac4/go.mod h1:YZt7SksjvrSNJCwbWFV32WON3mE1Sr7L41D29qMZ/lU= -github.com/dweymouth/go-jellyfin v0.0.0-20250716005557-0ea2becece1f h1:QsKPwFpTHuYHEEuhvp4VBClkHh00bNNgQ/2Ij1bkk8M= -github.com/dweymouth/go-jellyfin v0.0.0-20250716005557-0ea2becece1f/go.mod h1:fcUagHBaQnt06GmBAllNE0J4O/7064zXRWdqnTTtVjI= github.com/dweymouth/go-jellyfin v0.0.0-20250808023725-196437af15a6 h1:IFewD1zMs7eWkqmzdGeQP9lavYboJHwGqm1oOa7wZC8= github.com/dweymouth/go-jellyfin v0.0.0-20250808023725-196437af15a6/go.mod h1:fcUagHBaQnt06GmBAllNE0J4O/7064zXRWdqnTTtVjI= github.com/dweymouth/go-wav v0.0.0-20250719173115-e60429a83eb0 h1:mYcctuWgVArHhSLJxndlUM43C3hoE18BLDBkXKM2tl0= @@ -132,8 +130,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/supersonic-app/fyne-lyrics v0.0.0-20250614151306-b1880a70a410 h1:wuDHCo6SU6r0KMm0EuI5FGVJCuLK4hcuPcMKmln8oCA= github.com/supersonic-app/fyne-lyrics v0.0.0-20250614151306-b1880a70a410/go.mod h1:XvGBPgXWkKrK+5OsoVkTcTZmwZac1Sj6miEn8q6uA20= -github.com/supersonic-app/go-mpv v0.1.0 h1:U+cCnLQxmpqx5mY6nMlC0J4uIdCCXUbAjpjS04XkFu8= -github.com/supersonic-app/go-mpv v0.1.0/go.mod h1:1bQz6kBQumJopXEbkiqoLxIXLy7F7yWFBvknvpAtIC0= +github.com/supersonic-app/go-mpv v0.1.1-0.20250822102843-7a8cde5f5449 h1:UHIPI43VzyWuIF8z8WVMdjMsC/orZTZQJraD/Iv+ghw= +github.com/supersonic-app/go-mpv v0.1.1-0.20250822102843-7a8cde5f5449/go.mod h1:1bQz6kBQumJopXEbkiqoLxIXLy7F7yWFBvknvpAtIC0= github.com/supersonic-app/go-subsonic v0.0.0-20241224013245-9b2841f3711d h1:70+Nn7yh+cfeKqqXVTdpneFqXuvrBLyP7U6GVUsjTU4= github.com/supersonic-app/go-subsonic v0.0.0-20241224013245-9b2841f3711d/go.mod h1:D+OWPXeD9owcdcoXATv5YPBGWxxVvn5k98rt5B4wMc4= github.com/supersonic-app/go-upnpcast v0.0.0-20250330154256-b957204209a5 h1:aoUJKPFD/ZrNZjK6fl2Xhazwsttx42esKxhSSzEE3Bo=