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.77k stars 1.19k forks source link

AppImage on Gentoo - Cannot find libmpv at the usual places #643

Closed patomas closed 1 month ago

patomas commented 1 year ago

Is there an existing issue for this?

Current Behavior

After attempting to launch the AppImage file, it outputs the following message:

`package:media_kit_libs_linux registered.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Cannot find libmpv at the usual places. Depending upon your distribution, you can install the libmpv package to make shared library available globally. On Debian or Ubuntu based systems, you can install it with: apt install libmpv-dev.

0 NativeLibrary.ensureInitialized (package:media_kit/src/player/native/core/native_library.dart:73)

1 nativeEnsureInitialized (package:media_kit/src/player/native/player/real.dart:48)

2 MediaKit.ensureInitialized (package:media_kit/src/media_kit.dart:25)

3 main (package:spotube/main.dart:80)

4 _runMain. (dart:ui/hooks.dart:129)

5 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:296)

6 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189)

`

Expected Behavior

The app should open

Steps to reproduce

  1. Downloaded the AppImage from the link on github ( https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-linux-x86_64.AppImage )
  2. Made the image executable with chmod +x
  3. On the console, on the same folder as the appimage file, as a normal user executed ./Spotube-linux-x86_64.AppImage
  4. Got the error posted before
  5. (just for testing) As a root got the same message

Operating System

Linux 6.1.28-gentoo #6 SMP PREEMPT_DYNAMIC Fri Aug 11 09:39:20 +08 2023 x86_64 12th Gen Intel(R) Core(TM) i5-12600K GenuineIntel GNU/Linux

Spotube version

3.1.0

Installation source

GitHub Releases (Binary)

Additional information

Packages installed related to this software:

  1. mpv
    • mpv 0.35.1 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
  2. fuse
    • 2.9.9-r2
  3. libmpv locations
    • /usr/lib64/libmpv.so
    • /usr/lib64/libmpv.so.2
    • /usr/lib64/libmpv.so.2.0.0

Other appimage files work fine.

There seems to be a similar situation with Fedora reported, Can't install on Feodra 38 but since it is a different OS with some differences to Gentoo, I'm making a new report.

I tried the solution mentioned by RTTEXFile about a symbolic link but it didn't work. I tried copying the files to other common library folders, but that didn't work either.

servusdei2018 commented 1 year ago

@patomas

Upon inspection, the spotube AppImage appears to overwrite LD_LIBRARY_PATH with usr/lib. I'm not sure about the specifics of your system, however regardless of whether usr/lib exists or not, usr/lib/libmpv.so definitely doesn't.

  1. Extract the AppImage: ./Spotube-linux-x86_64.AppImage --appimage-extract (extracts contents into squashfs-root)
  2. Edit squashfs-root/AppRun and change export LD_LIBRARY_PATH=usr/lib to export LD_LIBRARY_PATH=usr/lib64
  3. Launch spotube by executing ./squashfs-root/AppRun

Edit: This issue has been generalized and filed upstream at https://github.com/leanflutter/flutter_distributor/issues/139

KRTirtho commented 1 year ago

Oops sorry, I wrote that part of code & made that mistake 😅. But usr/lib is inside AppImage which isn't equivalent of /usr/lib if I'm not wrong

So how does /usr/lib64 affect AppImage? Also libmpv is shipped with the AppImage including many other shared objects (.so) so it shouldn't even require one to install libmpv or mpv at all

patomas commented 1 year ago

I still have to try the extract option to test it but will do as soon as possible.

I tried a couple of locations copying libmpv.so but none worked.

Reading about the overwriting, I'll keep an eye on the referenced report to see how this evolves.

KRTirtho commented 1 year ago

Weird thing is libmpv.so & libmpv.so.2 is already embedded in the appimage

duckwoqei commented 1 year ago

Same error here: Spotube 3.1.1 Linux tux 5.15.52-gentoo-dist #1 SMP Sun Jul 3 05:21:48 -00 2022 x86_64 AMD Phenom(tm) II X4 965 Processor AuthenticAMD GNU/Linux

SOLVED: Following suggestion by @servusdei2018:

  1. Extract the AppImage: ./Spotube-linux-x86_64.AppImage --appimage-extract (extracts contents into squashfs-root)
  2. Edit squashfs-root/AppRun and change export LD_LIBRARY_PATH=usr/lib to export LD_LIBRARY_PATH=usr/lib64
  3. Emerging dev-libs/libappindicator
  4. Launch spotube by executing ./squashfs-root/AppRun

is now working for me

KRTirtho commented 1 year ago

Btw there's a .tar.xz available which you use to manually install the app

patomas commented 1 year ago

I tried the unpacking option suggested before and the I had another problem, delated to libappindicator, which I solved installing that package ( emerge libappindicator ) since I'm in Gentoo.

Then I had the following error message [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPlatformDirectoryException(Unable to get application documents directory), I followed the answer from orange-kao and installed ( emerge xdg-user-dir ) and then the program started.

Then I got a message about encryption but that seems to be another issue.

So for now, I believe there is a path that you can follow to add the mentioned libraries to have a full appimage.

Thanks for the help and effort with this nice package

KRTirtho commented 1 year ago

These are the AUR dependencies 'mpv' 'libappindicator-gtk3' 'libsecret' 'jsoncpp' 'libnotify' Make sure to include Gentoo equivalent of these deps

KRTirtho commented 1 year ago

Can anyone contribute with a ebuild script for Spotube? It'll be better than AppImage

The aur PKGBUILD can followed https://github.com/KRTirtho/spotube/blob/master/aur-struct/PKGBUILD

patomas commented 1 year ago

I can try to do it, but I haven't done it before. It may be a good excercise for me. I'll try this week

KRTirtho commented 1 year ago

Yea sure give it a try. It'll be a helpful for a lot of users & kind of a milestone for this app :muscle:

I mean how many flutter apps are there that are installable on Gentoo without manual work?! :smile:

xAlpharax commented 11 months ago

I encountered this problem as well:

This indicates that one or more required dependencies could not be located.

Refer to "Installation" section of the README for further details:
GitHub  : https://github.com/media-kit/media-kit#installation
pub.dev : https://pub.dev/packages/media_kit#installation

TIP: Copy-paste required packages from the above link to your pubspec.yaml.

If you recently added the packages, make sure to re-run the project ("hot-restart" & "hot-reload" is not sufficient for native plugins).
--------------------------------------------------------------------------------

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Cannot find libmpv at the usual places. Depending upon your distribution, you can install the libmpv package to make shared library available globally. On Debian or Ubuntu based systems, you can install it with: apt install libmpv-dev.
#0      NativeLibrary.ensureInitialized (package:media_kit/src/player/native/core/native_library.dart:78)
#1      nativeEnsureInitialized (package:media_kit/src/player/native/player/real.dart:47)
#2      MediaKit.ensureInitialized (package:media_kit/src/media_kit.dart:26)
#3      main (package:spotube/main.dart:43)
<asynchronous suspension>

I have yet to try the guide from @servusdei2018.

Updated: The guide didn t work for me

KRTirtho commented 1 month ago

We dropped support for AppImage as it has become a burden for us to maintain both the AppImage packager and format for flutter_distributor which hinders the actual development of the app.

Spotube is available for all Linux distro through Flathub (flatpak)