KRTirtho / spotube

🎧 Open source Spotify client that doesn't require Premium nor uses Electron! Available for both desktop & mobile!
https://spotube.krtirtho.dev/
Other
28.2k stars 1.16k forks source link

Provide a aarch64 build for flathub #715

Closed spazziale closed 6 days ago

spazziale commented 11 months ago

Is there an existing issue for this?

Pain

I can't find a Spotify client for mobile linux as good as spotube ;)

Suggested solution

This would be cool for Linux phones

Useful resources

No response

Additional information

No response

KRTirtho commented 11 months ago

Unfortunately I was never able to produce an arm build for Spotube But meanwhile, if you've a arm machine, you can build from source

KRTirtho commented 11 months ago

Ok so I was playing with CircleCI's linux-arm64 machines & luckily I was able to successfully produce a build I wasn't able to test it on device. So please use it at your own risk & let me know if it works spotube-linux-3.1.1-aarch64.zip

KRTirtho commented 11 months ago

Make sure these dependencies are installed

spazziale commented 11 months ago

I'm using postmarketos ( so musl instead of glibc) i got this error: ./spotube: ./spotube: cannot execute binary file Maybe we use a .flatpak to circumvent the problem

KRTirtho commented 11 months ago

It won't work in that case. Flutter depends on glibc

KRTirtho commented 11 months ago

So I testing arm version on flatpak. See if this works

flatpak install --user https://dl.flathub.org/build-repo/48466/com.github.KRTirtho.Spotube.flatpakref
spazziale commented 11 months ago

See if this works

spotube: error while loading shared libraries: libcatcher_plugin.so: cannot open shared object file: No such file or directory

KRTirtho commented 11 months ago

Please do the following:

$ flatpak run --devel --command=sh com.github.KRTirtho.Spotube
$ cd /app/spotube/
$ ldd spotube

Then provide the output of the last command

