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

Rationalise building section #98

Merged
merged 1 commit into from
Mar 22, 2018
Merged

Rationalise building section #98

merged 1 commit into from
Mar 22, 2018

Conversation

allanday
Copy link
Collaborator

There's a fair amount of technical content here, which would benefit from being checked.


Runtimes require regular maintenance, and application developers should generally not consider creating their own.

Once you have chosen a runtime for your application, you will need to install it. Runtimes are installed in exactly the same way as applications, with the ``flatpak install`` command. For example, the command to install the GNOME 3.26 runtime is::
Copy link
Member

Choose a reason for hiding this comment

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

It may be worth noting end users do not need to manually install runtimes. And actually developers don't need to either if they specify --install-deps-from=flathub when using flatpak-builder.

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.

Each Flatpak is built using a manifest file which provides basic information about the application and instructions for how it is to be built. To add a manifest to the hello world app, add the following to an empty file:

.. code-block:: json
The input to ``flatpak-builder`` is a JSON file that describes the parameters for building the application. This is called the manifest. The following example is the manifest for the GNOME Dictionary application::

{
Copy link
Member

Choose a reason for hiding this comment

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

You should keep -.. code-block:: json for syntax highlighting.

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.

"sdk": "org.gnome.Sdk",
"command": "gnome-dictionary",
"finish-args": [
"--socket=x11",
Copy link
Member

Choose a reason for hiding this comment

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

I realize you are trying to be minimal but this leaves some bad habits like not including --socket=wayland and --share=ipc for Gtk3 applications.

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 only reason those are the only sandbox permissions in the example is that they're what's in the manifest I inherited. I'd love to have a better demo with a sane set of options in it (that's #97)!

Copy link
Member

@TingPing TingPing Mar 22, 2018

Choose a reason for hiding this comment

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

All Gtk3 applications will have like 7 or so permissions to just be fully functional.

Add a section on specifying the list of modules. There has to be something to say here...
- ``rename-icon`` - rename the application icon
- ``rename-desktop-file`` - rename the ``.desktop`` filename
- ``rename-appdata-file`` - rename the AppData file
Copy link
Member

@TingPing TingPing Mar 22, 2018

Choose a reason for hiding this comment

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

You should note that these should not be relied upon by upstreams and they should always rename their files there. That fixes subtle mistakes like icons being referenced internally and such. And some things like the app-id in code cannot be automagically renamed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If that's the case, should I just remove the entire section on file renaming?

Copy link
Member

Choose a reason for hiding this comment

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

They certainly need to be documented because a lot of applications use it, there just needs to be clear information on the better solution like #99

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alright, I've just added a note for now.

@@ -51,7 +60,7 @@ A list of ``finish-args`` options can be found in :doc:`sandbox-permissions`.
Cleanup
-------

After building has taken place, ``flatpak-builder`` performs a cleanup phase. This can be used to remove headers and development documentation, among other things. Two properties in the manifest file are used for this. First, a list of filename patterns can be included::
The cleanup build can be used to remove files that are produced by the build process but which aren't wanted as part of the application, such as headers or developer documentation. Two properties in the manifest file are used for this. First, a list of filename patterns can be included::
Copy link
Member

Choose a reason for hiding this comment

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

The cleanup build

cleanup property.

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.

"url": "https://download.gnome.org/sources/gnome-dictionary/3.26/gnome-dictionary-3.26.0.tar.xz",
"sha256": "387ff8fbb8091448453fd26dcf0b10053601c662e59581097bc0b54ced52e9ef"
}
]
Copy link
Member

Choose a reason for hiding this comment

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

whitespace.

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, I think.

- ``script`` - an array of shell commands (these are put in a shellscript file)
- ``patch`` - a patch (are applied to the source directory)
- ``extra-data`` - data that can be downloaded at install time; this can include archive or package files

Copy link
Member

Choose a reason for hiding this comment

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

Missing shell

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.

- Get rid of the spurious flatpak-builder tutorial
- Make the flatpak-builder tutorial more instructive
- Integrate the tutorial into the rest of the building pages
- Expand some the pages on flatpak-builder and manifests

Fixes #74. Helps with #24, #66 and #69
@allanday allanday merged commit 4e94758 into master Mar 22, 2018
@allanday allanday deleted the building-improvements branch March 22, 2018 17:05
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.

3 participants