0

I am trying to build gedit and gedit-plugins using Meson on Fedora 34. Here I am using the fedora:34 container as the environment.

First I build gedit and install it to /opt, which works fine.

sudo dnf install meson ninja-build git
sudo dnf install 'dnf-command(builddep)'
sudo dnf builddep gedit
git clone https://gitlab.gnome.org/GNOME/gedit.git
cd gedit
mkdir build && cd build
meson --prefix /opt
ninja
sudo ninja install
cd ..

Now I want to build gedit-plugins and use the previous built gedit as a dependency.

git clone https://gitlab.gnome.org/GNOME/gedit-plugins.git
cd gedit-plugins
mkdir build && cd build
meson --prefix /opt

However, the last meson --prefix /opt command fails:

Run-time dependency gedit found: NO (tried pkgconfig)

../meson.build:29:0: ERROR: Dependency "gedit" not found, tried pkgconfig

A full log can be found at /gedit-plugins/build/meson-logs/meson-log.txt

I know that if I install gedit-devel, then this dependency can be solved by providing header files in /usr/include/gedit-40.0/gedit/. However, I would like meson to find header files in /opt/include/gedit-40.0/gedit/ automatically. How can I achieve this?

I tried LIBRARY_PATH=/opt meson --prefix /opt and LIBRARY_PATH=/gedit/build meson --prefix /opt, but neither work.

Eric Stdlib
  • 1,292
  • 1
  • 18
  • 32

2 Answers2

1

In meson.build like 29 checks the dependency via gedit_dep = dependency('gedit', version: '>= 40.0'). You can add your custom folder to look by editing the line as gedit_dep = dependency('gedit', version: '>= 40.0', dirs: '/opt').

This is because you have installed the libraries and dependency of gedit in /opt

Vipin Varghese
  • 4,540
  • 2
  • 9
  • 25
0

Try using Meson compiler.find_library().

Use:

  • dir argument to specify directories to search in for binary
  • has_headers and header_include_directories to specify which headers are required and where to search for them
Danijel
  • 8,198
  • 18
  • 69
  • 133