Feature Request: Flatpak for Linux

All your suggestions, requests and ideas for future development
tydog98
Posts: 12
Joined: 03 Nov 2021, 14:40

Feature Request: Flatpak for Linux

Post by tydog98 »

A Flatpak would be a great way to get Filebot to Linux users who do not use Snap. Many users dislike Snap for its proprietary servers. It would also be nice to not need to install another whole sandboxing system just for a single program.
User avatar
rednoah
The Source
Posts: 20846
Joined: 16 Nov 2011, 08:59

Re: Feature Request: Flatpak for Linux

Post by rednoah »

Which Linux distribution are you using? Does none of the classic package managers work for you? The APT, YUM and AUR repositories should cover most users.


:idea: I'd generally recommend installing via the apt repository on any Debian-based machine, even on Ubuntu machines where snap would be a built-in option.
:idea: Please read the FAQ and How to Request Help.
tydog98
Posts: 12
Joined: 03 Nov 2021, 14:40

Re: Feature Request: Flatpak for Linux

Post by tydog98 »

I am using Fedora. Using the RPM you provided works fine but personally I just don't like having unmanaged packages I can forget to update installed. As for the repo, I just find using 3rd party repos sketchy in general (even if I know they're trusted) and would prefer a Flatpak to that if I can. I actually think having Flatpak being the sole option of downloading for Linux users would probably be a better choice for everyone in this scenario. You have a stable environment to target that you know won't break and wont have to package for each distro. Users have a convenient and trusted place to install their software from and they know it will work.
User avatar
rednoah
The Source
Posts: 20846
Joined: 16 Nov 2011, 08:59

Re: Feature Request: Flatpak for Linux

Post by rednoah »

Do you know any popular programs that have both GUI and CLI (i.e. a seamless experience on both Linux Desktop and a Linux headless server would be ideal) that are packaged with Flatpak for reference? I haven't looked into this space for years.

Since I got burned by snap already (nightmare to build and maintain; especially for non-amd64 architectures; angry users due to unexpected filesystem access limitations; few users prefer it over apt if given the choice; etc) I'm less inclined to do anything other than classic package repositories that everyone is familiar with already.
:idea: Please read the FAQ and How to Request Help.
tydog98
Posts: 12
Joined: 03 Nov 2021, 14:40

Re: Feature Request: Flatpak for Linux

Post by tydog98 »

I cannot think of any off the top of my head. I know you can pass CLI arguments to the Flatpak but it's more of a pain than native (have to write the entire name ex: org.videolan.VLC for VLC). Tools like Flatseal make it easy for users to customize what the Flatpak can and cannot access (including filesystems). I don't have any experience packaging for it either so sadly I can't speak on that.
snarf3l
Posts: 6
Joined: 29 Dec 2021, 20:27

Re: Feature Request: Flatpak for Linux

Post by snarf3l »

rednoah wrote: 09 Dec 2021, 09:35 Do you know any popular programs that have both GUI and CLI (i.e. a seamless experience on both Linux Desktop and a Linux headless server would be ideal) that are packaged with Flatpak for reference? I haven't looked into this space for years.

Since I got burned by snap already (nightmare to build and maintain; especially for non-amd64 architectures; angry users due to unexpected filesystem access limitations; few users prefer it over apt if given the choice; etc) I'm less inclined to do anything other than classic package repositories that everyone is familiar with already.
Sorry to hear about Snap. I would suggest asking on the FlatHub forums: https://discourse.flathub.org/

I would ask, but I suspect they'll be more responsive to the app's actual developer. As a Linux user, would love to see a Flatpak for this since distros like Fedora Silverblue are going with flatpaks as the primary method that's used for package management over .rpm. And as an enduser, being able to update via package manager through FlatHub rather than manually downloading .rpm from the FB site would be nice.
tydog98
Posts: 12
Joined: 03 Nov 2021, 14:40

Re: Feature Request: Flatpak for Linux

Post by tydog98 »

Silverblue is a good point. Immutable environments seems to be the direction Fedora is heading in, and I think some others are playing around with it too.
User avatar
rednoah
The Source
Posts: 20846
Joined: 16 Nov 2011, 08:59

Re: Feature Request: Flatpak for Linux

Post by rednoah »

For the time being, I'll probably handle Flatpak same as AUR. Let the community maintain the package if somebody is interested in taking the maintainer role, but happily provide support and dedicated binary builds if needed.

I'm currently evaluating official unRAID support, so that will likely be the next supported platform as far as packaging is concerned. I might come around to Flatpak again after that, but it might be a while. 🙏
:idea: Please read the FAQ and How to Request Help.
tydog98
Posts: 12
Joined: 03 Nov 2021, 14:40

Re: Feature Request: Flatpak for Linux

Post by tydog98 »

