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

Flatpak packaging scripts #13

Merged
merged 11 commits into from
Mar 26, 2020
Merged

Flatpak packaging scripts #13

merged 11 commits into from
Mar 26, 2020

Conversation

rinigus
Copy link
Contributor

@rinigus rinigus commented Mar 25, 2020

This adds packaging scripts for Flatpak and corresponding README. This resolves the first part of issue #1.

Related to #1

@rinigus
Copy link
Contributor Author

rinigus commented Mar 25, 2020

Additional note, this PR also defines official 'long' name of Mirage. Its based on recommended identifiers (https://docs.flatpak.org/en/latest/using-flatpak.html#identifiers) and similar to the ones using github for the distribution/development. If you have some other idea, please correct it.

Copy link
Owner

@mirukana mirukana left a comment

Choose a reason for hiding this comment

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

I'm waiting for the massive KDE SDK to finish downloading currently, once I can build the flatpak I might update the review.

.gitignore Show resolved Hide resolved
mirage.pro Outdated Show resolved Hide resolved
packaging/flatpak/README.md Outdated Show resolved Hide resolved
packaging/flatpak/README.md Outdated Show resolved Hide resolved
packaging/flatpak/README.md Outdated Show resolved Hide resolved
packaging/flatpak/generate-flatpak-script.sh Outdated Show resolved Hide resolved
packaging/flatpak/generate-flatpak-script.sh Outdated Show resolved Hide resolved
packaging/flatpak/generate-flatpak-script.sh Outdated Show resolved Hide resolved
packaging/flatpak/generate-flatpak-script.sh Outdated Show resolved Hide resolved
packaging/flatpak/generate-flatpak-script.sh Outdated Show resolved Hide resolved
@mirukana
Copy link
Owner

Additional note, this PR also defines official 'long' name of Mirage. Its based on recommended identifiers (https://docs.flatpak.org/en/latest/using-flatpak.html#identifiers) and similar to the ones using github for the distribution/development. If you have some other idea, please correct it.

I guess this is fine since I don't have a domain name, shouldn't it be com.github... though?

@mirukana
Copy link
Owner

Running the flatpak-builder command ends with this:

========================================================================
Building module pyotherside in /home/kana/git/mirage-forks/rinigus/.flatpak-builder/build/pyotherside-1
========================================================================
bwrap: execvp qmake: Permission denied
Error: module pyotherside: Child process exited with code 1

Do you have any idea?

@rinigus
Copy link
Contributor Author

rinigus commented Mar 25, 2020

Is that building for AMD64 on AMD64, right? Maybe reboot is needed after flatpak install?

@mirukana
Copy link
Owner

I solved it, turns out my /var partition mounted with noexec was the problem... a sudo mount -o remount,exec /var fixed it. I also had to install elfutils from my distro's repository; it would be good to have a note about these in the README.

Now I have another problem:

========================================================================
Building module python3-jsonschema in /home/kana/git/mirage-forks/rinigus/.flatpak-builder/build/python3-jsonschema-1
========================================================================
Running: pip3 install --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} jsonschema==3.2.0
Looking in links: file:///run/build/python3-jsonschema
Collecting jsonschema==3.2.0
Requirement already satisfied: setuptools in /usr/lib/python3.7/site-packages (from jsonschema==3.2.0) (40.8.0.post20191206)
Requirement already satisfied: six>=1.11.0 in /usr/lib/python3.7/site-packages (from jsonschema==3.2.0) (1.11.0)
Requirement already satisfied: attrs>=17.4.0 in /app/lib/python3.7/site-packages (from jsonschema==3.2.0) (19.3.0)
Collecting importlib-metadata; python_version < "3.8" (from jsonschema==3.2.0)
  Could not find a version that satisfies the requirement importlib-metadata; python_version < "3.8" (from jsonschema==3.2.0) (from versions: )
No matching distribution found for importlib-metadata; python_version < "3.8" (from jsonschema==3.2.0)

I have Python 3.8 outside of this and jsonschema installs fine. It also looks like 3.8 is installed in the flatpak-env dir.

@rinigus
Copy link
Contributor Author

rinigus commented Mar 25, 2020

importlib-metadata is in the list of packages, but looks like its required as a dependency for others. So, we probably have to list it in collector.py

@rinigus
Copy link
Contributor Author

rinigus commented Mar 25, 2020

All the suggested changes should be in now, please review

@rinigus
Copy link
Contributor Author

rinigus commented Mar 25, 2020

Re python: inside Flatpak KDE SDK 5.12, looks like we have python 3.7. Maybe that is an issue?

Would it work for you if you go immediately into the step with building from available packaging/flatpak/mirage.flatpak.yaml?

Comment on lines 30 to 31
To build flatpak package, you will need flatpak, flatpak-builder,
runtime and SDK (KDE 5.12), and flatpak-builder. flatpak-builder is
Copy link
Owner

Choose a reason for hiding this comment

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

flatpak-builder is listed twice.
I think this would flow better: "you will need flatpak, flatpak-builder, and the KDE 5.12 runtime + SDK."

Comment on lines 14 to 17
[requirements.txt](../../requirements.txt). At the moment of writing,
included packages are `multidict` with the version that installs in
Flatpak (newer versions seem to have some issues), `uvloop`, and few
packages required for building other packages.
Copy link
Owner

Choose a reason for hiding this comment

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

No need to list the included packages, we can just go see the the requirements files

@mirukana
Copy link
Owner

Would it work for you if you go immediately into the step with building from available packaging/flatpak/mirage.flatpak.yaml?

You mean not running the generate script before the build commands?

@rinigus
Copy link
Contributor Author

rinigus commented Mar 25, 2020

Yes, use mirage.flatpak.yaml as available at repository

@mirukana
Copy link
Owner

Good news, it builds successfully with the provided yaml! Before merging, some instructions should be added to the README:

  • When to or not to use the generate script
  • When not using the generate script, how to fetch flatpak-pip-generator
  • How to run the built flatpak file

The commands should also be changed to have the resulting files in build/flatpak instead of ../flatpak-repo which probably won't be appropriate for the user. The appimage building script also stores the resulting file and folder structure in build, and this also allows make clean to do its job.

@rinigus
Copy link
Contributor Author

rinigus commented Mar 26, 2020

You don't need flatpak-pip-generator if the manifest is not generated, so no need to download that.

Updates are done as requested. If there are small changes that are needed to be done, please feel free to make them in this branch as the commits from maintainers are allowed.

@mirukana
Copy link
Owner

I made some more minor improvements. Last question: the installed Mirage flatpak doesn't read the user config (~/.config/mirage and ~/.local/share/mirage), is this expected? Where does it read and write them?

@rinigus
Copy link
Contributor Author

rinigus commented Mar 26, 2020

Thanks, looking good! As for settings, they are in ~/.var/app/io.github.mirukana.mirage/config/mirage. Note that you can open that folder by clicking on gear button in Mirage :)

@mirukana
Copy link
Owner

Wonder why I didn't think about that... Anyway, thanks for all the work.

@mirukana mirukana merged commit df506e5 into mirukana:master Mar 26, 2020
@mirukana
Copy link
Owner

I will take a look at publishing the app on both AppImageHub and Flathub next week, until then I'll add the .flatpak file to the release page and relevant instructions in INSTALL.md.

@rinigus rinigus mentioned this pull request Mar 26, 2020
2 tasks
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.

2 participants