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

Help on how to use these vapis #1

Open
tudo75 opened this issue Apr 15, 2023 · 2 comments
Open

Help on how to use these vapis #1

tudo75 opened this issue Apr 15, 2023 · 2 comments

Comments

@tudo75
Copy link

tudo75 commented Apr 15, 2023

Hi, I tried to use your vapi.
Started testing only libswresample and adding the package dependency to my meson file and also the vapi dir

dependencies = [
    dependency('gtk+-3.0', version: '>= 3.20'),
    dependency('glib-2.0'),
    dependency('gio-2.0'),
    dependency('libswresample'),
    meson.get_compiler('c').find_library('m', required: false),
    meson.get_compiler('vala').find_library('posix'),
]

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

and installed the libswresample-dev lib, but on compilation I receive the error

error: Package `libswresample' not found in specified Vala API directories or GObject-Introspection GIR directories

What I'm missing or doing wrong?

Thanks for your help

@elsiehupp
Copy link
Owner

You're probably not doing anything wrong.

This project is nowhere near in actual working condition (which I should probably make clearer in the README—sorry for the confusion 😬), and I've kind of set it aside for the moment while I work on other projects.

If you'd like to help, though, I would definitely welcome that!

I mean I could explain more if you'd like...

Basically my impression is that was making VAPIs from the wrong C header files, i.e. making VAPIs for internal headers, not the public API. I decided to take a break from this project when I realized that that was what I was doing wrong.

In general I hadn't quite yet figured out how to link the C headers to the VAPIs in Meson, yet, either. As I said, this is nowhere near usable...

@tudo75
Copy link
Author

tudo75 commented Apr 16, 2023

I started to work on how to write these vapis.
I know now that for every library you want to use you must create only one vapi file with the same name of the library.
eg: libavutil => libavutil.vapi
In the vapi file you must put references only to the classes, methods, consts, etc that you want to use from vala (so the internal use methods aren't necessary)
I started a small test here if you want to take a look:
https://github.com/tudo75/ValaFFmpeg

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

No branches or pull requests

2 participants