I’m trying to add a shared library dependency to a flatpak build but cannot get it to work. It seems like I must be missing something simple. Minimal example in this GitHub repo but reproduced below. The dependency is libportal.
I have the following manifest:
id: com.example.example
runtime: org.gnome.Platform
runtime-version: '47'
sdk: org.gnome.Sdk
command: example
finish-args:
- --share=ipc
- --device=dri
- --socket=wayland
- --socket=fallback-x11
modules:
- name: libportal
buildsystem: meson
sources:
- type: git
url: https://github.com/flatpak/libportal
tag: 0.9.0
- name: example
buildsystem: meson
sources:
- type: dir
path: .
The meson.build for the main module is:
project('example', 'c',
version: '0.1.0',
meson_version: '>= 1.0.0',
default_options: [ 'warning_level=2', 'werror=false', 'c_std=gnu11', ],
)
executable('example', 'example.c', dependencies: [dependency('libportal')])
with a trivial example.c source file. I then run:
flatpak-builder --user --force-clean --install builddir com.example.example.yaml
which builds libportal etc, but when it comes to building the main module, meson gives:
../meson.build:7:29: ERROR: Dependency "libportal" not found, tried pkgconfig and cmake
I’m not sure this is specific to libportal or just any shared library.
What do I do to make sure that dependencies that are installed as earlier modules can be found when building the main module?