spazziale commented 11 months ago
ldd spotube
        linux-vdso.so.1 (0x0000ffff8b1f6000)
    libcatcher_plugin.so => not found
    libfile_selector_linux_plugin.so => not found
    libflutter_secure_storage_linux_plugin.so => not found
    liblocal_notifier_plugin.so => not found
    libmedia_kit_libs_linux_plugin.so => not found
    libscreen_retriever_plugin.so => not found
    libsystem_theme_plugin.so => not found
    libsystem_tray_plugin.so => not found
    liburl_launcher_linux_plugin.so => not found
    libwindow_manager_plugin.so => not found
    libwindow_size_plugin.so => not found
    libflutter_linux_gtk.so => not found
    libgtk-3.so.0 => /usr/lib/aarch64-linux-gnu/libgtk-3.so.0 (0x0000ffff8a960000)
    libgdk-3.so.0 => /usr/lib/aarch64-linux-gnu/libgdk-3.so.0 (0x0000ffff8a840000)
    libpangocairo-1.0.so.0 => /usr/lib/aarch64-linux-gnu/libpangocairo-1.0.so.0 (0x0000ffff8a820000)
    libpango-1.0.so.0 => /usr/lib/aarch64-linux-gnu/libpango-1.0.so.0 (0x0000ffff8a7a0000)
    libharfbuzz.so.0 => /usr/lib/aarch64-linux-gnu/libharfbuzz.so.0 (0x0000ffff8a690000)
    libatk-1.0.so.0 => /usr/lib/aarch64-linux-gnu/libatk-1.0.so.0 (0x0000ffff8a650000)
    libcairo-gobject.so.2 => /usr/lib/aarch64-linux-gnu/libcairo-gobject.so.2 (0x0000ffff8a630000)
    libcairo.so.2 => /usr/lib/aarch64-linux-gnu/libcairo.so.2 (0x0000ffff8a500000)
    libgdk_pixbuf-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x0000ffff8a4c0000)
    libgio-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libgio-2.0.so.0 (0x0000ffff8a2a0000)
    libgobject-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libgobject-2.0.so.0 (0x0000ffff8a220000)
    libglib-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0 (0x0000ffff8a0b0000)
    libstdc++.so.6 => /usr/lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000ffff89e60000)
    libm.so.6 => /usr/lib/aarch64-linux-gnu/libm.so.6 (0x0000ffff89dc0000)
    libgcc_s.so.1 => /usr/lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffff89d90000)
    libc.so.6 => /usr/lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff89be0000)
    libgmodule-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libgmodule-2.0.so.0 (0x0000ffff89bc0000)
    libpangoft2-1.0.so.0 => /usr/lib/aarch64-linux-gnu/libpangoft2-1.0.so.0 (0x0000ffff89b90000)
    libfontconfig.so.1 => /usr/lib/aarch64-linux-gnu/libfontconfig.so.1 (0x0000ffff89b30000)
    libfribidi.so.0 => /app/lib/libfribidi.so.0 (0x0000ffff89b00000)
    libepoxy.so.0 => /usr/lib/aarch64-linux-gnu/libepoxy.so.0 (0x0000ffff899a0000)
    libXi.so.6 => /usr/lib/aarch64-linux-gnu/libXi.so.6 (0x0000ffff89970000)
    libX11.so.6 => /usr/lib/aarch64-linux-gnu/libX11.so.6 (0x0000ffff89820000)
    libatk-bridge-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libatk-bridge-2.0.so.0 (0x0000ffff897d0000)
    libtracker-sparql-3.0.so.0 => /usr/lib/aarch64-linux-gnu/libtracker-sparql-3.0.so.0 (0x0000ffff896e0000)
    libXfixes.so.3 => /usr/lib/aarch64-linux-gnu/libXfixes.so.3 (0x0000ffff896c0000)
    /lib/ld-linux-aarch64.so.1 (0x0000ffff8b1be000)
    libxkbcommon.so.0 => /usr/lib/aarch64-linux-gnu/libxkbcommon.so.0 (0x0000ffff89660000)
    libwayland-client.so.0 => /usr/lib/aarch64-linux-gnu/libwayland-client.so.0 (0x0000ffff89630000)
    libwayland-cursor.so.0 => /usr/lib/aarch64-linux-gnu/libwayland-cursor.so.0 (0x0000ffff89610000)
    libwayland-egl.so.1 => /usr/lib/aarch64-linux-gnu/libwayland-egl.so.1 (0x0000ffff895f0000)
    libXext.so.6 => /usr/lib/aarch64-linux-gnu/libXext.so.6 (0x0000ffff895c0000)
    libXcursor.so.1 => /usr/lib/aarch64-linux-gnu/libXcursor.so.1 (0x0000ffff895a0000)
    libXdamage.so.1 => /usr/lib/aarch64-linux-gnu/libXdamage.so.1 (0x0000ffff89580000)
    libXcomposite.so.1 => /usr/lib/aarch64-linux-gnu/libXcomposite.so.1 (0x0000ffff89560000)
    libXrandr.so.2 => /usr/lib/aarch64-linux-gnu/libXrandr.so.2 (0x0000ffff89540000)
    libXinerama.so.1 => /usr/lib/aarch64-linux-gnu/libXinerama.so.1 (0x0000ffff89520000)
    libfreetype.so.6 => /usr/lib/aarch64-linux-gnu/libfreetype.so.6 (0x0000ffff89450000)
    libgraphite2.so.3 => /usr/lib/aarch64-linux-gnu/libgraphite2.so.3 (0x0000ffff89420000)
    libpixman-1.so.0 => /usr/lib/aarch64-linux-gnu/libpixman-1.so.0 (0x0000ffff89370000)
    libpng16.so.16 => /usr/lib/aarch64-linux-gnu/libpng16.so.16 (0x0000ffff89320000)
    libxcb-shm.so.0 => /usr/lib/aarch64-linux-gnu/libxcb-shm.so.0 (0x0000ffff89300000)
    libxcb-render.so.0 => /usr/lib/aarch64-linux-gnu/libxcb-render.so.0 (0x0000ffff892e0000)
    libxcb.so.1 => /usr/lib/aarch64-linux-gnu/libxcb.so.1 (0x0000ffff892a0000)
    libXrender.so.1 => /usr/lib/aarch64-linux-gnu/libXrender.so.1 (0x0000ffff89280000)
    libz.so.1 => /usr/lib/aarch64-linux-gnu/libz.so.1 (0x0000ffff89250000)
    libjpeg.so.62 => /usr/lib/aarch64-linux-gnu/libjpeg.so.62 (0x0000ffff891d0000)
    libmount.so.1 => /usr/lib/aarch64-linux-gnu/libmount.so.1 (0x0000ffff89150000)
    libffi.so.8 => /usr/lib/aarch64-linux-gnu/libffi.so.8 (0x0000ffff89120000)
    libpcre2-8.so.0 => /usr/lib/aarch64-linux-gnu/libpcre2-8.so.0 (0x0000ffff89080000)
    libexpat.so.1 => /usr/lib/aarch64-linux-gnu/libexpat.so.1 (0x0000ffff89040000)
    libatspi.so.0 => /usr/lib/aarch64-linux-gnu/libatspi.so.0 (0x0000ffff88ff0000)
    libdbus-1.so.3 => /usr/lib/aarch64-linux-gnu/libdbus-1.so.3 (0x0000ffff88f80000)
    libjson-glib-1.0.so.0 => /usr/lib/aarch64-linux-gnu/libjson-glib-1.0.so.0 (0x0000ffff88f40000)
    libxml2.so.2 => /usr/lib/aarch64-linux-gnu/libxml2.so.2 (0x0000ffff88dc0000)
    libsqlite3.so.0 => /usr/lib/aarch64-linux-gnu/libsqlite3.so.0 (0x0000ffff88c70000)
    libbz2.so.1 => /usr/lib/aarch64-linux-gnu/libbz2.so.1 (0x0000ffff88c40000)
    libbrotlidec.so.1 => /usr/lib/aarch64-linux-gnu/libbrotlidec.so.1 (0x0000ffff88c20000)
    libXau.so.6 => /usr/lib/aarch64-linux-gnu/libXau.so.6 (0x0000ffff88c00000)
    libblkid.so.1 => /usr/lib/aarch64-linux-gnu/libblkid.so.1 (0x0000ffff88b90000)
    libsystemd.so.0 => /usr/lib/aarch64-linux-gnu/libsystemd.so.0 (0x0000ffff88aa0000)
    liblzma.so.5 => /usr/lib/aarch64-linux-gnu/liblzma.so.5 (0x0000ffff88a60000)
    libicui18n.so.71 => /usr/lib/aarch64-linux-gnu/libicui18n.so.71 (0x0000ffff88720000)
    libicuuc.so.71 => /usr/lib/aarch64-linux-gnu/libicuuc.so.71 (0x0000ffff88510000)
    libicudata.so.71 => /usr/lib/aarch64-linux-gnu/libicudata.so.71 (0x0000ffff867f0000)
    libbrotlicommon.so.1 => /usr/lib/aarch64-linux-gnu/libbrotlicommon.so.1 (0x0000ffff867b0000)
    libcap.so.2 => /usr/lib/aarch64-linux-gnu/libcap.so.2 (0x0000ffff86790000)
    libgcrypt.so.20 => /usr/lib/aarch64-linux-gnu/libgcrypt.so.20 (0x0000ffff86690000)
    libzstd.so.1 => /usr/lib/aarch64-linux-gnu/libzstd.so.1 (0x0000ffff865d0000)
    liblz4.so.1 => /usr/lib/aarch64-linux-gnu/liblz4.so.1 (0x0000ffff86590000)
    libgpg-error.so.0 => /usr/lib/aarch64-linux-gnu/libgpg-error.so.0 (0x0000ffff86550000)
