pympress
pympress copied to clipboard
Distribute via flatpak/flathub
Hello, It would be very nice if there was an easier way of installing pympress on Linux, like more of a one-click-install instead of needing to hunt down dependencies.
My proposal would be to
- write a .desktop file so pympress is recognized by the operating system as graphical application and that it can be launched without a terminal
- Make a Flatpak, so you can include all (even operating system dependencies, like gstreamer,...) dependencies in a distributable format. For the flatpak manifest you can use the manifests on flathubs github repos as inspiration, there are python applications too.
- Submit the Flatpak to Flathub, so users on all Linux distributions can install pympress from their software center, and can find it from there if they're searching for presentation software.
I hope this is a possible way for pympress to be easier installable and get better visibility from users.
A .desktop sure is a good starting point.
I don’t know flatpak, so I don’t know if that has any visibility or if the dependencies required can be properly expressed there. I’m a little wary of the following statement on their website, as I certainly don’t want to start distributing pygobject dependencies, introspection files, the gtk+ and poppler libraries, etc:
Full control over dependencies
Flatpak makes it easy to bundle your own libraries as part of your app.
The most proper way to distribute pympress on linux would be to build the deb/rpm/pacman packages and submit them to the appropriate distros. But I suppose every build process and every submission process are different, so I haven’t yet really looked into it.
Yes sure it would be the right way to use .deb/.rpm/... but this is quite much to maintain and for Flatpak you could just maintain one package for all distributions (Fedora/Ubuntu/Arch/...) as they all have Flatpak available. And it should be possible to distribute the flatpak without Gtk,... libs as they are probably included in the base Gnome/Freedesktop image, but I'm not 100% sure on that.
I'm very close to having a Debian/Ubuntu package ready: https://tracker.debian.org/pkg/pympress . A .desktop file would be good.
I have been using the following .desktop file for quite some time now:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=pympress
Exec=python3 -m pympress
Icon=/opt/other-icons/pympress.png
Comment=A simple dual-screen PDF reader designed for presentations
Categories=Office
MimeType=application/pdf;
It probably is not perfect, but at least I did not have any problems with it.
I'm using:
[Desktop Entry]
Type=Application
Name=pympress
Comment=PDF presentation tool
Exec=pympress %f
Icon=pympress
Terminal=false
MimeType=application/pdf
Categories=Office;Viewer;Presentation;
Package now available in Debian Testing (Bullseye):
https://packages.debian.org/bullseye/pympress
And Ubuntu 20.04 (Focal):
https://packages.ubuntu.com/focal/pympress
Looking real good, thanks @mans0954 ! I think on the dependencies side, you could add the ones that are listed in the README:
- libgtk-3-0
- libpoppler-glib8
- libcairo2 (would already be an indirect dependency at this point)
- python3-gi
- python3-gi-cairo
- gobject-introspection
- libgirepository-1.0-1
- gir1.2-gtk-3.0
- gir1.2-poppler-0.18
The README now contains simplified commands for more distros, and references @mans0954’s available packages. Please feel free to contribute a command for a missing linux system. It could be worth checking whether we can distribute/register with the system the .desktop as part of the pip installation.
On flatpak, I see there’s a lot of dependencies that are bundled together, as “runtimes”. This would take care of a lot of our dependencies, e.g. using org.gnome.Platform would provide Gtk, GObject Introspections, and PyGObject, which we need. However there is no mention of the other dependencies, in particular python and poppler.
It also does not seem easy to install this in a scratch prefix somewhere on my machine to explore the possibilities, even just adding repos asks for root permissions. I’d have to go through the trouble of making a virtual machine or install docker to be able to develop the package, so I’ll leave this open for now if someone else wants to take it up.
@Cimbali python should already be included in the org.gnome.Platform runtime afaik.
And for poppler you can look at: https://github.com/flathub/com.github.xournalpp.xournalpp/blob/master/com.github.xournalpp.xournalpp.yaml which also builds and includes poppler.
Also you shouldn't need root access to do anything with flatpak, try adding the --user flag which should force a user specific install directory instead of a global one.
Ah thanks, that didn’t show up in the global help message. Will look into it then.
Starting with version 1.5.2, pympress installed via pip also installs a desktop file and an icon file.
Well, building RPMs is also sorted now, the recipe is here:
https://github.com/Cimbali/pympress/blob/5b98551ff9f469bf7f0b78d3887ff7d5dce935f7/github/workflows/build_binary.yml
There is a different RPM per python version, as the abis are incompatible. All the RPMs should work on all RPM-based platforms. but were tested on SUSE and Fedora only.
Better rpms now available on COPR
I've uploaded Pympress 1.5.3 to Debian (bullseye) https://packages.debian.org/bullseye/pympress .Sorry for not attending to this before now.
Refocused the issue as a .desktop file is included and installed in OS-specified place currently. If someone wants to package on flathub, they can, but I won’t have resources (mostly time) to do so myself.