Tried to see if I could get started myself building a Flatpak, but apparently the program modifies its own installation directory, which Flatpak does not support.

Here is a Reddit thread I made for the issue, someone mentioned using the XDG directory specification:
https://old.reddit.com/r/flatpak/commen ... ppbindata/
tydog98
Posts: 12
Joined: 03 Nov 2021, 14:40

Re: Feature Request: Flatpak for Linux

Post by tydog98 »

Actually I got it to work using a work around someone else posted. Fonts look terrible but I will look into that later.
User avatar
rednoah
The Source
Posts: 20846
Joined: 16 Nov 2011, 08:59

Re: Feature Request: Flatpak for Linux

Post by rednoah »

You'll want to modify filebot.sh to configure various variables to suit your environment. You could start by copying and modifying the filebot.sh from the SNAP package, or the AUR tarball. That should illustrate all the options you might want, configure where settings are stored, etc.

The *-aur.tar.xz tarball will be more suitable for you as a base, because the files inside are meant to be installed into the system rather than run from some random folder like the portable. It'll also include all the files you will need for Desktop integration, file type associations, etc.
:idea: Please read the FAQ and How to Request Help.
bb1netusaf2004
Posts: 3
Joined: 15 Jan 2022, 22:17

Re: Feature Request: Flatpak for Linux

Post by bb1netusaf2004 »

More options are great, but at a minimum thank you for publishing/maintaining an rpm package. I wouldn't have bought it otherwise. Also it might be worth looking into AppImage. It's not as popular as flatpak or snap but it's dead simple and a lot of GUI applications are starting to have AppImage downloads. The AppImage for kdenlive is a godsend.
snarf3l
Posts: 6
Joined: 29 Dec 2021, 20:27

Re: Feature Request: Flatpak for Linux

Post by snarf3l »

tydog98 wrote: 08 Jan 2022, 18:44 Actually I got it to work using a work around someone else posted. Fonts look terrible but I will look into that later.
Awesome! Any chance you could publish it to Flathub? https://github.com/flathub/flathub/wiki/App-Submission
Even if the fonts don't look great, it's better than nothing.
tydog98
Posts: 12
Joined: 03 Nov 2021, 14:40

Re: Feature Request: Flatpak for Linux

Post by tydog98 »

It also doesn't have a desktop icon or anything like that. It turns out it's fairly hard to create a Flatpak if you cannot build from source. I'm sure I could try doing some crazy symlinking to get things to work but I'm a bit over my head at this point. Here is a paste with the yml I have so far if anyone else would like a try at it. https://pastebin.com/A8WKRU44
Razze
Posts: 12
Joined: 26 Aug 2015, 20:26

Re: Feature Request: Flatpak for Linux

Post by Razze »

I've pushed something here, fixed a few things, the font for e.g.
As I couldn't find an official appdata file I had to improvise, so if there is one, I can copy, that would be appreciated
https://github.com/razzeee/net.filebot.Filebot

There are some problems with filepickers, as it seems like JFXPanel is not happy, but it's kinda working. At least when you enter the license via copy.

Code: Select all