KRTirtho commented 11 months ago

Please check is there /app/spotube/lib is available or not If it's there try with

$ cd /app/spotube
$ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/app/spotube/lib" ./spotube
spazziale commented 11 months ago

Please check is there /app/spotube/lib is available or not If it's there try with

The lib dir does not exist.

ls: com.github.KRTirtho.Spotube.appdata.xml flutter_assets icudtl.dat libapp.so libcatcher_plugin.so libfile_selector_linux_plugin.so libflutter_linux_gtk.so libflutter_secure_storage_linux_plugin.so liblocal_notifier_plugin.so libmedia_kit_libs_linux_plugin.so libmedia_kit_native_event_loop.so libmetadata_god.so libscreen_retriever_plugin.so libsystem_theme_plugin.so libsystem_tray_plugin.so liburl_launcher_linux_plugin.so libwindow_manager_plugin.so libwindow_size_plugin.so spotube spotube-logo.png spotube.desktop

KRTirtho commented 11 months ago

Ok so the Zip messed up the folders

KRTirtho commented 11 months ago

This time it should work. Using the tar.xz for installation

$ flatpak install --user https://dl.flathub.org/build-repo/48962/com.github.KRTirtho.Spotube.flatpakref
spazziale commented 11 months ago

Now it works but it has a strange layout (uses pc layout instead of android layout). how can i fix it?

