mesonbuild / mesonbuild/meson

Using a custom VAPI does not generate a -pkg foo flag

Open
#2,103 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug gnome language:vala
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

The current 'Using a custom VAPI' (with pkg-config file) example on the wiki does not work for me.
I need to explicitly add a --pkg=foo to the executable line. I can only assume that this is a bug?
e.g.
change

```project('vala app', 'c', 'vala')

add_project_arguments(['--vapidir', join_paths(meson.current_source_dir(), 'vapi')],
language: 'vala')

glib_dep = dependency('glib-2.0')
gobject_dep = dependency('gobject-2.0')
foo_dep = dependency('foo') # 'foo.vapi' will be resolved in './vapi/foo.vapi'

executable('app', 'app.vala', dependencies: [glib_dep, gobject_dep, foo_dep])
```
to
```project('vala app', 'c', 'vala')

add_project_arguments(['--vapidir', join_paths(meson.current_source_dir(), 'vapi')],
language: 'vala')

glib_dep = dependency('glib-2.0')
gobject_dep = dependency('gobject-2.0')
foo_dep = dependency('foo') # 'foo.vapi' will be resolved in './vapi/foo.vapi'

executable('app', 'app.vala', dependencies: [glib_dep, gobject_dep, foo_dep], vala_args: ['--pkg=foo'])
```

BTW, on the 'Using a custom VAPI' (with no pkg-config file) example, the foo_vapi line is missing a closing parentheses.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Reproduce the two “Using a custom VAPI” wiki examples, comparing dependency handling with and without a pkg-config file; done means the generated Vala invocation handles the custom package as expected and the documentation example has the missing closing parenthesis corrected.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.