libpeas-1.0 not found by meson-dependency but by pkg-config

1.1k Views Asked by At

I am using GNOME builder to create a vala project and tried to add libpeas-1.0 as a dependency to meson via:

dependency('libpeas-1.0', version: '>= 1.22')

which fails with:

src/meson.build:10:0: ERROR:  Native dependency 'libpeas-1.0' not found

if I execute:

pkg-config --print-provides libpeas-1.0

in the bash, I get:

libpeas-1.0 = 1.22.0

what also works is:

meson.get_compiler('vala').find_library('libpeas-1.0')

any ideas what migth be going wrong here?

1

There are 1 best solutions below

0
On BEST ANSWER

GNOME Builder is geared towards FlatPak, which is a containerization technology and infrastructure. The problem is probably the default Flatpak runtime used by GNOME Builder doesn't contain libpeas.

Clearly you have libpeas-1.0 installed on your host system. So one option is to get GNOME Builder to use the host operating system. There is an option to choose the Flatpak runtime. Choose Host Operating Sytem.

Alternatively you can add the libpeas-1.0 dependency as a module to your Flatpak manifest. The manifest is in JSON format so it means adding something like the following example that adds gee-0.8:

  "modules": [
    {
      "name": "libgee",
      "buildsystem": "meson",
      "config-opts": [
        "--libdir=lib"
      ],
      "builddir": true,
      "sources": [
        {
          "type": "git",
          "tag": "meson",
          "url": "https://github.com/GNOME/libgee.git"
        }
      ]
    }
  ]

There is a lengthy and detailed discussion in this StackOverflow question: Flatpak Meson Not Finding Vala Libraries From Gnome Builder. Hopefully that will give you enough information to get things working. It would be nice to simplify the instructions from that StackOverflow question so some documentation can be added to the Vala wiki's GNOME Builder page.