KRTirtho commented 11 months ago

That's super easy barely an inconvenience Just go to "Settings" > "Layout Mode" & select "Compact" Btw you can turn on the "Settings" > "Use system title bar" to get rid of the window buttons

Also can you share some screenshot, I want to see it so much :smile:

spazziale commented 11 months ago

sorry for responding so late, I've been busy

everything works as planned. I can't send screenshots since I'm using gnome-shell-mobile which is alpha quality. Thank you very much! Two suggestions:

1- automatic updates should be disabled, as flatpak should handle them 2 - layout mode should be adaptive by default

As soon as you publish the arm version on flatpak ( or you start a new build with the bot ) I will send you some screenshots 😁

Potomiho commented 10 months ago

I saw this and couldn't resist to test that on Librem 5.

So first of all the link you provided with the build is already gone, so I built the flatpak locally on the phone with this patch basing on this.

Now to run it there were some issues with GTK3/GDK3 already partially fixed on upstream (this issue specifically) but required additional backport from GTK4. Again compiled manually and required to install all dev dependencies (GTK3 Meson submodule based build is known to not work there)

I also needed to modify flatpak Gnome SDK/Platform and copy over all files. Finally I froze them, so no modifications would go in there with unwanted updates.

If anyone would like to go the same path I can share the more detailed steps.

Anyway few screens from L5: Screenshot from 2023-09-23 12-49-15 Screenshot from 2023-09-23 12-18-28 Screenshot from 2023-09-23 12-14-11

From issues - scrolling is quite painful (requires to 'grab' the scroll on the edge of screen - no gestures). From good sides - playback works like a charm as probably most of other stuff. I didn't had much time to test yet though - I just completed my journey and wanted to share it.

Anyway 10/10 would do that again.

@KRTirtho Thanks for all your work! I can finally play music in my car without doing some convoluted setups!

KRTirtho commented 10 months ago

Glad that it worked & congrats on getting it working 🎉 And WOW, those screenshots are looking beautiful ✨

So first of all the link you provided with the build is already gone, so I built the flatpak locally on the phone with this patch basing on this. Now to run it there were some issues with GTK3/GDK3 already partially fixed on upstream (this issue specifically) but required additional backport from GTK4. Again compiled manually and required to install all dev dependencies (GTK3 Meson submodule based build is known to not work there) I also needed to modify flatpak Gnome SDK/Platform and copy over all files. Finally, I froze them, so no modifications would go in there with unwanted updates.

Not sure why this much configuration was needed. Btw, there's spotube-linux-nightly-aarch64.tar.xz which should work out of the box if all required runtime packages are installed

KRTirtho commented 10 months ago

Steps to build the flatpak locally:

  1. Git clone
    $ git clone https://github.com/KRTirtho/com.github.KRTirtho.Spotube --recursive --shallow-submodules --depth=1 --single-branch
  2. Build the flatpak
    $ flatpak-builder --user --install --force-clean build com.github.KRTirtho.Spotube.yml
PhilDevProg commented 10 months ago

Steps to build the flatpak locally:

  1. Git clone
    $ $ git clone https://github.com/KRTirtho/com.github.KRTirtho.Spotube --recursive --shallow-submodules --depth=1 --single-branch
  2. Build the flatpak
    $ flatpak-builder --user --install --force-clean build com.github.KRTirtho.Spotube.yml

I tried building it but got this error:

Applying patch intltool-perl5.26-regex-fixes.patch
Error: module intltool: Failed to execute child process ?patch? (No such file or directory)

I then installed intltool via sudo apt install intltool but now I get this error:

Applying patch intltool-perl5.26-regex-fixes.patch
patching file intltool-update.in
error: Unknown option -g
Error: module intltool: Child process exited with code 1
kero990 commented 8 months ago

