Closed lamergameryt closed 6 months ago
@animator @ashitaprasad: Can you please add the Enhancement tag to this issue?
@lamergameryt Instead of setting up a CI/CD pipeline right away, we want to first have clarity regarding the build process as you have read in the medium articles. So a good start will be to document the step by step build process for each distribution in this thread.
@animator Sounds good; I'll document the build process for each of the above distributions as a separate comment in this issue. Starting with the step-by-step build process of a deb & rpm file, I'm using Pop!_OS 22.04 LTS x86_64
for building and testing the distributions.
git clone --depth=1 https://github.com/foss42/apidash.git
sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
and sudo apt install rpm patchelf
dart pub global activate flutter_distributor
flutter create --platforms=linux .
mkdir -p ./linux/packaging/deb
mkdir -p ./linux/assets
wget -O ./linux/assets/apidash.png https://example.org/image.png
cat > ./linux/packaging/deb/make_config.yaml << EOF display_name: API Dash icon: linux/assets/apidash.png package_name: apidash summary: A beautiful, lightweight, open-source cross-platform API Client group: Applications/Development Tools vendor: Ashita Prasad packager: Ashita Prasad packagerEmail: ashita@xyz.com license: ASL 2.0 url: https://github.com/foss42/apidash
maintainer: name: Ashita Prasad email: ashita@xyz.com
priority: optional section: x11 dependencies:
essential: false postuninstall_scripts:
keywords:
generic_name: API Client categories:
startup_notify: true EOF
- Build the DEB package using flutter_distrubution: `flutter_distributor release --name=dev --jobs=release-dev-linux-deb`
#### Building a RPM Package
Similarly, for building a RPM distributable file:
- Create the make_config.yaml for RPM releases:
```bash
mkdir -p ./linux/packaging/rpm
mkdir -p ./linux/assets
# Enter the download link for the actual png file here.
wget -O ./linux/assets/apidash.png https://example.org/image.png
cat > ./linux/packaging/rpm/make_config.yaml << EOF
display_name: API Dash
icon: linux/assets/apidash.png
summary: A beautiful, lightweight, open-source cross-platform API Client
group: Applications/Development Tools
vendor: Ashita Prasad
packager: Ashita Prasad
packagerEmail: ashita@xyz.com
license: ASL 2.0
url: https://github.com/foss42/apidash
maintainer:
name: Ashita Prasad
email: ashita@xyz.com
priority: optional
section: x11
dependencies:
- mpv
essential: false
postuninstall_scripts:
- echo "Sorry to see you go."
keywords:
- API
- API Client
generic_name: API Client
categories:
- Development
- Utility
startup_notify: true
EOF
flutter_distributor release --name=dev --jobs=release-dev-linux-rpm
The above configuration works perfectly for creating DEB files. However, I'm encountering issues creating RPM files on my host machine.
warning: absolute symlink: /usr/bin/apidash -> /usr/share/apidash/apidash
I/O error : Permission denied
I/O error : Permission denied
Failed to write XML file; For permission problems, try rerunning as root
Despite this, the RPM file is successfully built and verified as OK with rpm -K apidash-0.3.0+3-linux.rpm
. I tried rerunning as root, but I have to reinstall flutter_distributor as root. Hence, I'm still determining what needs to be done here. I am looking for your suggestions, @animator and @ashitaprasad.
- Package the application as an AppImage to make the application portable across distributions.
I've added implementing this application as an AppImage package to the scope of this issue to make the application portable and run everywhere.
@animator @ashitaprasad One easy way to distribute for linux is to just provide a tarball of the bundle generated by flutter build
.
You can create this tarball using:
flutter build linux --release
(add the --target-platform
flag as needed)./build/linux/x64/release/bundle
tar -czvf apidash_x64-linux.tar.gz *
(Here x64 can be replaced with the corresponding target platform.)This tarball will contain the binary, the assests, and the linked libs. Which a packager can easily use to package the app.
I can provide some examples of repos distributing their project through tarballs.
@lamergameryt Why are you summarising the article for .deb
and .rpm
? That is sorted out and well documented by our team. What @animator said is to document the steps for build process for Linux platforms other than the ones we already have (.deb
& .rpm
).
@Tanish2002 When you are creating .deb
& .rpm
you can specify external dependencies.
How can you do the same for the tarball?
@Tanish2002 When you are creating
.deb
&.rpm
you can specify external dependencies. How can you do the same for the tarball?
@ashitaprasad
./libs
folder which is inside the bundle
folder. These will be included in the tarball.wget
or curl
.
- External dependencies: Currently, Apidash doesn't rely on external dependencies from what I've seen. Even if it does in the future, Tarballs are not supposed to be a package, (refer to the section below).
Note: API Dash currently has mpv
as external dependency.
Didn't know that. What library depends on mpv?
Didn't know that. What library depends on mpv?
just_audio_mpv
We are converting this issue into a discussion.
In the present state, the project is available as a package catering mainly to Arch Linux (pkgbuild), Debian (deb), and Red Hat (rpm) distributions. Furthermore, as evident from the blog post by @ashitaprasad at Medium, the packaging and distribution process is manual and cumbersome.
To solve this issue, there are a few steps we can take: