Linux desktop build

208 views
Skip to first unread message

tcmi...@gmail.com

unread,
May 31, 2018, 1:02:56 PM5/31/18
to Desktop Embedding for Flutter
OK, I'm thing to build a simple flutter app.  So, to do this on a Linux desktop I did the following:
1. Installed Flutter Desktop SDK (https://flutter.io/setup-linux/
so the directory structure is 
|-- flutter
|-- flutter-desktop-embedding
unzip the files and have this: 
|-- flutter
|-- flutter-desktop-embedding
|-- flutter_embedder.h
`-- libflutter_engine.so

I'm lost on what to do with the following:
  • Replace FLUTTER_ENGINE with the SHA of the Flutter engine you wish to use.
  • The binary is not stripped and contains debug information. Embedders are advised to strip the binary before deployment.
$ cp <path_to_flutter_engine>/src/flutter/shell/platform/embedder/embedder.h \
     <path_to_flutter_desktop_embedding_repo>/linux/library/include
But, in the zip, there are just two files .so and flutter_embedded.h is the same as embedder.h?
(Yes, very much a newbie)

Tim


Stuart Morgan

unread,
May 31, 2018, 2:01:01 PM5/31/18
to tcmi...@gmail.com, Desktop Embedding for Flutter
You've caught the Linux build in an in-between state. The instructions were written before prebuilt engines were available for Linux, so are for building the engine from source, while you are trying to use the prebuilt version.

The plan is to make the Linux build automatically download the correct prebuilt engine version and place it where the embedding framework looks for it (<https://github.com/google/flutter-desktop-embedding/issues/62>), but that's not quite in place yet. It should be soon though, which is why I haven't changed the Linux instructions to describe doing it manually.

On Thu, May 31, 2018 at 10:02 AM <tcmi...@gmail.com> wrote:
unzip the files [...]
I'm lost on what to do with the following:
  • Replace FLUTTER_ENGINE with the SHA of the Flutter engine you wish to use.
If you just clicked the link on that page you almost certainly do not have the right version of the engine for your Flutter tree. You need the version which is in flutter/bin/internal/engine.version, which is where you would get the SHA.

However, as of yesterday the script that will handle that works on Linux, so instead of doing this manually you can run:
$ flutter-desktop-embedding/tools/update_flutter_engine <some output directory>
and you'll end up with the right version of libflutter_engine.so and flutter_embedder.h in whatever directory you specify.

Then you'll need to (for now) manually move them into place as described in our Linux build instructions.
  • The binary is not stripped and contains debug information. Embedders are advised to strip the binary before deployment.
This only matters if you are planning on distributing the resulting Linux binary.
 
But, in the zip, there are just two files .so and flutter_embedded.h is the same as embedder.h?

Yes, it's called embedder.h in the Flutter engine tree, but has been renamed in the prebuilt zip. Once we switch the build to using the prebuilt version the source will be changed to expect flutter_embedder.h, but for now you can rename it.

-Stuart 

tcmi...@gmail.com

unread,
May 31, 2018, 2:23:29 PM5/31/18
to Desktop Embedding for Flutter
OK, thank you for the response. 
Reply all
Reply to author
Forward
0 new messages