Linux support
nu11ptr opened this issue ยท 13 comments
Tell us about the task you want to perform and are unable to do so because the feature is not available
Please consider making linux binaries for this
Describe the solution/feature you'd like us to add
Linux support either via deb, appimage, flatpak, etc.
Any other feedback you would like to provide regarding the site
It would be nice to be able to use this on linux :-)
Thanks for submitting the issue @nu11ptr :)
This is definitely something on our immediate roadmap and we are working on providing a Linux build soon.
The present Flutter documentation does not discuss much about distributing Linux apps other than Canonical's Snap Store, so we have some more work to do in this matter.
Stay tuned.
@animator you can use https://pub.dev/packages/flutter_distributor to build and package for all platform
Learn more: https://distributor.leanflutter.org/
You can follow the examples of Spotube for publishing to Flathub/AUR/Chocolatey/WinGet. I use the GitHub Actions to accomplish all of this for Spotube
Hi @KRTirtho
Thanks for sharing the build process of Spotube.
Will definitely check out flutter_distributor.
Hi @nu11ptr,
cc: @Erik0806, @melWiss, @BNSby, @juraj-chripko, @fusion44, @dannyglover, @amugofjava, @karniv00l, @jsilverdev, and @Abdulrasheed1729
API Dash v0.2.0 is now live with Linux builds (.rpm
, .deb
) for Intel 64-bit (x64/x86_64/amd64) and ARM 64-bit (arm64/aarch64) CPUs.
Special thanks to @KRTirtho for pointing me towards flutter_distributor.
Definitely looking forward to everyone's feedback.
Hi @KRTirtho,
For .rpm
, I had to just add the following line to the /linux/packaging/rpm/make_config.yaml
build_arch: aarch64
For .deb
, there is already an open issue as 'amd64'
is currently hardcoded. So I made changes to flutter_app_packager locally and supplied the architecture 'arm64'
via /linux/packaging/deb/make_config.yaml
The maintainers have already tagged you in the issue. In case you are not working on it, should I go ahead and create a PR?
Of course if you've the fix definitely create a PR ๐
Hi @KRTirtho,
For
.rpm
, I had to just add the following line to the/linux/packaging/rpm/make_config.yaml
build_arch: aarch64
For
.deb
, there is already an open issue as'amd64'
is currently hardcoded. So I made changes to flutter_app_packager locally and supplied the architecture'arm64'
via/linux/packaging/deb/make_config.yaml
The maintainers have already tagged you in the issue. In case you are not working on it, should I go ahead and create a PR?
Thanks for the Linux support and also for detailing your experience and fix for flutter_distributor. Looks like a fantastic tool to take the hassle out of building for various platforms!
For
.rpm
, I had to just add the following line to the/linux/packaging/rpm/make_config.yaml
build_arch: aarch64
For
.deb
, there is already an open issue as'amd64'
is currently hardcoded. So I made changes to flutter_app_packager locally and supplied the architecture'arm64'
via/linux/packaging/deb/make_config.yaml
@animator Does the binary work on arm-64 (aarch64) hosts though? As far as I know Flutter doesn't have ability to cross-compile for multiple architectures ๐ฌ . And specifying build_arch: aarch64
in rpm only copies the aarch64
RPM dependencies. Flutter binary and shared_objects
(lib/*.so) still remains x86_64
/amd64
. flutter_distributor doesn't perform any action to convert those to aarch64. That means rpm
and deb
will install but the programme will crash with Illegal Instruction
error
Thanks for the Linux support and also for detailing your experience and fix for flutter_distributor. Looks like a fantastic tool to take the hassle out of building for various platforms!
Thanks @dannyglover ๐
@animator Does the binary work on arm-64 (aarch64) hosts though? As far as I know Flutter doesn't have ability to cross-compile for multiple architectures ๐ฌ . And specifying build_arch: aarch64 in rpm only copies the aarch64 RPM dependencies. Flutter binary and shared_objects (lib/*.so) still remains x86_64/amd64 . flutter_distributor doesn't perform any action to convert those to aarch64. That means rpm and deb will install but the programme will crash with Illegal Instruction error
@KRTirtho From my personal experience of shipping releases of another software in the past, I generally assume that one cannot cross-compile for multiple CPU architectures. Sorry, for not specifying it in my comment. Yes, API Dash binaries do work on both arm64/aarch64
and amd64/x86_64
as I currently have 2 completely separate build setups - one with an arm64
chip (with build_arch: aarch64
specified in make_config.yaml
and flutter binary & shared objects are built for arm64
and reside in /build/linux/arm64/release/bundle/
) and another with x64 chip (defaults build_arch
to x86_64
and flutter binary & shared objects are built for x64
and reside in /build/linux/x64/release/bundle/
) to generate the required builds for both architectures. I am not sure if we can do it using GitHub workflows currently.
There is also another question that I wanted to ask you which might help other Flutter Devs who stumble across this issue of producing linux builds using flutter_distributor.
How did you figure out the exact list of required external dependencies for Spotube builds (both .deb
& .rpm
)?
For Spotube deb:
https://github.com/KRTirtho/spotube/blob/master/linux/packaging/deb/make_config.yaml
dependencies:
- libgstreamer1.0-dev
- libgstreamer-plugins-base1.0-dev
- libsecret-1-0
and for Spotube rpm:
https://github.com/KRTirtho/spotube/blob/master/linux/packaging/rpm/make_config.yaml
requires:
- gstreamer1-devel
- gstreamer1-plugins-base-tools
- gstreamer1-plugins-base-devel
- gstreamer1-plugins-good
- jsoncpp
- libsecret
In Flutter docs (link), they mentioned ldd
which throws the entire list of libraries which is not at all useful.
We don't have any dependency in API Dash currently. But, this question has definitely been puzzling me for some time.
Thanks!
Usually flutter plugin devs specifies (should specify) all the runtime and devel dependencies needed to use the plugin. Generally, ubuntu/debian deps are specified so we can use https://pkgs.org/ to find RPM or AUR equivalent of them
In case of spotube, the *-dev
and *-devel
packages are not required as runtime deps which I didn't know at the time building ๐
Usually flutter plugin devs specifies (should specify) all the runtime and devel dependencies needed to use the plugin. Generally, ubuntu/debian deps are specified so we can use https://pkgs.org/ to find RPM or AUR equivalent of them
Aha, makes sense! Thanks @KRTirtho ๐
In case of spotube, the *-dev and *-devel packages are not required as runtime deps which I didn't know at the time building ๐
๐