Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package it as a Flatpak #6

Closed
nils2614 opened this issue May 27, 2020 · 9 comments
Closed

Package it as a Flatpak #6

nils2614 opened this issue May 27, 2020 · 9 comments
Assignees

Comments

@nils2614
Copy link

I really like this project and that it's a native GTK app without a dependency on X. Sadly I'm not on Ubuntu and I understand that I'd be too big of a hassle to package it for all the relevant distros out there. So could you package it as a Flatpak besides a native Ubuntu package please? That way all the people on the many distros that support Flatpak out of the box could easily find it in their software centers. That would also make it work on Silverblue :D

@hongquan
Copy link
Owner

@nilsoffermann I have never used Flatpak-distributed app before. But I will try to learn and package it at the weekend.

@nils2614
Copy link
Author

Yes that'd be awesome! :D
There's some good documentation over here

@jeteokeeffe
Copy link

jeteokeeffe commented May 30, 2020

I was going to flatpak this up but I couldn't get this working without a flatpak on Fedora 32.

So, maybe I'll save you some time with parts of flatpak manifest already built. believe the python pip dependency is complete, maybe you want to restrict on pip versions (the dependency generator doesn't support poetry).

cat com.github.hongquan.CoBang.json
{
    "app-id": "com.github.hongquan.cobang",
    "runtime": "org.gnome.Platform",
    "runtime-version": "3.36",
    "sdk": "org.gnome.Sdk",
    "command": "cobang",
    "finish-args": [
        "--socket=wayland"
    ],
    "modules": [
        {
            "name": "cobang",
            "sources": [
                "cobang-deps.json",
                {
                    "type": "github",
                    "url": "https://github.com/hongquan/CoBang.git",
                    "commit": "c491f6b4b6cec1fd3080bfc6fe9913bc63284ee9"
                }
            ]
        }
    ]
}
  1. Command will build the python dependencies
  2. Command will build the flatpak

https://github.com/flatpak/flatpak-builder-tools/tree/master/pip

python flatpak-pip-generator \
	pycairo \
	regex \
	pygobject \
	toml \
	typed-ast \
	wcwidth \
	black \
	logbook \
	pygobject-stubs \
	pytest \
	single-version \
	zbar-py \
	--output cobang-deps

flatpak-builder --force-clean --user --install --install-deps-from=flathub flatpak-build com.github.hongquan.CoBang.json

@hongquan
Copy link
Owner

Thanks, I'm trying to Flatpak, too. But it turns out that it has some disadvantage:

  • The Python version is limited by the Sdk provided by Flatpak. The latest one provides Python 3.7, while if we build as *.deb for Ubuntu 20.04, we can use Python 3.8 (and hence, can drop some dependencies, whose feature is already provided by Python 3.8).

  • The developer (author) has to do more building job. For example, my app is using one utility from Cheese. If package as *.deb, I just specify gir1.2-cheese-3.0 in my dependency list, but for Flatpak, I am having to instruct Flatpak to build Cheese from source!

@lightonflux
Copy link

lightonflux commented May 31, 2020

The Python version is limited by the Sdk provided by Flatpak.

Which SDK and version are you referring to?

@hongquan
Copy link
Owner

hongquan commented Jun 1, 2020

@lightonflux I use the latest one. Here are what in my machine:

❯ flatpak list
Name                                                   Application ID                                  Version            Branch            Installation
Foliate                                                com.github.johnfactotum.Foliate                 2.2.0              stable            system
default                                                org.freedesktop.Platform.GL.default                                19.08             system
Intel                                                  org.freedesktop.Platform.VAAPI.Intel                               19.08             system
openh264                                               org.freedesktop.Platform.openh264                                  2.0               system
Fractal                                                org.gnome.Fractal                               4.2.2              stable            system
GNOME Application Platform version 3.36                org.gnome.Platform                                                 3.36              system
GNOME Software Development Kit version 3.36            org.gnome.Sdk                                                      3.36              system
Yaru Gtk Theme                                         org.gtk.Gtk3theme.Yaru                                             3.22              system

Now it is possible to build as Flatpak from the source folder. Please checkout master branch of today, then run:

flatpak-builder _build --force-clean vn.hoabinh.quan.CoBang.yaml

to build.

To test, run:

flatpak-builder --run _build vn.hoabinh.quan.CoBang.yaml cobang

I haven't published to FlatHub yet.

@hongquan
Copy link
Owner

hongquan commented Jun 3, 2020

The Flatpak build script is not working if I am running it in an separate, empty folder (when testing before app submission). That is why it is not published to FlatHub yet.

@hongquan
Copy link
Owner

hongquan commented Jun 4, 2020

Submitting app to FlatHub: flathub/flathub#1565

@hongquan hongquan self-assigned this Jun 4, 2020
@hongquan
Copy link
Owner

hongquan commented Jun 7, 2020

After so many effort, CoBang is already published to FlatHub: https://github.com/flathub/vn.hoabinh.quan.CoBang

Release v0.4.0 is being built and should be available soon.

@hongquan hongquan closed this as completed Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants