Skip to content

flathub/io.github.dweymouth.supersonic

Repository files navigation

Flatpak packaging for Supersonic

Supersonic is a desktop music players that works with Subsonic-compatible servers like Navidrome.

To build this locally, try:

flatpak-builder build-dir com.github.dweymouth.supersonic.yml

Then to install:

flatpak-builder --user --install --force-clean build-dir com.github.dweymouth.supersonic.yml

And run:

flatpak run com.github.dweymouth.supersonic

You will need flatpak and flatpak-builder packages for the above to work.

Once this is published on Flathub, only flatpak will be required for running, of course.

Divergence from upstream

Some changes were originally required from upstream but have all been merged, thanks!

The remaining files are Golang-specific metadata information that is required to create the sources list that allows the package to be built without the network, see below.

Regenerating sources files

To regenerate the modules list, run this against your supersonic source tree (e.g. ~/dist/supersonic below):

go run github.com/dennwc/flatpak-go-mod@latest ~/dist/supersonic

Or, if it's installed locally:

~/go/bin/flatpak-go-mod ~/dist/supersonic

With the usual git pull, this becomes:

git -C ~/dist/supersonic pull && ~/go/bin/flatpak-go-mod ~/dist/supersonic

Digression

It's surprisingly difficult to get this to work right. First off, it's nearly impossible to come up with a full list of dependencies by hand, only animals and Debian developers do something like this. (To be fair, there's a good reason Debian developer do that, but it does not make sense in the Flatpak context in any case.)

There are various tools in various state of brokenness out there that allow you to automatically generate a list of sources entry. I have tried them all, let me give you a tour.

  • flatpak-builder-tools has a go-get directory with two tools there: flatpak-go-get-generator.py and flatpak-go-vendor-generator.py. The former is typically what gets recommended (and is used by syncthing), but it didn't work for my use case, as it was missing some dependencies. The latter did generate a proper list, but it was slow as hell and it ended up not compiling anyway because of obscure golang reasons. Both of those generate links to git repositories which are atrociously slow and do not cache well, so I moved on.

  • the game aaaaxy has a go-vendor-to-flatpak-yml.sh shell script which may work, but it's long enough that I got scared and promptly moved away

  • com.yktoo.ymuse has a clever script that parses the output of go download -json (but without treating it as JSON) and generates synthetic URLs to the Golang proxy. The problem is the generated archives have the version number in them which makes Golang unhappy. The ymuse manifest has a hack to rename those folders but that seems kind of awful and brittle so I have also moved on.

I ended up using dennwc and i audited this version of the source. It "Just Works".

References