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

Add Flatpak support #1406

Merged
merged 22 commits into from
Nov 19, 2018
Merged

Add Flatpak support #1406

merged 22 commits into from
Nov 19, 2018

Conversation

plata
Copy link
Collaborator

@plata plata commented Sep 29, 2018

The manifest file is located in phoenicis-dist/src/flatpak.

Required extensions:

  • org.freedesktop.Platform.Compat.i386
  • org.freedesktop.Platform.GL32.nvidia-410-73 (or similar)

To build:

cd phoenicis-dist/src/flatpak/
flatpak-builder build-dir org.phoenicis.javafx.json --force-clean

Run with:

cd phoenicis-dist/src/flatpak/
flatpak-builder build-dir org.phoenicis.javafx.json --force-clean --user --install
flatpak run org.phoenicis.javafx phoenicis-javafx

fixes #1190

@plata
Copy link
Collaborator Author

plata commented Sep 29, 2018

@mbooth101 I'm installing OpenJFX 11 to use it with your OpenJDK 10 extension. It works but I think it would be nice to have an OpenJFX extension as well. Do you think that would be feasible?

@madoar
Copy link
Collaborator

madoar commented Oct 5, 2018

In my opinion we should wait until a flatpak module for Java 11 exists.
Such a module has the big advantage, that we won't need a separate dependency to JavaFX 11, because it can be included in our application (jar-file) via maven.

@plata
Copy link
Collaborator Author

plata commented Oct 5, 2018

Would be nice, yes. Did you take a look at the JDK 10 extension? How hard can it be do adopt this for 11?
In any case the open issues of this pr (see description) must be solved.

@madoar
Copy link
Collaborator

madoar commented Oct 5, 2018

Yes, I've taken a look at the JDK 10 extension at https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk10, which truth be told is quite hard to find on google.
I'm not sure how hard it is to adapt the script to JDK 11.
My problem with the extensions are that they look very hacky to me, where some commands are modified to work specifically with the given JDK version.
I'm not sure how transferable these commands are to JDK 11.

You're right, the most important open task is the open issue.
Could the problem be missing permissions for the sandbox?
For example to download wine?

@plata
Copy link
Collaborator Author

plata commented Oct 6, 2018

I assume that it's a permission issue as well. However, I've no idea what exactly the problem is.

should grant the required permissions (at least to my understanding). I've also tried the switch for permissions for home specifically, but that didn't help either. Phoenicis can read the exisiting library so it cannot be that it doesn't have rights at all. Downloading can also not be the issue because the required Wine version is installed already. Might be that execution permissions (for the Wine executable) require a special setting but I don't know what.

@madoar
Copy link
Collaborator

madoar commented Oct 7, 2018

I may have found the source for the problem.
According to http://docs.flatpak.org/en/latest/sandbox-permissions.html, host blacklists the /tmp/ folder.
Isn't this the folder, where we download wine and other files?

@plata
Copy link
Collaborator Author

plata commented Oct 7, 2018

I think we have a tmp inside .Phoenicis but I have to check.

@Maryse47
Copy link

Maryse47 commented Oct 8, 2018

flatpak-builder --run build-dir org.phoenicis.javafx.json phoenicis-javafx

