wang-bin / fvp

Flutter video player plugin for all desktop+mobile platforms. download prebuilt examples from github actions. https://pub.dev/packages/fvp
BSD 3-Clause "New" or "Revised" License
126 stars 20 forks source link

run on nixos #61

Open HannesGitH opened 5 months ago

HannesGitH commented 5 months ago

Describe the bug Using the package will result in build errors on NixOS, because many shared objects libs are not installed

Expected behavior flutter run without errors (as does without using this package, although then playing videos wont work)

Log

Connected devices:
Linux (desktop) • linux  • linux-x64
• NixOS 23.11 (Tapir) 6.1.67
Chrome (web)    • chrome • web-javascript
• Google Chrome 120.0.6099.71
[1]: Linux (linux)
[2]: Chrome (chrome)
Please choose one (or "q" to quit): 1
Launching lib/main.dart on Linux in debug
mode...
Building Linux application...             
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: warning: libpulse.so.0, needed by /path/to/project/linux/flutter/ephemeral/.plugin_symlinks/fvp/linux/mdk-sdk/lib/amd64/libmdk.so.0, not found (try using -rpath or -rpath-link)
Building Linux application...             
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: warning: libasound.so.2, needed by /path/to/project/linux/flutter/ephemeral/.plugin_symlinks/fvp/linux/mdk-sdk/lib/amd64/libmdk.so.0, not found (try using -rpath or -rpath-link)
Building Linux application...             
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: warning: libGL.so.1, needed by /path/to/project/linux/flutter/ephemeral/.plugin_symlinks/fvp/linux/mdk-sdk/lib/amd64/libmdk.so.0, not found (try using -rpath or -rpath-link)
Building Linux application...             
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: warning: libgbm.so.1, needed by /path/to/project/linux/flutter/ephemeral/.plugin_symlinks/fvp/linux/mdk-sdk/lib/amd64/libmdk.so.0, not found (try using -rpath or -rpath-link)
Building Linux application...             
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: warning: libdrm.so.2, needed by /path/to/project/linux/flutter/ephemeral/.plugin_symlinks/fvp/linux/mdk-sdk/lib/amd64/libmdk.so.0, not found (try using -rpath or -rpath-link)
Building Linux application...             
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
Building Linux application...                                           
Exception: Build process failed
HannesGitH commented 5 months ago

after installing the dependencies the app runs but receives SIGSEGV

 pkgs.mkShell 
  {

   packages = with pkgs; [
     git
     flutter

    # ...

    # linux 
     clang
     cmake
     ninja
     pkg-config
     gtk3
     glib
     libepoxy.dev
     # needed for linux video player (FVP) --doenst work yet 
     libdrm
     libGL
     alsa-lib
     pulseaudio
     mesa
     xorg.libX11

    # ...
   ];

   LD_LIBRARY_PATH= "${pkgs.alsa-lib}/lib:${pkgs.libdrm}/lib:${pkgs.libGL}/lib:${pkgs.libepoxy}/lib:${pkgs.pulseaudio}/lib:${pkgs.mesa}/lib:${pkgs.xorg.libX11}/lib:$LD_LIBRARY_PATH";

 }
;}

it runs fine until a video shall be played, then it crashes:

New Thread 0x7ffef0ff96c0 (LWP 148982)]
[Detaching after fork from child process 148983]

Thread 70 "mdk.demux@14073" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffef0ff96c0 (LWP 148982)]
0x0000000000000000 in ?? ()
wang-bin commented 5 months ago

show me the complete log

HannesGitH commented 5 months ago

i dont have the log rn but as i went through it again i saw a previous error saying gdk_window_get_state: assertion 'GDK_IS_WINDOW (window)' failed which might be resolved in a more recent flutter version (the one in nixpkgs is fixed to 3.13.8) as mentioned in the following comment:

https://github.com/flutter/flutter/issues/135547#issuecomment-1738463171

I havent tried that yet though, but feel free to close this issue as resolved. still wanted to document in case anybody stumbles upon the same problem