I’m trying to build demo (created by flutter create) flutter linux desktop application on NixOS with the following shell.nix
:
with (import <nixpkgs> { });
mkShell {
buildInputs = [
at-spi2-core.dev
clang
cmake
dart
dbus.dev
flutter
gtk3
libdatrie
libepoxy.dev
libselinux
libsepol
libthai
libxkbcommon
ninja
pcre
pkg-config
util-linux.dev
xorg.libXdmcp
xorg.libXtst
];
}
I keep getting this cryptic error:
Launching lib/main.dart on Linux in debug mode...
Building Linux application...
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: warning: libepoxy.so.0, needed by /home/domust/devel/flutter/myapp/linux/flutter/ephemeral/libflutter_linux_gtk.so, not found (try using -rpath or -rpath-link)
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
Exception: Build process failed
But I have libepoxy
installed in shell.nix
and I can verify it by running this command:
pkg-config --exists epoxy
because it returns 0.
I’ve also tried running flutter run -d linux -v
to see more verbose logs and I see that flutter is unable to find specific symbols, for example:
[ +234 ms] [5/6] Linking CXX executable intermediates_do_not_run/myapp
[ ] FAILED: intermediates_do_not_run/myapp
[ +4 ms] : && /nix/store/ffic8fn216glbk94v899z5wj19p78716-clang-wrapper-7.1.0/bin/clang++ -g CMakeFiles/myapp.dir/main.cc.o CMakeFiles/myapp.dir/my_application.cc.o CMakeFiles/myapp.dir/flutter/generated_plugin_registrant.cc.o -o intermediates_do_not_run/myapp -L/home/domust/devel/flutter/myapp/linux/flutter/ephemeral -Wl,-rpath,/home/domust/devel/flutter/myapp/linux/flutter/ephemeral: -lflutter_linux_gtk /nix/store/g2xxryy86xk29p8dgxggzz1q3qb1bhcm-gtk+3-3.24.30/lib/libgtk-3.so /nix/store/g2xxryy86xk29p8dgxggzz1q3qb1bhcm-gtk+3-3.24.30/lib/libgdk-3.so /nix/store/1l4r0r4ab3v3a3ppir4jwiah3icalk9d-zlib-1.2.11/lib/libz.so /nix/store/b7hj8q3fg67ajzqnjjaklrk6z9rx7n66-pango-1.48.10/lib/libpangocairo-1.0.so /nix/store/b7hj8q3fg67ajzqnjjaklrk6z9rx7n66-pango-1.48.10/lib/libpango-1.0.so /nix/store/ad144da88q6pcqkl688dx3dkjzkl99yj-harfbuzz-3.0.0/lib/libharfbuzz.so /nix/store/acicmcswclgs0gcaksmv6yrg697s68vn-atk-2.36.0/lib/libatk-1.0.so /nix/store/kngsrd486pgbsac7wxz22b5qiv0c8761-cairo-1.16.0/lib/libcairo-gobject.so /nix/store/kngsrd486pgbsac7wxz22b5qiv0c8761-cairo-1.16.0/lib/libcairo.so /nix/store/7sbj7mc5wyrj9c9lv9vchyikm6792xmf-gdk-pixbuf-2.42.6/lib/libgdk_pixbuf-2.0.so /nix/store/mbgcj6maiy41m0hacf1pw5nw56m3wn3q-glib-2.70.1/lib/libgio-2.0.so /nix/store/mbgcj6maiy41m0hacf1pw5nw56m3wn3q-glib-2.70.1/lib/libgobject-2.0.so /nix/store/mbgcj6maiy41m0hacf1pw5nw56m3wn3q-glib-2.70.1/lib/libglib-2.0.so && :
[ ] /nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: warning: libepoxy.so.0, needed by /home/domust/devel/flutter/myapp/linux/flutter/ephemeral/libflutter_linux_gtk.so, not found (try using -rpath or -rpath-link)
[ ] /nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: /nix/store/g2xxryy86xk29p8dgxggzz1q3qb1bhcm-gtk+3-3.24.30/lib/libgdk-3.so: undefined reference to `epoxy_eglDestroyContext'
[ ] /nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: /nix/store/g2xxryy86xk29p8dgxggzz1q3qb1bhcm-gtk+3-3.24.30/lib/libgdk-3.so: undefined reference to `epoxy_glXCreateNewContext'
but I have these installed:
pkg-config --list-all | grep -i eg
xkbregistry xkbregistry - XKB API to query available rules, models, layouts, variants and options
cairo-egl cairo-egl - EGL functions for cairo graphics library
libturbojpeg libturbojpeg - A SIMD-accelerated JPEG codec that provides the TurboJPEG API
gl gl - Legacy OpenGL and GLX library and headers
egl egl - EGL library and headers
wayland-egl-backend wayland-egl-backend - Backend wayland-egl interface
libjpeg libjpeg - A SIMD-accelerated JPEG codec that provides the libjpeg API
libpcre libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support
wayland-egl wayland-egl - Frontend wayland-egl library
harfbuzz-gobject harfbuzz-gobject - HarfBuzz text shaping library GObject integration
and
pkg-config --list-all | grep -i gl
gio-unix-2.0 GIO unix specific APIs - unix specific headers for glib I/O library
gio-2.0 GIO - glib I/O library
gmodule-2.0 GModule - Dynamic module loader for GLib
glib-2.0 GLib - C Utility Library
cairo-egl cairo-egl - EGL functions for cairo graphics library
gl gl - Legacy OpenGL and GLX library and headers
glproto GLProto - GL extension headers
gmodule-no-export-2.0 GModule - Dynamic module loader for GLib
glesv2 gles2 - OpenGL ES v2/v3 library and headers
egl egl - EGL library and headers
wayland-egl-backend wayland-egl-backend - Backend wayland-egl interface
cairo-glx cairo-glx - GLX functions for cairo graphics library
gmodule-export-2.0 GModule - Dynamic module loader for GLib
gobject-2.0 GObject - GLib Type, Object, Parameter and Signal Library
gthread-2.0 GThread - Thread support for GLib
glesv1_cm glesv1_cm - OpenGL ES-CM v1 library and headers
opengl opengl - OpenGL (without GLX) headers and interface
glx glx - GLX library and headers
epoxy epoxy - epoxy GL dispatch Library
cairo-gl cairo-gl - OpenGL surface backend for cairo graphics library
wayland-egl wayland-egl - Frontend wayland-egl library
libglvnd libglvnd - Vendor-neutral OpenGL dispatch library vendor interface
xcb-glx XCB GLX - XCB GLX Extension
so I shouldn’t be missing any egl
symbols
I have a feeling, that I’m probably missing one library, so if anyone has any ideas which library it might be, I’m all ears