I tried to compile the arm64 version on the latest source code, but encountered an error and couldn't find libdiscord rpc.so. After checking, it was found that the file exists, but it is x86 library. I found the referenced project and found that the file does not have the source code. The Discord rpc project itself only provides x86 version libraries.

So what should we do? Can't we compile the arm64 version in the future

KRTirtho commented 8 months ago

Just remove dart_discord_rpc dependency and these lines from main.dart

  1. https://github.com/KRTirtho/spotube/blob/e4eb0e2596ade2bb5195e183f03af42742fc8486/lib/main.dart#L2-L2
  2. https://github.com/KRTirtho/spotube/blob/e4eb0e2596ade2bb5195e183f03af42742fc8486/lib/main.dart#L67-L69
Kabouik commented 7 months ago

If anyone would like to go the same path I can share the more detailed steps.

@Potomiho I would be very interested in installing it on Droidian, which should be pretty similar to Purism. Could you please share more details on what I should do as of today (I have no knowledge with flatpak building)?

Alternatively, @KRTirtho could you put the arm64 versions back on Flathub? I saw there were links to them in the above posts, but they're now gone, which is why @Potomiho had to build the flatpak locally. But if there were builds working on your side, that'd be even better (less work for arm64 users).

Kabouik commented 7 months ago

Oh wait, I missed the following. I'll try that first.

Not sure why this much configuration was needed. Btw, there's spotube-linux-nightly-aarch64.tar.xz which should work out of the box if all required runtime packages are installed

Kabouik commented 7 months ago

Sorry for the spam, but I assume it is best to send notifications rather than making edits that no one may ever read if they already read the previous message version in their email.

So I realized there actually are aarch64 builds now in nightly builds, which is great news! However, I think there's an error as the aarch64 package is actually build as an amd64 package:

sudo dpkg -i Spotube-linux-aarch64.deb
dpkg: error processing archive Spotube-linux-aarch64.deb (--install):
 package architecture (amd64) does not match system (arm64)
Errors were encountered while processing:
 Spotube-linux-aarch64.deb

I haven't had success from the AppImage or tar.xz files either yet (need to figure out how to install Flutter SDK on aarch64; I found this but didn't manage to make anything useful out of it, I hope I can find instructions elsewhere).

theofficialgman commented 6 months ago

Hi are there any holdups here? Would love to have aarch64 officially supported on flatpak.

Peperehobbits01 commented 1 month ago

This issues as been fixed, could you please close this issues to help reading trhow the issues for developers and let them not have to verify if a issues as already been fixed please. 😉

theofficialgman commented 1 month ago

This issue is not fixed. There is no aarch64 flathub release currently https://github.com/flathub/com.github.KRTirtho.Spotube/blob/master/flathub.json

Peperehobbits01 commented 1 month ago

This issue is not fixed. There is no aarch64 flathub release currently https://github.com/flathub/com.github.KRTirtho.Spotube/blob/master/flathub.json

Oh shit I send it in the wrong issues sorry.

RokeJulianLockhart commented 6 days ago

https://github.com/KRTirtho/spotube/issues/715#event-13835358895

@theofficialgman, https://github.com/flathub/com.github.KRTirtho.Spotube/blob/36de38409f5725fb32452744303a09fe89dbebf6/flathub.json#L1:~:text=%7B%22only%2Darches%22:%20%5B%22x86_64%22%2C%20%22-,aarch64,-%22%5D%7D

Kabouik commented 4 days ago

Thanks a lot, works like a charm on Droidian:

mpv-shot0001

KRTirtho commented 4 days ago

The pure joy of seeing my app running on platforms I've never used is just out of this world

image
Peperehobbits01 commented 4 days ago

Thanks a lot, works like a charm on Droidian:

mpv-shot0001

Droi what?

RokeJulianLockhart commented 4 days ago

https://github.com/KRTirtho/spotube/issues/715#issuecomment-2286960787

@Peperehobbits01, presumably https://droidian.org/.

Kabouik commented 4 days ago

Yes, that's that OS, and that is why I was also very interested in an aarch64 Linux build instead of the Android apk (although I can run it in Waydroid, I prefer not depending on Waydroid when I can).