flathub / io.atom.Atom

https://flathub.org/apps/details/io.atom.Atom
6 stars 7 forks source link

How to use commands from anther Flatpak app? #8

Open nalimilan opened 6 years ago

nalimilan commented 6 years ago

I am preparing a Flatpak app for the Julia language, which has an Atom plugin called uber-juno. Unfortunately, the julia command is not available from Atom even when the Julia app is installed. The same issue probably impacts other languages.

Do you know what would be the best way to handle this? I guess Atom should declare an extension so that Julia and similar packages can mount a symlink to their command?

TingPing commented 6 years ago

Yes adding an extension point is about all we can do.

TingPing commented 6 years ago

Ok so I added an extension point: https://github.com/flathub/io.atom.Atom/commit/ca57fca968af337ce5da2a82a4977704c38fd49d

An example of how you would build an extension: https://github.com/flathub/io.github.Hexchat.Plugin.Perl

You will need to manually set the full path to julia in Atom but otherwise shouldn't be too bad.

nalimilan commented 6 years ago

That's great, thanks! Juno can probably be adapted to look for Julia in that directory.

I've tried using the new extension, and so far I couldn't get the mount point to appear at /app/extensions when running flatpak run --command=bash io.atom.Atom after installing my Julia app. I'm using

    "--extension=io.atom.Atom.Extension.julia=version=1.6",
    "--extension=io.atom.Atom.Extension.julia=no-autodownload=true",
    "--extension=io.atom.Atom.Extension.julia=directory=extensions/julia"

and installing files under /app/extensions/julia/. What I am doing wrong?

BTW, what's the best way to make the julia executable available to Atom/Juno? At first I thought a symlink would be enough, but that doesn't work since paths change. So I now use hardlinks via cp -al. What do you think?

TingPing commented 6 years ago

I'm not actually sure about the way you are attempting to do it, I've only build the extension as shown in my HexChat example which is what I suggest you do.

nalimilan commented 6 years ago

Unfortunately I can't use exactly the same approach, since I need to implement the extension directly from the Julia package. It wouldn't be great to have to install the extension separately, especially since it would duplicate all files and configuration (which you may want to share between several ways of running Julia). But the documentation about this is quite sparse...

nalimilan commented 6 years ago

I've probably misunderstood --extension=: it seems that it declares an extension point rather than implements it. I'm not even sure it's possible to implement an extension from a standard app. At least if I need to make a separate extension, it would be nice to have it installed automatically when installing Julia...

TingPing commented 6 years ago

Yes it would be its own package. No it can't be automatically installed.