Failed to initialize JavaFX: java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
	at net.filebot.util.ui.SwingUI.useJavaFX(Unknown Source)
	at net.filebot.UserFiles$FileChooser$6.showLoadDialogSelectFiles(Unknown Source)
	at net.filebot.UserFiles.selectSelectFiles(Unknown Source)
	at net.filebot.UserFiles.lambda$showLoadDialogSelectFiles$0(Unknown Source)
	at net.filebot.UserFiles.lambda$withModeSelect$4(Unknown Source)
	at net.filebot.util.ui.SwingUI.withWaitCursor(Unknown Source)
	at net.filebot.UserFiles.lambda$withModeSelect$5(Unknown Source)
	at net.filebot.util.ui.SwingUI.lambda$invokeLater$9(Unknown Source)
	at net.filebot.UserFiles.withModeSelect(Unknown Source)
	at net.filebot.UserFiles.showLoadDialogSelectFiles(Unknown Source)
	at net.filebot.ui.transfer.LoadAction.actionPerformed(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.embed.swing.JFXPanel
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	... 11 more
User avatar
rednoah
The Source
Posts: 20846
Joined: 16 Nov 2011, 08:59

Re: Feature Request: Flatpak for Linux

Post by rednoah »

The *-portable.tar.xz isn't suitable for "installed" deployment. You'll want to start with *-aur.tar.xz instead and then add patches (i.e. modify filebot.sh to suit the environment) as needed. The error message above means that JavaFX is not in the module path.
:idea: Please read the FAQ and How to Request Help.
Razze
Posts: 12
Joined: 26 Aug 2015, 20:26

Re: Feature Request: Flatpak for Linux

Post by Razze »

rednoah wrote: 29 Jan 2022, 05:16 The *-portable.tar.xz isn't suitable for "installed" deployment. You'll want to start with *-aur.tar.xz instead and then add patches (i.e. modify filebot.sh to suit the environment) as needed. The error message above means that JavaFX is not in the module path.
Yeah, saw you message about that yesterday and actually played with a version using the aur file, but couldn't get it to work due to it complaining about not being able to access the jar file on start. Which I couldn't figure out.
I'll try again these days :)
User avatar
rednoah
The Source
Posts: 20846
Joined: 16 Nov 2011, 08:59

Re: Feature Request: Flatpak for Linux

Post by rednoah »

You'll need to modify the filebot.sh file so that the following variables / paths make sense within the flatpak container / environment:

Code: Select all

FILEBOT_HOME="/usr/share/filebot"

Code: Select all

APP_DATA="$HOME/.config/filebot"
LIBRARY_PATH="$FILEBOT_HOME/lib/$(uname -m):/lib64"
MODULE_PATH=$(echo /usr/lib/jvm/java-*-openjdk/lib/javafx.* | tr ' ' ':')
:idea: Please read the FAQ and How to Request Help.
Razze
Posts: 12
Joined: 26 Aug 2015, 20:26

Re: Feature Request: Flatpak for Linux

Post by Razze »

I think I've got it to work with the aur package.

Also was able to get rid of some more errors, the javafx thing is still happening, but I'm not sure if that actually breaks something.
Otherwise it needs testing I guess.
tydog98
Posts: 12
Joined: 03 Nov 2021, 14:40

Re: Feature Request: Flatpak for Linux

Post by tydog98 »

Is there anything in specific we should test for?
User avatar
rednoah
The Source
Posts: 20846
Joined: 16 Nov 2011, 08:59

Re: Feature Request: Flatpak for Linux

Post by rednoah »

Don't worry about JavaFX. That's just used as an API for the GTK FileChooser.

FileBot 4.9.5 and up can be configured to use the zenity command-line tool instead. The latter is typically available via the package manager.
:idea: Please read the FAQ and How to Request Help.
Razze
Posts: 12
Joined: 26 Aug 2015, 20:26

Re: Feature Request: Flatpak for Linux

Post by Razze »

Not sure what to test for, but I basically only do renaming with local hdd to smb network drive


I'm trying to set it up with zenity now, but I might be missing something, check the code in the repo please

This is what happens at runtime:

Code: Select all

SystemProperty: net.filebot.UserFiles.fileChooser: java.lang.IllegalArgumentException: No enum constant net.filebot.UserFiles.FileChooser.Zenity
Failed to initialize JavaFX: java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
	at net.filebot.util.ui.SwingUI.useJavaFX(Unknown Source)
	at net.filebot.UserFiles$FileChooser$6.showLoadDialogSelectFiles(Unknown Source)
	at net.filebot.UserFiles.selectSelectFiles(Unknown Source)
	at net.filebot.UserFiles.lambda$showLoadDialogSelectFiles$0(Unknown Source)
	at net.filebot.UserFiles.lambda$withModeSelect$1(Unknown Source)
	at net.filebot.util.ui.SwingUI.withWaitCursor(Unknown Source)
	at net.filebot.UserFiles.lambda$withModeSelect$2(Unknown Source)
	at net.filebot.util.ui.SwingUI.lambda$invokeLater$9(Unknown Source)
	at net.filebot.UserFiles.withModeSelect(Unknown Source)
	at net.filebot.UserFiles.showLoadDialogSelectFiles(Unknown Source)
	at net.filebot.ui.transfer.LoadAction.actionPerformed(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.embed.swing.JFXPanel
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	... 11 more
User avatar
rednoah
The Source
Posts: 20846
Joined: 16 Nov 2011, 08:59

Re: Feature Request: Flatpak for Linux

Post by rednoah »

Razze wrote: 01 Feb 2022, 18:47

Code: Select all

SystemProperty: net.filebot.UserFiles.fileChooser: java.lang.IllegalArgumentException: No enum constant net.filebot.UserFiles.FileChooser.Zenity
FileBot 4.9.5 (beta) and up can be configured to use the zenity. FileBot 4.9.4 (current stable release) and below cannot.
:idea: Please read the FAQ and How to Request Help.
Razze
Posts: 12
Joined: 26 Aug 2015, 20:26

Re: Feature Request: Flatpak for Linux

Post by Razze »

Doesn't seem like there are aur builds in the beta folder :/
User avatar
rednoah
The Source
Posts: 20846
Joined: 16 Nov 2011, 08:59

Re: Feature Request: Flatpak for Linux

Post by rednoah »

Yeah. Nobody is testing AUR tarball builds. Don't worry about it. The next stable release should be ready within the month.
:idea: Please read the FAQ and How to Request Help.
Post Reply