Please do not follow the instructions below until you have read the entire message.
I've just created an initial Flatpak bundle with coqc
and coq_makefile
(no CoqIDE, no external libraries). The method to install is:
coq-8.13.0-2.flatpak
flatpak install coq-8.13.0-2.flatpak
in a terminalflatpak run org.flatpak.CoqProver
in a terminal. This performs initial setup so coqc
and coq_makefile
can be invoked normally afterwardsHowever, the Flatpak bundle does this (allowing coqc
and coq_makefile
to be invoked normally) by prepending $HOME/.local/bin
to your PATH variable, then copying all the app binaries and associated library files to subdirectories under $HOME/.local
. This means that:
$HOME/.local
)In other words, this is an ugly hack with security implications rather than a solution. I have tried other methods I could think of to make coqc
and coq_makefile
usable as usual and all have failed:
coqc
--> flatpak run org.flatpak.CoqProver coqc
and coq_makefile
--> flatpak run org.flatpak.CoqProver coq_makefile
: this works when they are invoked directly in the terminal, but the Makefile generated by coq_makefile
fails to make use of the coqc
alias$HOME/.local/bin
to /app/bin
in the Flatpak app: this doesn't work since /app
only exists within the Flatpak app and not in the base system, so we are left with dangling linksTo summarize, while attempting to package the Coq ecosystem for Flatpak was an interesting and educational exercise, my experience with it indicates that it is unsuitable for bundling an entire ecosystem, though it might shine as an open-source alternative to Snaps for bundling single, standalone applications.
Related: Improved CLI application experience
As for the repo, I have archived it as I can find no sane way of packaging it as a Flatpak bundle. But if anyone is interested in taking this further and figuring out whether this can be done, feel free to drop me an email and I will happily transfer repo ownership to you.
Instead of completely copying coq_makefile
into .local/bin
, perhaps the following would be sufficient:
flatpak run org.flatpak.CoqProver coq_makefile COQBIN = "$HOME/.local/bin/" "$@"
Indeed I do something similar in the snap (but there I point COQBIN inside the snap, which has a bin directory containing coqc.
How do you know the extracted (?) directory of the snap? Is it deterministic?
I'm sorry to see that flatpak has usability issues. I'm not a big fan of the snapstore being "controlled" by Canonical myself, but I also see how they did an incredible job in making these things simple.
It is deterministic but not predictable at compilation time. But you can recover the path of coqc from the one of coq_makefile (see https://github.com/coq/platform/blob/v8.13/linux/snap/coq_wrapper )
Makes sense. Possibly the same could work for flatpak.
Last updated: Jun 03 2023 at 05:01 UTC