-
Notifications
You must be signed in to change notification settings - Fork 73
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
provide flatpak #1190
Comments
There used to be an official document on how to bundle Java applications with Flatpak. It was removed because some of the information was outdated (and apparently no one remembers why). The original documentation can still be found in Flatpak's GitHub history, as noted in the above GitHub issue. It could probably be used as a starting point. I actually wanted to open up a feature request for packaging Phoenicis as a Flatpak so you beat me to it! I'm glad to see you guys are open to embracing a cross-platform packaging platform that's mature and secure. ;-) |
I've actually tried to build a flatpak. However, I didn't quite succeed. My main issue was: flatpak/flatpak-builder#58 (I see that the tutorial uses a pre-built binary). I must admit that I have absolutely no experience with flatpak so if you manage to get something working you're very welcome to share it here. |
It appears that Maven isn't installed by default in any of the available run-time environments. Adding that will have to be part of the Flatpak build instructions for Phoenicis. https://maven.apache.org/install.html An extension, such as this one for OpenJDK 1.9, will also need to be used with the Flatpak to provide Java in the run-time environment. I honestly do not have much real-world experience with Flatpak, either, besides being an end-user/consumer of it. I would love to use it more for packaging. As a Python developer, most of my needs are handled by packaging for PiPy (pip) and using docker containers. |
I think with the current environment available, it is too complicated to build the flatpak from the sources. Using a pre-compiled .jar is more realistic in my opinion. |
You're probably right. Sticking with a single distributable Jar file might make more sense. Depedencies would still have to be handled by other means. I know there's DEB packaging support in here already. I could work on creating an RPM for Fedora and CentOS/RHEL. As opposed to Flatpak, I have extensive experience with packaging using RPM. |
That would be great! If possible integrated in the Maven build. |
{
"app-id": "org.phoenicis.javafx",
"runtime": "org.freedesktop.Platform",
"runtime-version": "1.6",
"sdk": "org.freedesktop.Sdk",
"command": "phoenicis-javafx",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.openjdk9"
],
"finish-args": [
"--share=ipc",
"--socket=x11",
"--share=network",
"--filesystem=host",
"--env=PATH=/usr/bin:/app/bin:/usr/lib/sdk/openjdk9/bin"
],
"modules": [
{
"name": "javafx",
"buildsystem": "simple",
"build-commands": [
"install -D phoenicis-javafx /app/bin/phoenicis-javafx",
"install -D phoenicis-javafx-5.0-SNAPSHOT-jfx.jar /app/phoenicis/phoenicis-javafx.jar",
"cp -r lib /app/phoenicis"
],
"sources": [
{
"type": "dir",
"path": "phoenicis-javafx/target/jfx/app"
},
{
"type": "script",
"dest-filename": "phoenicis-javafx",
"commands": [
"cd /app/phoenicis",
"java -jar phoenicis-javafx.jar \"$@\""
]
}
]
}
]
} This gives me:
Hint: you might need a newer |
I guess you flatpak uses Java 9? I see two solutions for the problem:
|
There was a problem with OpenJDK 9 but I'm not sure if it explains this issue. Seems to be much more general for me than JavaFX. I cannot use Java 8 because there's no extension for it. |
@alexlarsson is it correct that the OpenJDK 9 extension cannot run JavaFX apps or am I doing something wrong? |
{
"app-id": "org.phoenicis.javafx",
"runtime": "org.freedesktop.Platform",
"runtime-version": "1.6",
"sdk": "org.freedesktop.Sdk",
"command": "phoenicis-javafx",
"finish-args": [
"--share=ipc",
"--socket=x11",
"--share=network",
"--filesystem=host",
"--device=dri"
],
"modules": [
{
"name": "javafx",
"buildsystem": "simple",
"build-commands": [
"install -D phoenicis-javafx /app/bin/phoenicis-javafx",
"cp -r phoenicis-javafx-5.0-SNAPSHOT /app/phoenicis",
"chmod 755 -R /app/phoenicis"
],
"sources": [
{
"type": "dir",
"path": "phoenicis-javafx/target/jfx/native"
},
{
"type": "script",
"dest-filename": "phoenicis-javafx",
"commands": [
"/app/phoenicis/phoenicis-javafx-5.0-SNAPSHOT \"$@\""
]
}
]
}
]
} Using this with the native bundle gives me:
Update: It kind of works with "runtime": "org.gnome.Platform",
"runtime-version": "3.28",
"sdk": "org.gnome.Sdk", I think the main problem is that the native Linux build depends on the system it is built on. That's also causing issues when using Phoenicis. So this is probably not really an option. |
general flatpak tutorial: http://docs.flatpak.org/en/latest/first-build.html
old flatpak tutorial for Java apps: https://github.com/flatpak/flatpak.github.io/blob/81bb006fd96b9a13170bd876316eb5a4eb48244b/source/bundling-a-java-app.html.haml.markdown
good example (pycharm): https://github.com/flathub/com.jetbrains.PyCharm-Community/blob/f9e57ce185a4c2f6a171f9e5b5f3ba2acd36a475/com.jetbrains.PyCharm-Community.json
The text was updated successfully, but these errors were encountered: