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

README.md - Add Getting started section #29

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't need to be here, really, as the name of the build directory is user-controlled, it could be anything (even if that one matches the instructions in the README).

Copy link

Choose a reason for hiding this comment

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

Side note: recent versions of Meson will automatically generate a .gitignore in the build directory.

29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,32 @@ libportal - Flatpak portal library
==================================

libportal provides GIO-style async APIs for most Flatpak portals.


## Getting started

### The Meson build-system

`libportal` uses Meson to build its projects. To install Meson on your system, follow instructions here: https://mesonbuild.com/Getting-meson.html. If your system is missing a dependency, Meson will tell you which one. How you install your missing dependencies is up to you.

### Build libportal
```
meson build/libportal
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use subdirectories? We usually prefer _build to make it clear that it's not a command on its own.

Copy link

Choose a reason for hiding this comment

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

The idiomatic command is:

meson setup _build

ninja -C build/libportal
Copy link

Choose a reason for hiding this comment

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

Suggested change
ninja -C build/libportal
meson compile -C _build

```

### Build and run portal-test
```
meson build/potal-test -Dbuild-portal-test=true
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto about the sub-directories here. There was a typo in the subdir name.

ninja -C build/portal-test
Copy link

Choose a reason for hiding this comment

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

Suggested change
ninja -C build/portal-test
meson compile -C _build

chmod +x ./build/potal-test/portal-test/portal-test
Copy link
Contributor

Choose a reason for hiding this comment

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

That shouldn't be needed, it's a compiled executable, it should already be executable.

./build/potal-test/portal-test/portal-test
```

### Build and view docs
```
meson build/doc -Dgtk_doc=true
Copy link

Choose a reason for hiding this comment

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

Suggested change
meson build/doc -Dgtk_doc=true
meson setup -Dgtk_doc=true _build

ninja -C build/doc
Copy link

Choose a reason for hiding this comment

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

Suggested change
ninja -C build/doc
meson compile -C _build


# @TODO How to view the docs?
Copy link
Contributor

Choose a reason for hiding this comment

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

gio open build/doc/doc/html/index.html in your example.

```