flatpak-builder --run is known to be broken (it doesn't match flatpak environment correctly.

Use flatpak-builder --force-clean --install --user build-dir org.phoenicis.javafx.json instead then test with flatpak run org.phoenicis.javafx phoenicis-javafx.

@plata
Copy link
Collaborator Author

plata commented Oct 8, 2018

@Maryse47 I've noticed that there are differences already but even with the installed flatpak the issue remains.

@mbooth101
Copy link

@mbooth101 I'm installing OpenJFX 11 to use it with your OpenJDK 10 extension. It works but I think it would be nice to have an OpenJFX extension as well. Do you think that would be feasible?

Hi @plata

Maybe -- I have no exposure to openjfx. How is it built?

BTW, there will be openjdk11 extension very soon: flathub/flathub#669

@plata
Copy link
Collaborator Author

plata commented Oct 10, 2018

@mbooth101 great! Looking forward to the OpenJDK 11 extension. I don't know how OpenJFX is built but if you look at my manifest in this PR, I'm just downloading and unpacking it which seems to be working (at least the GUI starts etc). I was thinking that it might be possible to do just that in an own extension for OpenJFX. Correct me if I'm wrong.

@mbooth101
Copy link

I would just bare in mind that if it has native parts it may need to be built from source in order to support all the Flatpak architectures.

@plata
Copy link
Collaborator Author

plata commented Oct 10, 2018

They only have one Linux build on https://gluonhq.com/products/javafx/ so probably it's not that architecture dependent.

@plata
Copy link
Collaborator Author

plata commented Oct 11, 2018

I think my approach was wrong. Instead of accessing ~/.Phoenicis directly, the flatpak app should work in the sandbox. To achieve this, I set user.home to XDG_DATA_HOME (see https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html). However, the git checkout doesn't work now. This might be related to #1402 but opposed to that, deleting the cache and restarting doesn't solve the issue.

@madoar
Copy link
Collaborator

madoar commented Oct 11, 2018

Did you receive an error message/exception?

@plata
Copy link
Collaborator Author

plata commented Oct 12, 2018

It said something about "<NAK". Not sure if that's an the error but I couldn't see anything else really (fetching the branches etc seemed to work ok). Can you give it a try? I think you know the git repository quite well.

@plata
Copy link
Collaborator Author

plata commented Oct 12, 2018

@LeandroStanger doesn't help, unfortunately.

@madoar
Copy link
Collaborator

madoar commented Oct 13, 2018

@plata I'm not sure I can really help here.
I haven't used flatpak yet, so I'm not really sure how to use it correctly.
Does Phoenicis provide any kind of error message?

Out of interest, can a flatpak installation conflict with a deb installation?

@plata
Copy link
Collaborator Author

plata commented Oct 13, 2018

Description how to use it is in the pr description. It's sandboxed so it shouldn't conflict with the deb install.

@plata
Copy link
Collaborator Author

plata commented Oct 13, 2018

Strange. It worked now. I think it just took longer.

@plata
Copy link
Collaborator Author

plata commented Oct 13, 2018

Now I get:

java.lang.RuntimeException: java.io.IOException: Cannot run program "/home/plata/.var/app/org.phoenicis.javafx/data/.Phoenicis/engines//wine/upstream-linux-x86/3.0.3/bin/wine" (in directory "/home/plata/.var/app/org.phoenicis.javafx/data/.Phoenicis/containers/wineprefix/Notepad"): error=2, file not found

The file exists.

@plata
Copy link
Collaborator Author

plata commented Oct 20, 2018

I've tried to investigate the exception: it happens when luna tries to run regedit. However, the prefix exists so wineboot must have worked. I don't really understand what the difference should be between wine wineboot and wine regedit.

@Maryse47
Copy link

I recommend to open PR in https://github.com/flathub/flathub/pulls . The most capable people to help are there.

@plata
Copy link
Collaborator Author

plata commented Oct 21, 2018

I've fixed the Wine 32bit issue. I could now successfully install and run Notepad++.

@Maryse47 the problem is that they only want stable versions (according to their docs). We're currently in alpha.

@Maryse47
Copy link

You can mark it as WIP or something like that with the intention to not merge it before main app is stable. The goal is to get more help.

@plata
Copy link
Collaborator Author

plata commented Oct 21, 2018

I get your point. I'm just not sure that I need support currently because it seems to be working now. Feel free to give it a try.

<p>Phoenicis ist ein Front-End für Wine.</p>
</description>
<categories>
<category>Game</category>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if Game is the correct category for Phoenicis.
Maybe something like Utility fits better.

<p>Phoenicis is a front-end for Wine.</p>
</description>
<description xml:lang="de">
<p>Phoenicis ist ein Front-End für Wine.</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the translations manageable via Crowdin?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so (it's in the same file and not listed in their supported formats).

Type=Application
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
Icon=org.phoenicis.javafx
Categories=Game
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
Icon=org.phoenicis.javafx
Categories=Game
Keywords=Phoenicis;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlayOnLinux, Wine

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how the keywords need to be split.
If they are split with a ;, the separator between PlayOnLinux and Wine is wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

]
},
{
"name": "openjfx",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still required to install OpenJFX separately?
Starting with Java 11 it should be possible to install JavaFX/OpenJFX via maven.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work somehow. I get:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this indicates a problem with the java command and/or the project setup for Java 11.
Have you only removed the

{
      "name": "openjfx",
      ...
}

block?
Have you also removed the -p /app/javafx-sdk-11/lib argument to the java command?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is: I have only JDK10 here (Ubuntu 18.04). If you check #1408, the maven dependencies do not seem to be enough (according to the tests of @ImperatorS79).

"sdk-extensions": [
"org.freedesktop.Sdk.Extension.openjdk11"
],
"add-extensions": {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be extension for 32bit libGL org.freedesktop.Platform.GL32. Without it, 32bit wine may be unable to use NVidia libGL.
See how steam flatpak adds 32bit extensions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've actually tried that but I always got an error when I tried to flatpak install this. Maybe I just did it wrong. Can you try?

@madoar
Copy link
Collaborator

madoar commented Nov 6, 2018

@plata if this works as intended then I'm fine with merging this PR now.
Still I think we should at least open a new issue for the JavaFX 11 issue (i.e. an installed SDK is required, which looks like a bug/configuration problem to me) or fix it in this PR.

@plata
Copy link
Collaborator Author

plata commented Nov 15, 2018

I would like to merge this. The JavaFX issue is also there if you try to run Phoenicis built with JDK 11. I don't think it's related to Flatpak.

@plata plata merged commit 4366454 into PhoenicisOrg:master Nov 19, 2018
@plata plata deleted the flatpak branch November 19, 2018 17:53
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

Successfully merging this pull request may close these issues.

provide flatpak
5 participants