foss42 / apidash

API Dash is a beautiful open-source cross-platform API Client built using Flutter which can help you easily create & customize your API requests, visually inspect responses and generate API integration code. A lightweight alternative to postman/insomnia.
https://apidash.dev
Apache License 2.0
1.46k stars 274 forks source link

Linux support #1

Closed nu11ptr closed 1 year ago

nu11ptr commented 1 year ago

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 :-)

animator commented 1 year ago

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.

KRTirtho commented 1 year ago

@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

animator commented 1 year ago

Hi @KRTirtho Thanks for sharing the build process of Spotube. Will definitely check out flutter_distributor.

animator commented 1 year ago

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.

KRTirtho commented 1 year ago

@animator I've to ask, how did you manage to build for linux-aarch64?

animator commented 1 year ago

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?

KRTirtho commented 1 year ago

Of course if you've the fix definitely create a PR 😄

animator commented 1 year ago

Sure @KRTirtho 🙂

dannyglover commented 1 year ago

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!

KRTirtho commented 1 year ago

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

animator commented 1 year ago

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!

KRTirtho commented 1 year ago

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 😅

animator commented 1 year ago

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 😅

😂

suryagowda commented 6 months ago

Api dash app not opening in ubuntu amd64(installs but doesn't open):

terminal:

sudo dpkg -i /home/sudarshan/Downloads/apidash-linux-amd64.deb
(Reading database ... 218443 files and directories currently installed.)
Preparing to unpack .../apidash-linux-amd64.deb ...
Unpacking apidash (0.3.0+3) over (0.3.0+3) ...
Sorry to see you go. Please help us improve API Dash by filing a GitHub issue at https://github.com/foss42/apidash
Setting up apidash (0.3.0+3) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
suryagowda commented 6 months ago

any fix @animator @ashitaprasad ?

animator commented 6 months ago

@suryagowda This is a closed issue. Kindly open a new issue for the same.