Skip to content

Commit

Permalink
Integrate the vala example into the project
Browse files Browse the repository at this point in the history
  • Loading branch information
wmww committed Apr 24, 2023
1 parent 3fa145c commit 7d3ea1f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 57 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ jobs:
run: ninja -C build test
- name: Install
run: sudo ninja -C build install
- name: Meson Vala example
run: cd examples/vala-standalone && meson ../../vala-build
- name: Build Vala example
run: ninja -C vala-build
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The easiest way to build against GTK Layer Shell is to use the `gtk-layer-shell-
[examples/simple-example.py](examples/simple-example.py) contains sample Python code.

### Vala
[examples/vala-standalone](examples/vala-standalone) contains a minimal working standalone Vala project, see [the readme](examples/vala-standalone/README.md) for details.
[examples/simple-example.vala](examples/simple-example.vala) contains a minimal working Vala app.

### Rust
[@pentamassiv](https://github.com/pentamassiv) maintains [safe Rust bindings](https://github.com/pentamassiv/gtk4-layer-shell-gir) and the [crates.io crate](https://crates.io/crates/gtk4-layer-shell/). Rust examples can be found [here](https://github.com/pentamassiv/gtk4-layer-shell-gir/tree/main/gtk4-layer-shell/examples).
Expand Down Expand Up @@ -63,7 +63,7 @@ sudo apt install meson libwayland-dev libgtk-4-dev gobject-introspection libgire
* `-Ddocs` (default `false`): If to generate the docs
* `-Dtests` (default `false`): If to build the tests
* `-Dintrospection` (default: `true`): If to build GObject Introspection data (used for bindings to languages other than C/C++)
* `-Dvapi` (default: `true`): If to build VAPI data (allows this library to be used in Vala). Requires `-Dintrospection=true`
* `-Dvapi` (default: `true`): If to build VAPI data and Vala example. The VAPI file allows this library to be used in Vala. Requires `-Dintrospection=true`

### Running the Tests
* `ninja -C build test`
Expand Down
10 changes: 9 additions & 1 deletion examples/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
subdir('demo')
# vala-standalone is it's own meson project, so do not subdir() it

executable(
'gtk4-layer-demo',
Expand All @@ -14,3 +13,12 @@ executable(
build_by_default: get_option('examples'),
dependencies: [gtk, gtk_layer_shell],
install: false)

if get_option('vapi')
add_languages('vala')
executable(
'simple-example-vala',
files('simple-example.vala'),
dependencies: [gtk, gtk_layer_shell, vapi],
install: false)
endif
11 changes: 0 additions & 11 deletions examples/vala-standalone/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions examples/vala-standalone/main.vala

This file was deleted.

13 changes: 0 additions & 13 deletions examples/vala-standalone/meson.build

This file was deleted.

2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if get_option('introspection')
install: true)

if get_option('vapi')
gnome.generate_vapi(
vapi = gnome.generate_vapi(
pkg_config_name,
sources: gir[0],
packages: 'gtk4',
Expand Down

0 comments on commit 7d3ea1f

Please sign in to comment.